# ahmedalfaky95/passport architecture

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

- Interactive diagram: https://gitdiagram.com/ahmedalfaky95/passport
- Repository: https://github.com/ahmedalfaky95/passport

## Overview

Passport is a Flutter app for account access and online passport services. Its documented user workflow covers registration and login, then applying for a new passport or renewing one, receiving a payment reference, and tracking request status; password reset and settings are additional capabilities. The README describes a single API service that supports both a local demo mode and optional PHP backend calls, with demo data saved on-device. Source excerpts cover no Dart implementation, so the relationships below rely on README documentation; screen routing and internal call details remain unverified.

Main entry points: [`lib/services/api_service.dart`](https://github.com/ahmedalfaky95/passport/blob/main/lib/services/api_service.dart) (API service), [`lib/screens/new_passport_screen.dart`](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/new_passport_screen.dart) (New passport), [`lib/screens/passport_renewal_screen.dart`](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/passport_renewal_screen.dart) (Passport renewal), [`lib/screens/request_submitted_dialog.dart`](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/request_submitted_dialog.dart) (Request confirmation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_entry["App entry<br/>[main.dart]"]
  node_config["App configuration<br/>[app_config.dart]"]
  node_home["Home<br/>[home_screen.dart]"]
  node_settings["Settings and logout"]
end

subgraph group_account["Account access"]
  node_login["Login<br/>[login_screen.dart]"]
  node_registration["Registration"]
  node_password_reset["Password reset"]
  node_otp["OTP verification<br/>[otp_screen.dart]"]
  node_reset_password["Set new password"]
end

subgraph group_services["Passport services"]
  node_new_passport["New passport"]
  node_renewal["Passport renewal"]
  node_confirmation["Request confirmation"]
  node_tracking["Request tracking"]
end

subgraph group_runtime["Data and integrations"]
  node_api["API service<br/>[api_service.dart]"]
  node_local_data[("Local demo data<br/>[api_service.dart]")]
  node_backend["PHP backend"]
  node_sms["SMS provider"]
end

node_user(("Passport user"))

node_user -->|"starts app"| node_entry
node_user -->|"creates account"| node_registration
node_user -->|"logs in"| node_login
node_user -->|"resets password"| node_password_reset
node_user -->|"applies"| node_new_passport
node_user -->|"renews passport"| node_renewal
node_user -->|"tracks request"| node_tracking
node_user -->|"opens settings"| node_settings
node_entry -.->|"uses settings"| node_config
node_registration -->|"registers account"| node_api
node_login -->|"authenticates"| node_api
node_password_reset -->|"requests code"| node_otp
node_otp -->|"verifies code"| node_reset_password
node_reset_password -->|"updates password"| node_api
node_new_passport -->|"submits application"| node_api
node_renewal -->|"submits renewal"| node_api
node_new_passport -.->|"shows confirmation"| node_confirmation
node_renewal -.->|"shows confirmation"| node_confirmation
node_confirmation -->|"shows reference"| node_user
node_tracking -->|"loads requests"| node_api
node_api -->|"stores demo data"| node_local_data
node_api -.->|"calls endpoints"| node_backend
node_api -.->|"sends OTP"| node_sms

click node_entry "https://github.com/ahmedalfaky95/passport/blob/main/lib/main.dart"
click node_config "https://github.com/ahmedalfaky95/passport/blob/main/lib/config/app_config.dart"
click node_login "https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/login_screen.dart"
click node_registration "https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/registration_screen.dart"
click node_password_reset "https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/forgot_password_screen.dart"
click node_otp "https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/otp_screen.dart"
click node_reset_password "https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/reset_password_screen.dart"
click node_home "https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/home_screen.dart"
click node_new_passport "https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/new_passport_screen.dart"
click node_renewal "https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/passport_renewal_screen.dart"
click node_confirmation "https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/request_submitted_dialog.dart"
click node_tracking "https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/track_request_screen.dart"
click node_settings "https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/settings_screen.dart"
click node_api "https://github.com/ahmedalfaky95/passport/blob/main/lib/services/api_service.dart"
click node_local_data "https://github.com/ahmedalfaky95/passport/blob/main/lib/services/api_service.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_entry,node_config,node_home,node_settings,node_user toneBlue
class node_login,node_registration,node_password_reset,node_otp,node_reset_password toneAmber
class node_new_passport,node_renewal,node_confirmation,node_tracking toneMint
class node_api,node_local_data,node_backend,node_sms toneRose
```

## Components

### App shell

- [App entry](https://github.com/ahmedalfaky95/passport/blob/main/lib/main.dart): `lib/main.dart`
- [App configuration](https://github.com/ahmedalfaky95/passport/blob/main/lib/config/app_config.dart): `lib/config/app_config.dart`
- [Home](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`
- [Settings and logout](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/settings_screen.dart): `lib/screens/settings_screen.dart`

### Account access

- [Login](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/login_screen.dart): `lib/screens/login_screen.dart`
- [Registration](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/registration_screen.dart): `lib/screens/registration_screen.dart`
- [Password reset](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/forgot_password_screen.dart): `lib/screens/forgot_password_screen.dart`
- [OTP verification](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/otp_screen.dart): `lib/screens/otp_screen.dart`
- [Set new password](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/reset_password_screen.dart): `lib/screens/reset_password_screen.dart`

### Passport services

- [New passport](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/new_passport_screen.dart): `lib/screens/new_passport_screen.dart`
- [Passport renewal](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/passport_renewal_screen.dart): `lib/screens/passport_renewal_screen.dart`
- [Request confirmation](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/request_submitted_dialog.dart): `lib/screens/request_submitted_dialog.dart`
- [Request tracking](https://github.com/ahmedalfaky95/passport/blob/main/lib/screens/track_request_screen.dart): `lib/screens/track_request_screen.dart`

### Data and integrations

- [API service](https://github.com/ahmedalfaky95/passport/blob/main/lib/services/api_service.dart): `lib/services/api_service.dart`
- [Local demo data](https://github.com/ahmedalfaky95/passport/blob/main/lib/services/api_service.dart): `lib/services/api_service.dart`
- **PHP backend**
- **SMS provider**

### Other components

- **Passport user**

## Connections

- Passport user → App entry: starts app (evidence: `README.md`)
- Passport user → Registration: creates account (evidence: `README.md`)
- Passport user → Login: logs in (evidence: `README.md`)
- Passport user → Password reset: resets password (evidence: `README.md`)
- Passport user → New passport: applies (evidence: `README.md`)
- Passport user → Passport renewal: renews passport (evidence: `README.md`)
- Passport user → Request tracking: tracks request (evidence: `README.md`)
- Passport user → Settings and logout: opens settings (evidence: `README.md`)
- App entry → App configuration: uses settings
- Registration → API service: registers account (evidence: `README.md`)
- Login → API service: authenticates (evidence: `README.md`)
- Password reset → OTP verification: requests code (evidence: `README.md`)
- OTP verification → Set new password: verifies code (evidence: `README.md`)
- Set new password → API service: updates password (evidence: `README.md`)
- New passport → API service: submits application (evidence: `README.md`)
- Passport renewal → API service: submits renewal (evidence: `README.md`)
- New passport → Request confirmation: shows confirmation
- Passport renewal → Request confirmation: shows confirmation
- Request confirmation → Passport user: shows reference (evidence: `README.md`)
- Request tracking → API service: loads requests (evidence: `README.md`)
- API service → Local demo data: stores demo data (evidence: `README.md`)
- API service → PHP backend: calls endpoints (evidence: `README.md`)
- API service → SMS provider: sends OTP (evidence: `README.md`)
