# lucrilhos/constancia_app architecture

> Architecture diagram of the GitHub repository lucrilhos/constancia_app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lucrilhos/constancia_app
- Repository: https://github.com/lucrilhos/constancia_app

## Overview

constancia. is a Flutter productivity app combining task management, daily streaks and points, social task comments, and Pomodoro-style focus/rest cycles. The documented user flow is registration, cycle selection, then the main dashboard; users can open task details and start a focus cycle, or browse board and blocked-task views. Screens initially use local sample tasks while Supabase data loads. The README describes these capabilities and relationships; source excerpts were limited to Android build configuration, so implementation-level calls cannot be verified.

Main entry points: [`lib/screens/constancia_screen.dart`](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/constancia_screen.dart) (Dashboard), [`lib/screens/card_detail_screen.dart`](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/card_detail_screen.dart) (Task detail), [`lib/data/supabase_service.dart`](https://github.com/lucrilhos/constancia_app/blob/main/lib/data/supabase_service.dart) (Supabase service), [`lib/screens/cadastro_screen.dart`](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/cadastro_screen.dart) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_registration["Registration"]
  node_onboarding["Cycle setup"]
  node_dashboard["Dashboard"]
  node_shell["Screen shell<br/>[home_shell.dart]"]
  node_settings["Settings"]
end

subgraph group_tasks["Task workflow"]
  node_board["Task board<br/>[board_screen.dart]"]
  node_task_detail["Task detail"]
  node_blocked["Blocked tasks"]
  node_task_model["Task model"]
end

subgraph group_focus["Focus and habits"]
  node_focus_timer["Focus timer"]
  node_focus_model["Focus cycle<br/>[focus_cycle.dart]"]
  node_completion["Completion state"]
end

subgraph group_data["Data and persistence"]
  node_sample_tasks["Sample tasks<br/>[sample_tasks.dart]"]
  node_user_state["User state<br/>[app_user.dart]"]
  node_cycle_state["Cycle state<br/>[app_cycle.dart]"]
  node_supabase_service["Supabase service"]
  node_supabase_schema[("Database schema<br/>[schema.sql]")]
end

node_user(("User"))
node_supabase[("Supabase")]

node_user -->|"registers"| node_registration
node_registration -->|"continues to"| node_onboarding
node_onboarding -->|"opens"| node_dashboard
node_user -->|"uses"| node_dashboard
node_dashboard -->|"opens card"| node_task_detail
node_task_detail -->|"starts cycle"| node_focus_timer
node_dashboard -->|"opens tab"| node_board
node_dashboard -->|"opens tab"| node_blocked
node_dashboard -->|"opens settings"| node_settings
node_dashboard -->|"loads fallback"| node_sample_tasks
node_board -->|"loads fallback"| node_sample_tasks
node_task_detail -->|"loads fallback"| node_sample_tasks
node_dashboard -->|"fetches data"| node_supabase_service
node_board -->|"fetches data"| node_supabase_service
node_task_detail -->|"fetches data"| node_supabase_service
node_supabase_service -->|"queries"| node_supabase
node_supabase_schema -->|"defines tables"| node_supabase
node_focus_timer -.->|"uses cycle"| node_focus_model
node_focus_timer -->|"marks task"| node_completion
node_dashboard -->|"shares state"| node_completion
node_registration -->|"stores name"| node_user_state
node_onboarding -->|"selects cycle"| node_cycle_state

click node_registration "https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/cadastro_screen.dart"
click node_onboarding "https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/onboarding_screen.dart"
click node_dashboard "https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/constancia_screen.dart"
click node_shell "https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/home_shell.dart"
click node_settings "https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/configuracoes_screen.dart"
click node_board "https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/board_screen.dart"
click node_task_detail "https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/card_detail_screen.dart"
click node_blocked "https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/travados_screen.dart"
click node_task_model "https://github.com/lucrilhos/constancia_app/blob/main/lib/models/task_card_model.dart"
click node_sample_tasks "https://github.com/lucrilhos/constancia_app/blob/main/lib/data/sample_tasks.dart"
click node_focus_timer "https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/focus_cycle_screen.dart"
click node_focus_model "https://github.com/lucrilhos/constancia_app/blob/main/lib/models/focus_cycle.dart"
click node_completion "https://github.com/lucrilhos/constancia_app/blob/main/lib/data/task_completion.dart"
click node_user_state "https://github.com/lucrilhos/constancia_app/blob/main/lib/data/app_user.dart"
click node_cycle_state "https://github.com/lucrilhos/constancia_app/blob/main/lib/data/app_cycle.dart"
click node_supabase_service "https://github.com/lucrilhos/constancia_app/blob/main/lib/data/supabase_service.dart"
click node_supabase_schema "https://github.com/lucrilhos/constancia_app/blob/main/supabase/schema.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_registration,node_onboarding,node_dashboard,node_shell,node_settings,node_user toneBlue
class node_board,node_task_detail,node_blocked,node_task_model,node_supabase toneAmber
class node_focus_timer,node_focus_model,node_completion toneMint
class node_sample_tasks,node_user_state,node_cycle_state,node_supabase_service,node_supabase_schema toneRose
```

## Components

### App experience

- [Registration](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/cadastro_screen.dart): `lib/screens/cadastro_screen.dart`
- [Cycle setup](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/onboarding_screen.dart): `lib/screens/onboarding_screen.dart`
- [Dashboard](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/constancia_screen.dart): `lib/screens/constancia_screen.dart`
- [Screen shell](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/home_shell.dart): `lib/screens/home_shell.dart`
- [Settings](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/configuracoes_screen.dart): `lib/screens/configuracoes_screen.dart`

### Task workflow

- [Task board](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/board_screen.dart): `lib/screens/board_screen.dart`
- [Task detail](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/card_detail_screen.dart): `lib/screens/card_detail_screen.dart`
- [Blocked tasks](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/travados_screen.dart): `lib/screens/travados_screen.dart`
- [Task model](https://github.com/lucrilhos/constancia_app/blob/main/lib/models/task_card_model.dart): `lib/models/task_card_model.dart`

### Focus and habits

- [Focus timer](https://github.com/lucrilhos/constancia_app/blob/main/lib/screens/focus_cycle_screen.dart): `lib/screens/focus_cycle_screen.dart`
- [Focus cycle](https://github.com/lucrilhos/constancia_app/blob/main/lib/models/focus_cycle.dart): `lib/models/focus_cycle.dart`
- [Completion state](https://github.com/lucrilhos/constancia_app/blob/main/lib/data/task_completion.dart): `lib/data/task_completion.dart`

### Data and persistence

- [Sample tasks](https://github.com/lucrilhos/constancia_app/blob/main/lib/data/sample_tasks.dart): `lib/data/sample_tasks.dart`
- [User state](https://github.com/lucrilhos/constancia_app/blob/main/lib/data/app_user.dart): `lib/data/app_user.dart`
- [Cycle state](https://github.com/lucrilhos/constancia_app/blob/main/lib/data/app_cycle.dart): `lib/data/app_cycle.dart`
- [Supabase service](https://github.com/lucrilhos/constancia_app/blob/main/lib/data/supabase_service.dart): `lib/data/supabase_service.dart`
- [Database schema](https://github.com/lucrilhos/constancia_app/blob/main/supabase/schema.sql): `supabase/schema.sql`

### Other components

- **User**
- **Supabase**

## Connections

- User → Registration: registers (evidence: `README.md`)
- Registration → Cycle setup: continues to (evidence: `README.md`)
- Cycle setup → Dashboard: opens (evidence: `README.md`)
- User → Dashboard: uses (evidence: `README.md`)
- Dashboard → Task detail: opens card (evidence: `README.md`)
- Task detail → Focus timer: starts cycle (evidence: `README.md`)
- Dashboard → Task board: opens tab (evidence: `README.md`)
- Dashboard → Blocked tasks: opens tab (evidence: `README.md`)
- Dashboard → Settings: opens settings (evidence: `README.md`)
- Dashboard → Sample tasks: loads fallback (evidence: `README.md`)
- Task board → Sample tasks: loads fallback (evidence: `README.md`)
- Task detail → Sample tasks: loads fallback (evidence: `README.md`)
- Dashboard → Supabase service: fetches data (evidence: `README.md`)
- Task board → Supabase service: fetches data (evidence: `README.md`)
- Task detail → Supabase service: fetches data (evidence: `README.md`)
- Supabase service → Supabase: queries (evidence: `README.md`)
- Database schema → Supabase: defines tables (evidence: `README.md`)
- Focus timer → Focus cycle: uses cycle
- Focus timer → Completion state: marks task (evidence: `README.md`)
- Dashboard → Completion state: shares state (evidence: `README.md`)
- Registration → User state: stores name (evidence: `README.md`)
- Cycle setup → Cycle state: selects cycle (evidence: `README.md`)
