# ahmedzap/tito architecture

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

- Interactive diagram: https://gitdiagram.com/ahmedzap/tito
- Repository: https://github.com/ahmedzap/tito

## Overview

This is a Flutter application for managing requests and their approval workflow, backed by Supabase and including user, voucher, reporting, notification, and offline/synchronization features suggested by the source tree. The apparent primary journey is a user creating a request, tracking its workflow, and acting on assigned tasks. The README is only Flutter boilerplate, and the Dart implementation was not excerpted, so most client-to-backend relationships are shown as unverified rather than asserted. Platform runner scaffolding is omitted as incidental to the product architecture.

Main entry points: [`lib/features/requests/data/requests_repository.dart`](https://github.com/ahmedzap/tito/blob/main/lib/features/requests/data/requests_repository.dart) (Request data access), [`lib/core/router/app_router.dart`](https://github.com/ahmedzap/tito/blob/main/lib/core/router/app_router.dart) (App navigation), [`lib/features/presentation/screens/request_details_screen.dart`](https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/screens/request_details_screen.dart) (Request details), [`lib/features/presentation/providers/requests_provider.dart`](https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/providers/requests_provider.dart) (Request state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["App experience"]
  node_app["App entry<br/>[main.dart]"]
  node_navigation["App navigation<br/>[app_router.dart]"]
  node_home["Home and tasks<br/>[tasks_screen.dart]"]
  node_request_ui["Request screens"]
  node_details_ui["Request details"]
  node_auth_ui["Sign-in screen<br/>[login_screen.dart]"]
end

subgraph group_domain["Request operations"]
  node_request_state["Request state"]
  node_create_state["Request creation"]
  node_request_data["Request data access"]
  node_workflow_ui["Workflow timeline"]
  node_auth_data["Authentication"]
end

subgraph group_data["Data and sync"]
  node_database[("Local database<br/>[database.dart]")]
  node_requests_dao["Request records<br/>[requests_dao.dart]"]
  node_sync_queue["Sync queue"]
  node_sync["Synchronization<br/>[sync_service.dart]"]
  node_supabase_client["Supabase client"]
end

subgraph group_backend["Workflow services"]
  node_start_workflow["Start workflow<br/>[index.ts]"]
  node_workflow_action["Workflow actions<br/>[index.ts]"]
  node_create_user["Create user service<br/>[index.ts]"]
end

subgraph group_support["Cross-cutting services"]
  node_notifications["Notifications"]
  node_push_service["Push notification function<br/>[index.ts]"]
  node_reports["Reports"]
  node_exports["PDF and spreadsheet export<br/>[pdf_service.dart]"]
  node_vouchers["Vouchers"]
end

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

node_user -.->|"opens"| node_app
node_app -.->|"starts"| node_navigation
node_navigation -.->|"routes to"| node_home
node_navigation -.->|"routes to"| node_request_ui
node_navigation -.->|"routes to"| node_details_ui
node_navigation -.->|"routes to"| node_auth_ui
node_request_ui -.->|"submits to"| node_create_state
node_details_ui -.->|"loads from"| node_request_state
node_home -.->|"loads from"| node_request_state
node_create_state -.->|"uses"| node_request_data
node_request_state -.->|"uses"| node_request_data
node_details_ui -.->|"displays"| node_workflow_ui
node_auth_ui -.->|"authenticates through"| node_auth_data
node_request_data -.->|"accesses"| node_supabase_client
node_request_data -.->|"uses"| node_requests_dao
node_requests_dao -.->|"reads and writes"| node_database
node_sync -.->|"uses"| node_sync_queue
node_sync -.->|"synchronizes with"| node_supabase_client
node_request_data -.->|"starts workflow"| node_start_workflow
node_request_data -.->|"submits action"| node_workflow_action
node_start_workflow -.->|"updates"| node_supabase
node_workflow_action -.->|"updates"| node_supabase
node_create_user -.->|"creates account"| node_supabase
node_notifications -.->|"requests push"| node_push_service
node_push_service -.->|"uses"| node_supabase
node_user -.->|"requests reports"| node_reports
node_reports -.->|"exports"| node_exports
node_user -.->|"manages"| node_vouchers

click node_app "https://github.com/ahmedzap/tito/blob/main/lib/main.dart"
click node_navigation "https://github.com/ahmedzap/tito/blob/main/lib/core/router/app_router.dart"
click node_home "https://github.com/ahmedzap/tito/blob/main/lib/features/dashboard/presentation/widgets/tasks_screen.dart"
click node_request_ui "https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/screens/create_request_screen.dart"
click node_details_ui "https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/screens/request_details_screen.dart"
click node_auth_ui "https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/screens/login_screen.dart"
click node_request_state "https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/providers/requests_provider.dart"
click node_create_state "https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/providers/create_request_provider.dart"
click node_request_data "https://github.com/ahmedzap/tito/blob/main/lib/features/requests/data/requests_repository.dart"
click node_workflow_ui "https://github.com/ahmedzap/tito/blob/main/lib/features/dashboard/presentation/widgets/workflow_timeline.dart"
click node_auth_data "https://github.com/ahmedzap/tito/blob/main/lib/features/auth/data/auth_repository.dart"
click node_database "https://github.com/ahmedzap/tito/blob/main/lib/data/local/database.dart"
click node_requests_dao "https://github.com/ahmedzap/tito/blob/main/lib/data/local/daos/requests_dao.dart"
click node_sync_queue "https://github.com/ahmedzap/tito/blob/main/lib/data/local/daos/sync_queue_dao.dart"
click node_sync "https://github.com/ahmedzap/tito/blob/main/lib/core/services/sync_service.dart"
click node_supabase_client "https://github.com/ahmedzap/tito/blob/main/lib/data/remote/supabase_client.dart"
click node_start_workflow "https://github.com/ahmedzap/tito/blob/main/supabase/functions/start-workflow/index.ts"
click node_workflow_action "https://github.com/ahmedzap/tito/blob/main/supabase/functions/workflow-action/index.ts"
click node_create_user "https://github.com/ahmedzap/tito/blob/main/supabase/functions/create-user/index.ts"
click node_notifications "https://github.com/ahmedzap/tito/blob/main/lib/core/services/notification_service.dart"
click node_push_service "https://github.com/ahmedzap/tito/blob/main/supabase/functions/send-push-notification/index.ts"
click node_reports "https://github.com/ahmedzap/tito/blob/main/lib/features/reports/reports_repository.dart"
click node_exports "https://github.com/ahmedzap/tito/blob/main/lib/core/services/pdf_service.dart"
click node_vouchers "https://github.com/ahmedzap/tito/blob/main/lib/features/requests/data/vouchers_repository.dart"

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_app,node_navigation,node_home,node_request_ui,node_details_ui,node_auth_ui,node_user toneBlue
class node_request_state,node_create_state,node_request_data,node_workflow_ui,node_auth_data,node_supabase toneAmber
class node_database,node_requests_dao,node_sync_queue,node_sync,node_supabase_client toneMint
class node_start_workflow,node_workflow_action,node_create_user toneRose
class node_notifications,node_push_service,node_reports,node_exports,node_vouchers toneIndigo
```

## Components

### App experience

- [App entry](https://github.com/ahmedzap/tito/blob/main/lib/main.dart): `lib/main.dart`
- [App navigation](https://github.com/ahmedzap/tito/blob/main/lib/core/router/app_router.dart): `lib/core/router/app_router.dart`
- [Home and tasks](https://github.com/ahmedzap/tito/blob/main/lib/features/dashboard/presentation/widgets/tasks_screen.dart): `lib/features/dashboard/presentation/widgets/tasks_screen.dart`
- [Request screens](https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/screens/create_request_screen.dart): `lib/features/presentation/screens/create_request_screen.dart`
- [Request details](https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/screens/request_details_screen.dart): `lib/features/presentation/screens/request_details_screen.dart`
- [Sign-in screen](https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/screens/login_screen.dart): `lib/features/presentation/screens/login_screen.dart`

### Request operations

- [Request state](https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/providers/requests_provider.dart): `lib/features/presentation/providers/requests_provider.dart`
- [Request creation](https://github.com/ahmedzap/tito/blob/main/lib/features/presentation/providers/create_request_provider.dart): `lib/features/presentation/providers/create_request_provider.dart`
- [Request data access](https://github.com/ahmedzap/tito/blob/main/lib/features/requests/data/requests_repository.dart): `lib/features/requests/data/requests_repository.dart`
- [Workflow timeline](https://github.com/ahmedzap/tito/blob/main/lib/features/dashboard/presentation/widgets/workflow_timeline.dart): `lib/features/dashboard/presentation/widgets/workflow_timeline.dart`
- [Authentication](https://github.com/ahmedzap/tito/blob/main/lib/features/auth/data/auth_repository.dart): `lib/features/auth/data/auth_repository.dart`

### Data and sync

- [Local database](https://github.com/ahmedzap/tito/blob/main/lib/data/local/database.dart): `lib/data/local/database.dart`
- [Request records](https://github.com/ahmedzap/tito/blob/main/lib/data/local/daos/requests_dao.dart): `lib/data/local/daos/requests_dao.dart`
- [Sync queue](https://github.com/ahmedzap/tito/blob/main/lib/data/local/daos/sync_queue_dao.dart): `lib/data/local/daos/sync_queue_dao.dart`
- [Synchronization](https://github.com/ahmedzap/tito/blob/main/lib/core/services/sync_service.dart): `lib/core/services/sync_service.dart`
- [Supabase client](https://github.com/ahmedzap/tito/blob/main/lib/data/remote/supabase_client.dart): `lib/data/remote/supabase_client.dart`

### Workflow services

- [Start workflow](https://github.com/ahmedzap/tito/blob/main/supabase/functions/start-workflow/index.ts): `supabase/functions/start-workflow/index.ts`
- [Workflow actions](https://github.com/ahmedzap/tito/blob/main/supabase/functions/workflow-action/index.ts): `supabase/functions/workflow-action/index.ts`
- [Create user service](https://github.com/ahmedzap/tito/blob/main/supabase/functions/create-user/index.ts): `supabase/functions/create-user/index.ts`

### Cross-cutting services

- [Notifications](https://github.com/ahmedzap/tito/blob/main/lib/core/services/notification_service.dart): `lib/core/services/notification_service.dart`
- [Push notification function](https://github.com/ahmedzap/tito/blob/main/supabase/functions/send-push-notification/index.ts): `supabase/functions/send-push-notification/index.ts`
- [Reports](https://github.com/ahmedzap/tito/blob/main/lib/features/reports/reports_repository.dart): `lib/features/reports/reports_repository.dart`
- [PDF and spreadsheet export](https://github.com/ahmedzap/tito/blob/main/lib/core/services/pdf_service.dart): `lib/core/services/pdf_service.dart`
- [Vouchers](https://github.com/ahmedzap/tito/blob/main/lib/features/requests/data/vouchers_repository.dart): `lib/features/requests/data/vouchers_repository.dart`

### Other components

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

## Connections

- User → App entry: opens
- App entry → App navigation: starts
- App navigation → Home and tasks: routes to
- App navigation → Request screens: routes to
- App navigation → Request details: routes to
- App navigation → Sign-in screen: routes to
- Request screens → Request creation: submits to
- Request details → Request state: loads from
- Home and tasks → Request state: loads from
- Request creation → Request data access: uses
- Request state → Request data access: uses
- Request details → Workflow timeline: displays
- Sign-in screen → Authentication: authenticates through
- Request data access → Supabase client: accesses
- Request data access → Request records: uses
- Request records → Local database: reads and writes
- Synchronization → Sync queue: uses
- Synchronization → Supabase client: synchronizes with
- Request data access → Start workflow: starts workflow
- Request data access → Workflow actions: submits action
- Start workflow → Supabase service: updates
- Workflow actions → Supabase service: updates
- Create user service → Supabase service: creates account
- Notifications → Push notification function: requests push
- Push notification function → Supabase service: uses
- User → Reports: requests reports
- Reports → PDF and spreadsheet export: exports
- User → Vouchers: manages
