# cr-raksa/todo-mobile-app-with-flutter architecture

> Architecture diagram of the GitHub repository cr-raksa/todo-mobile-app-with-flutter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cr-raksa/todo-mobile-app-with-flutter
- Repository: https://github.com/cr-raksa/todo-mobile-app-with-flutter

## Overview

This is a cross-platform Flutter todo app. The main workflow is users signing in, loading tasks, then creating, editing, or deleting them; task state uses the API when available and local persistence as a fallback. Registration and profile editing are additional user-data workflows, while settings expose dark mode. The README documents these flows and the architecture; Dart implementation files were not excerpted, so relationships below rely on those documented statements rather than direct source inspection.

Main entry points: [`lib/features/models/todo_store.dart`](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/models/todo_store.dart) (Todo Store), [`lib/features/services/api_service.dart`](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/services/api_service.dart) (API Service), [`lib/features/auth/login_screen.dart`](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/auth/login_screen.dart) (Login), [`lib/features/presentation/todo_screen.dart`](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/presentation/todo_screen.dart) (Todo Screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and UI"]
  node_entry["App Entry<br/>[main.dart]"]
  node_settings["Settings"]
end

subgraph group_identity["Identity and Profile"]
  node_login["Login<br/>[login_screen.dart]"]
  node_register["Registration"]
  node_userstate["User State<br/>[user_provider.dart]"]
  node_profiles["Profile Screens"]
  node_userstorage[("User Storage")]
end

subgraph group_tasks["Task Management"]
  node_todo["Todo Screen<br/>[todo_screen.dart]"]
  node_addtask["Add Task"]
  node_edittask["Edit Task"]
  node_taskwidgets["Task Widgets"]
  node_store["Todo Store<br/>[todo_store.dart]"]
  node_taskmodels["Task Models<br/>[task_enums.dart]"]
end

subgraph group_data["Data and Persistence"]
  node_api["API Service<br/>[api_service.dart]"]
  node_server[("json-server<br/>[db.json]")]
  node_local[("Shared Preferences")]
end

node_user(("User"))

node_user -->|"uses"| node_entry
node_entry -->|"routes to"| node_login
node_entry -->|"routes to"| node_todo
node_user -->|"signs in"| node_login
node_user -->|"registers"| node_register
node_login -->|"tries login"| node_api
node_login -->|"falls back to"| node_userstorage
node_register -->|"tries registration"| node_api
node_register -->|"falls back to"| node_userstorage
node_userstate -->|"stores session"| node_userstorage
node_user -->|"manages tasks"| node_todo
node_todo -->|"uses state"| node_store
node_addtask -->|"creates task"| node_store
node_edittask -->|"updates task"| node_store
node_todo -->|"displays tasks"| node_taskwidgets
node_store -->|"syncs tasks"| node_api
node_store -->|"caches tasks"| node_local
node_api -->|"sends requests"| node_server
node_user -->|"edits profile"| node_profiles
node_profiles -->|"updates profile"| node_api
node_profiles -->|"falls back to"| node_userstorage
node_user -->|"changes preferences"| node_settings

click node_entry "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/main.dart"
click node_login "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/auth/login_screen.dart"
click node_register "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/auth/register_screen.dart"
click node_userstate "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/providers/user_provider.dart"
click node_profiles "https://github.com/cr-raksa/todo-mobile-app-with-flutter/tree/main/lib/features/profile/presentation"
click node_userstorage "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/models/user_share/user_share_pre.dart"
click node_todo "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/presentation/todo_screen.dart"
click node_addtask "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/presentation/add_task_screen.dart"
click node_edittask "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/presentation/edit_task_screen.dart"
click node_taskwidgets "https://github.com/cr-raksa/todo-mobile-app-with-flutter/tree/main/lib/features/widgets"
click node_store "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/models/todo_store.dart"
click node_taskmodels "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/models/task_enums.dart"
click node_settings "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/presentation/setting_screen.dart"
click node_api "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/services/api_service.dart"
click node_server "https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/data/db.json"

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_entry,node_settings,node_user toneBlue
class node_login,node_register,node_userstate,node_profiles,node_userstorage toneAmber
class node_todo,node_addtask,node_edittask,node_taskwidgets,node_store,node_taskmodels toneMint
class node_api,node_server,node_local toneRose
```

## Components

### App and UI

- [App Entry](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/main.dart): `lib/main.dart`
- [Settings](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/presentation/setting_screen.dart): `lib/features/presentation/setting_screen.dart`

### Identity and Profile

- [Login](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/auth/login_screen.dart): `lib/features/auth/login_screen.dart`
- [Registration](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/auth/register_screen.dart): `lib/features/auth/register_screen.dart`
- [User State](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/providers/user_provider.dart): `lib/features/providers/user_provider.dart`
- [Profile Screens](https://github.com/cr-raksa/todo-mobile-app-with-flutter/tree/main/lib/features/profile/presentation): `lib/features/profile/presentation`
- [User Storage](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/models/user_share/user_share_pre.dart): `lib/features/models/user_share/user_share_pre.dart`

### Task Management

- [Todo Screen](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/presentation/todo_screen.dart): `lib/features/presentation/todo_screen.dart`
- [Add Task](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/presentation/add_task_screen.dart): `lib/features/presentation/add_task_screen.dart`
- [Edit Task](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/presentation/edit_task_screen.dart): `lib/features/presentation/edit_task_screen.dart`
- [Task Widgets](https://github.com/cr-raksa/todo-mobile-app-with-flutter/tree/main/lib/features/widgets): `lib/features/widgets`
- [Todo Store](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/models/todo_store.dart): `lib/features/models/todo_store.dart`
- [Task Models](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/models/task_enums.dart): `lib/features/models/task_enums.dart`

### Data and Persistence

- [API Service](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/features/services/api_service.dart): `lib/features/services/api_service.dart`
- [json-server](https://github.com/cr-raksa/todo-mobile-app-with-flutter/blob/main/lib/data/db.json): `lib/data/db.json`
- **Shared Preferences**

### Other components

- **User**

## Connections

- User → App Entry: uses (evidence: `README.md`)
- App Entry → Login: routes to (evidence: `README.md`)
- App Entry → Todo Screen: routes to (evidence: `README.md`)
- User → Login: signs in (evidence: `README.md`)
- User → Registration: registers (evidence: `README.md`)
- Login → API Service: tries login (evidence: `README.md`)
- Login → User Storage: falls back to (evidence: `README.md`)
- Registration → API Service: tries registration (evidence: `README.md`)
- Registration → User Storage: falls back to (evidence: `README.md`)
- User State → User Storage: stores session (evidence: `README.md`)
- User → Todo Screen: manages tasks (evidence: `README.md`)
- Todo Screen → Todo Store: uses state (evidence: `README.md`)
- Add Task → Todo Store: creates task (evidence: `README.md`)
- Edit Task → Todo Store: updates task (evidence: `README.md`)
- Todo Screen → Task Widgets: displays tasks (evidence: `README.md`)
- Todo Store → API Service: syncs tasks (evidence: `README.md`)
- Todo Store → Shared Preferences: caches tasks (evidence: `README.md`)
- API Service → json-server: sends requests (evidence: `README.md`)
- User → Profile Screens: edits profile (evidence: `README.md`)
- Profile Screens → API Service: updates profile (evidence: `README.md`)
- Profile Screens → User Storage: falls back to (evidence: `README.md`)
- User → Settings: changes preferences (evidence: `README.md`)
