# apknation/zero-foleni architecture

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

- Interactive diagram: https://gitdiagram.com/apknation/zero-foleni
- Repository: https://github.com/apknation/zero-foleni

## Overview

Zero Foleni is a Flutter client with a Django/Graphene backend for citizen accounts, bank and institution services, appointments, and queue tickets. The evident backend workflow is a client request to the GraphQL endpoint, schema resolvers or mutations operating on domain models, and persisted results. Flutter feature screens and its API wiring are represented from the tree only; their connections are unverified. The root and backend schema files are both substantial indexed modules, but only the backend schema is explicitly configured by Django settings.

Main entry points: [`lib/core/services/api_service.dart`](https://github.com/apknation/zero-foleni/blob/main/lib/core/services/api_service.dart) (API client), [`backend/zerofoleni/core/models.py`](https://github.com/apknation/zero-foleni/blob/main/backend/zerofoleni/core/models.py) (Backend models), [`lib/features/auth`](https://github.com/apknation/zero-foleni/tree/main/lib/features/auth) (Account access), [`lib/features/home`](https://github.com/apknation/zero-foleni/tree/main/lib/features/home) (Home and services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Flutter client"]
  node_auth["Account access"]
  node_home["Home and services"]
  node_banks["Bank services"]
  node_institutions["Institution services"]
  node_government["Government services"]
  node_universities["University services"]
  node_booking["Appointments"]
  node_queue["Queue tracking"]
  node_history["Visit history"]
  node_profile["Citizen profile"]
  node_flutter_api["API client<br/>[api_service.dart]"]
  node_router["App navigation<br/>[app_router.dart]"]
end

subgraph group_service["API service"]
  node_graphql_route["GraphQL endpoint<br/>[urls.py]"]
  node_schema["GraphQL schema<br/>[schema.py]"]
  node_root_schema["Root schema copy<br/>[schema.py]"]
end

subgraph group_domain["Domain data"]
  node_domain_models["Domain models<br/>[models.py]"]
  node_backend_models["Backend models<br/>[models.py]"]
  node_database[("PostgreSQL")]
end

subgraph group_operations["Data operations"]
  node_seed["Initial data seeding<br/>[seed_data.py]"]
end

node_citizen(("Citizen"))

node_citizen -.->|"uses"| node_auth
node_citizen -.->|"browses"| node_home
node_citizen -.->|"selects services"| node_banks
node_citizen -.->|"selects services"| node_institutions
node_citizen -.->|"selects services"| node_government
node_citizen -.->|"selects services"| node_universities
node_citizen -.->|"books appointments"| node_booking
node_citizen -.->|"tracks tickets"| node_queue
node_citizen -.->|"views history"| node_history
node_citizen -.->|"views profile"| node_profile
node_auth -.->|"uses"| node_flutter_api
node_home -.->|"uses"| node_flutter_api
node_banks -.->|"uses"| node_flutter_api
node_institutions -.->|"uses"| node_flutter_api
node_government -.->|"uses"| node_flutter_api
node_universities -.->|"uses"| node_flutter_api
node_booking -.->|"uses"| node_flutter_api
node_queue -.->|"uses"| node_flutter_api
node_flutter_api -.->|"sends requests"| node_graphql_route
node_graphql_route -->|"serves GraphQL"| node_schema
node_schema -->|"queries and mutates"| node_backend_models
node_backend_models -.->|"persists records"| node_database
node_seed -->|"creates sample records"| node_backend_models
node_root_schema -->|"queries and mutates"| node_domain_models

click node_auth "https://github.com/apknation/zero-foleni/tree/main/lib/features/auth"
click node_home "https://github.com/apknation/zero-foleni/tree/main/lib/features/home"
click node_banks "https://github.com/apknation/zero-foleni/tree/main/lib/features/bank/screens"
click node_institutions "https://github.com/apknation/zero-foleni/tree/main/lib/features/hospitals"
click node_government "https://github.com/apknation/zero-foleni/tree/main/lib/features/government/screens"
click node_universities "https://github.com/apknation/zero-foleni/tree/main/lib/features/university/screens"
click node_booking "https://github.com/apknation/zero-foleni/tree/main/lib/features/booking"
click node_queue "https://github.com/apknation/zero-foleni/tree/main/lib/features/queue"
click node_history "https://github.com/apknation/zero-foleni/tree/main/lib/features/history"
click node_profile "https://github.com/apknation/zero-foleni/tree/main/lib/features/profile"
click node_flutter_api "https://github.com/apknation/zero-foleni/blob/main/lib/core/services/api_service.dart"
click node_router "https://github.com/apknation/zero-foleni/blob/main/lib/core/router/app_router.dart"
click node_graphql_route "https://github.com/apknation/zero-foleni/blob/main/backend/zerofoleni/zerofoleni/urls.py"
click node_schema "https://github.com/apknation/zero-foleni/blob/main/backend/zerofoleni/zerofoleni/schema.py"
click node_root_schema "https://github.com/apknation/zero-foleni/blob/main/zerofoleni/schema.py"
click node_domain_models "https://github.com/apknation/zero-foleni/blob/main/core/models.py"
click node_backend_models "https://github.com/apknation/zero-foleni/blob/main/backend/zerofoleni/core/models.py"
click node_seed "https://github.com/apknation/zero-foleni/blob/main/backend/zerofoleni/core/management/commands/seed_data.py"

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_auth,node_home,node_banks,node_institutions,node_government,node_universities,node_booking,node_queue,node_history,node_profile,node_flutter_api,node_router toneBlue
class node_graphql_route,node_schema,node_root_schema toneAmber
class node_domain_models,node_backend_models,node_database toneMint
class node_seed toneRose
class node_citizen toneIndigo
```

## Components

### Flutter client

- [Account access](https://github.com/apknation/zero-foleni/tree/main/lib/features/auth): `lib/features/auth`
- [Home and services](https://github.com/apknation/zero-foleni/tree/main/lib/features/home): `lib/features/home`
- [Bank services](https://github.com/apknation/zero-foleni/tree/main/lib/features/bank/screens): `lib/features/bank/screens`
- [Institution services](https://github.com/apknation/zero-foleni/tree/main/lib/features/hospitals): `lib/features/hospitals`
- [Government services](https://github.com/apknation/zero-foleni/tree/main/lib/features/government/screens): `lib/features/government/screens`
- [University services](https://github.com/apknation/zero-foleni/tree/main/lib/features/university/screens): `lib/features/university/screens`
- [Appointments](https://github.com/apknation/zero-foleni/tree/main/lib/features/booking): `lib/features/booking`
- [Queue tracking](https://github.com/apknation/zero-foleni/tree/main/lib/features/queue): `lib/features/queue`
- [Visit history](https://github.com/apknation/zero-foleni/tree/main/lib/features/history): `lib/features/history`
- [Citizen profile](https://github.com/apknation/zero-foleni/tree/main/lib/features/profile): `lib/features/profile`
- [API client](https://github.com/apknation/zero-foleni/blob/main/lib/core/services/api_service.dart): `lib/core/services/api_service.dart`
- [App navigation](https://github.com/apknation/zero-foleni/blob/main/lib/core/router/app_router.dart): `lib/core/router/app_router.dart`

### API service

- [GraphQL endpoint](https://github.com/apknation/zero-foleni/blob/main/backend/zerofoleni/zerofoleni/urls.py): `backend/zerofoleni/zerofoleni/urls.py`
- [GraphQL schema](https://github.com/apknation/zero-foleni/blob/main/backend/zerofoleni/zerofoleni/schema.py): `backend/zerofoleni/zerofoleni/schema.py`
- [Root schema copy](https://github.com/apknation/zero-foleni/blob/main/zerofoleni/schema.py): `zerofoleni/schema.py`

### Domain data

- [Domain models](https://github.com/apknation/zero-foleni/blob/main/core/models.py): `core/models.py`
- [Backend models](https://github.com/apknation/zero-foleni/blob/main/backend/zerofoleni/core/models.py): `backend/zerofoleni/core/models.py`
- **PostgreSQL**

### Data operations

- [Initial data seeding](https://github.com/apknation/zero-foleni/blob/main/backend/zerofoleni/core/management/commands/seed_data.py): `backend/zerofoleni/core/management/commands/seed_data.py`

### Other components

- **Citizen**

## Connections

- Citizen → Account access: uses
- Citizen → Home and services: browses
- Citizen → Bank services: selects services
- Citizen → Institution services: selects services
- Citizen → Government services: selects services
- Citizen → University services: selects services
- Citizen → Appointments: books appointments
- Citizen → Queue tracking: tracks tickets
- Citizen → Visit history: views history
- Citizen → Citizen profile: views profile
- Account access → API client: uses
- Home and services → API client: uses
- Bank services → API client: uses
- Institution services → API client: uses
- Government services → API client: uses
- University services → API client: uses
- Appointments → API client: uses
- Queue tracking → API client: uses
- API client → GraphQL endpoint: sends requests
- GraphQL endpoint → GraphQL schema: serves GraphQL (evidence: `backend/zerofoleni/zerofoleni/urls.py`)
- GraphQL schema → Backend models: queries and mutates (evidence: `backend/zerofoleni/zerofoleni/schema.py`)
- Backend models → PostgreSQL: persists records
- Initial data seeding → Backend models: creates sample records (evidence: `backend/zerofoleni/core/management/commands/seed_data.py`)
- Root schema copy → Domain models: queries and mutates (evidence: `zerofoleni/schema.py`)
