# priyanka-codes-28/courier-and-logistics-system architecture

> Architecture diagram of the GitHub repository priyanka-codes-28/courier-and-logistics-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/priyanka-codes-28/courier-and-logistics-system
- Repository: https://github.com/priyanka-codes-28/courier-and-logistics-system

## Overview

CourierOS is a Flask courier-operations application. Customers create and pay for shipments, then track shipment status; pickup and delivery agents and warehouse staff advance fulfillment, while administrators manage users and system settings. The graph shows the documented shipment, role-dashboard, tracking, notification, and authentication capabilities. Several source excerpts are partial, so uncertain route-to-feature wiring is omitted.

Main entry points: [`routes/shipments.py`](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/routes/shipments.py) (Shipment routes), [`routes/auth.py`](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/routes/auth.py) (Accounts and dashboards), [`db.py`](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/db.py) (Database access), [`app.py`](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/app.py) (Flask app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask app<br/>[app.py]"]
  node_auth_routes["Accounts and dashboards<br/>[auth.py]"]
  node_shipment_routes["Shipment routes<br/>[shipments.py]"]
  node_views["Web pages"]
end

subgraph group_fulfillment["Shipment operations"]
  node_shipment_domain["Shipment lifecycle<br/>[models.py]"]
  node_workforce["Agents and warehouses<br/>[models.py]"]
  node_payments["Shipment payments<br/>[models.py]"]
  node_tracking["Tracking and location<br/>[shipments.py]"]
  node_proof["Delivery proof<br/>[models.py]"]
  node_settings["System settings<br/>[models.py]"]
end

subgraph group_identity["Identity and messaging"]
  node_user_model["User accounts<br/>[models.py]"]
  node_oauth["Google sign-in<br/>[google_oauth.py]"]
  node_email["Email notifications<br/>[email_utils.py]"]
  node_email_templates["Email templates"]
end

subgraph group_persistence["Persistence"]
  node_database[("PostgreSQL")]
  node_db_access["Database access<br/>[db.py]"]
end

node_customer(("Customer"))
node_ops_staff(("Operations staff"))
node_google(("Google identity"))
node_brevo(("Brevo email API"))

node_customer -->|"uses"| node_app
node_ops_staff -->|"uses"| node_app
node_app -->|"registers"| node_auth_routes
node_app -->|"registers"| node_shipment_routes
node_app -->|"initializes"| node_db_access
node_app -->|"initializes"| node_oauth
node_auth_routes -->|"renders"| node_views
node_shipment_routes -->|"renders"| node_views
node_auth_routes -->|"manages accounts"| node_user_model
node_auth_routes -->|"loads dashboards"| node_shipment_domain
node_auth_routes -->|"loads dashboards"| node_workforce
node_auth_routes -->|"manages settings"| node_settings
node_auth_routes -->|"starts sign-in"| node_oauth
node_oauth -.->|"authenticates"| node_google
node_shipment_routes -->|"creates and updates"| node_shipment_domain
node_shipment_routes -->|"assigns agents"| node_workforce
node_shipment_routes -->|"records payment"| node_payments
node_shipment_routes -->|"serves tracking"| node_tracking
node_shipment_routes -->|"records proof"| node_proof
node_shipment_routes -->|"reads settings"| node_settings
node_shipment_domain -->|"notifies status"| node_email
node_email -->|"renders"| node_email_templates
node_email -->|"sends email"| node_brevo
node_user_model -->|"queries"| node_db_access
node_shipment_domain -->|"queries"| node_db_access
node_workforce -->|"queries"| node_db_access
node_payments -->|"queries"| node_db_access
node_tracking -->|"reads status"| node_shipment_domain
node_proof -->|"stores proof"| node_db_access
node_settings -->|"loads and saves"| node_db_access
node_db_access -->|"connects"| node_database

click node_app "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/app.py"
click node_auth_routes "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/routes/auth.py"
click node_shipment_routes "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/routes/shipments.py"
click node_views "https://github.com/priyanka-codes-28/courier-and-logistics-system/tree/main/templates"
click node_shipment_domain "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.py"
click node_workforce "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.py"
click node_payments "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.py"
click node_tracking "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/routes/shipments.py"
click node_proof "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.py"
click node_user_model "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.py"
click node_oauth "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/google_oauth.py"
click node_email "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/email_utils.py"
click node_email_templates "https://github.com/priyanka-codes-28/courier-and-logistics-system/tree/main/templates/emails"
click node_db_access "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/db.py"
click node_settings "https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.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_app,node_auth_routes,node_shipment_routes,node_views toneBlue
class node_shipment_domain,node_workforce,node_payments,node_tracking,node_proof,node_settings toneAmber
class node_user_model,node_oauth,node_email,node_email_templates,node_brevo toneMint
class node_database,node_db_access toneRose
class node_customer,node_ops_staff,node_google toneIndigo
```

## Components

### Web application

- [Flask app](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/app.py): `app.py`
- [Accounts and dashboards](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/routes/auth.py): `routes/auth.py`
- [Shipment routes](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/routes/shipments.py): `routes/shipments.py`
- [Web pages](https://github.com/priyanka-codes-28/courier-and-logistics-system/tree/main/templates): `templates`

### Shipment operations

- [Shipment lifecycle](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.py): `models.py`
- [Agents and warehouses](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.py): `models.py`
- [Shipment payments](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.py): `models.py`
- [Tracking and location](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/routes/shipments.py): `routes/shipments.py`
- [Delivery proof](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.py): `models.py`
- [System settings](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.py): `models.py`

### Identity and messaging

- [User accounts](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/models.py): `models.py`
- [Google sign-in](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/google_oauth.py): `google_oauth.py`
- [Email notifications](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/email_utils.py): `email_utils.py`
- [Email templates](https://github.com/priyanka-codes-28/courier-and-logistics-system/tree/main/templates/emails): `templates/emails`

### Persistence

- **PostgreSQL**
- [Database access](https://github.com/priyanka-codes-28/courier-and-logistics-system/blob/main/db.py): `db.py`

### Other components

- **Customer**
- **Operations staff**
- **Google identity**
- **Brevo email API**

## Connections

- Customer → Flask app: uses
- Operations staff → Flask app: uses
- Flask app → Accounts and dashboards: registers
- Flask app → Shipment routes: registers
- Flask app → Database access: initializes
- Flask app → Google sign-in: initializes
- Accounts and dashboards → Web pages: renders
- Shipment routes → Web pages: renders
- Accounts and dashboards → User accounts: manages accounts
- Accounts and dashboards → Shipment lifecycle: loads dashboards
- Accounts and dashboards → Agents and warehouses: loads dashboards
- Accounts and dashboards → System settings: manages settings
- Accounts and dashboards → Google sign-in: starts sign-in
- Google sign-in → Google identity: authenticates
- Shipment routes → Shipment lifecycle: creates and updates
- Shipment routes → Agents and warehouses: assigns agents
- Shipment routes → Shipment payments: records payment
- Shipment routes → Tracking and location: serves tracking
- Shipment routes → Delivery proof: records proof
- Shipment routes → System settings: reads settings
- Shipment lifecycle → Email notifications: notifies status
- Email notifications → Email templates: renders
- Email notifications → Brevo email API: sends email
- User accounts → Database access: queries
- Shipment lifecycle → Database access: queries
- Agents and warehouses → Database access: queries
- Shipment payments → Database access: queries
- Tracking and location → Shipment lifecycle: reads status
- Delivery proof → Database access: stores proof
- System settings → Database access: loads and saves
- Database access → PostgreSQL: connects
