# rayanehariri/wassali_project architecture

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

- Interactive diagram: https://gitdiagram.com/rayanehariri/wassali_project
- Repository: https://github.com/rayanehariri/wassali_project

## Overview

Wassali is a Flask-based delivery service for clients, deliverers, and administrators. Clients register or sign in, submit and track deliveries, and may cancel pending work; active deliverers browse and accept available deliveries, then mark them delivered or drop them. Administrators manage users and delivery decisions, while location endpoints update and resolve user positions and calculate distances. The Flask entry point registers the API routes and serves the application page. The README provides no product detail, and several source excerpts are partial, so uncertain wiring and unverified UI/API features are omitted.

Main entry points: [`backend/main.py`](https://github.com/rayanehariri/wassali_project/blob/main/backend/main.py) (Flask entry point), [`backend/models.py`](https://github.com/rayanehariri/wassali_project/blob/main/backend/models.py) (User model), [`backend/delivery.py`](https://github.com/rayanehariri/wassali_project/blob/main/backend/delivery.py) (Delivery manager), [`backend/static/project.js`](https://github.com/rayanehariri/wassali_project/blob/main/backend/static/project.js) (Browser UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Web interface"]
  node_web["Browser UI<br/>[project.js]"]
  node_page["Application page<br/>[project.html]"]
end

subgraph group_api["Flask API"]
  node_app["Flask entry point<br/>[main.py]"]
  node_auth_api["Authentication routes<br/>[auth.py]"]
  node_client_api["Client routes<br/>[client.py]"]
  node_deliverer_api["Deliverer routes<br/>[deliverer.py]"]
  node_admin_api["Admin routes<br/>[admin.py]"]
  node_location_api["Location routes<br/>[location.py]"]
end

subgraph group_domain["Delivery domain"]
  node_users["User model<br/>[models.py]"]
  node_delivery["Delivery manager<br/>[delivery.py]"]
  node_verification["Verification codes<br/>[verification.py]"]
end

subgraph group_persistence["Persistence and location"]
  node_location["Location utilities<br/>[location.py]"]
  node_db_config["Mongo configuration<br/>[__init__.py]"]
  node_users_store[("Users collection<br/>[__init__.py]")]
  node_deliveries_store[("Deliveries collection<br/>[__init__.py]")]
  node_codes_store[("Verification collection<br/>[__init__.py]")]
end

node_user(("Client / staff"))
node_geocoder["IP geolocation"]

node_user -->|"uses"| node_web
node_web -->|"requests page"| node_app
node_app -->|"renders"| node_page
node_web -->|"calls auth"| node_auth_api
node_web -->|"calls delivery"| node_client_api
node_app -->|"registers routes"| node_auth_api
node_app -->|"registers routes"| node_client_api
node_app -->|"registers routes"| node_deliverer_api
node_app -->|"registers routes"| node_admin_api
node_app -->|"registers routes"| node_location_api
node_auth_api -->|"calls"| node_users
node_client_api -->|"validates client"| node_users
node_client_api -->|"manages delivery"| node_delivery
node_deliverer_api -->|"manages delivery"| node_delivery
node_admin_api -->|"manages users"| node_users
node_admin_api -->|"rejects delivery"| node_delivery
node_location_api -->|"reads and updates"| node_users
node_location_api -->|"resolves coordinates"| node_location
node_users -->|"reads and writes"| node_users_store
node_delivery -->|"reads users"| node_users_store
node_delivery -->|"reads and writes"| node_deliveries_store
node_verification -->|"reads and writes"| node_codes_store
node_users -->|"calculates distance"| node_location
node_location -.->|"looks up IP"| node_geocoder
node_db_config -->|"configures"| node_users_store
node_db_config -->|"configures"| node_deliveries_store
node_db_config -->|"configures"| node_codes_store

click node_web "https://github.com/rayanehariri/wassali_project/blob/main/backend/static/project.js"
click node_page "https://github.com/rayanehariri/wassali_project/blob/main/backend/templates/project.html"
click node_app "https://github.com/rayanehariri/wassali_project/blob/main/backend/main.py"
click node_auth_api "https://github.com/rayanehariri/wassali_project/blob/main/backend/routes/auth.py"
click node_client_api "https://github.com/rayanehariri/wassali_project/blob/main/backend/routes/client.py"
click node_deliverer_api "https://github.com/rayanehariri/wassali_project/blob/main/backend/routes/deliverer.py"
click node_admin_api "https://github.com/rayanehariri/wassali_project/blob/main/backend/routes/admin.py"
click node_location_api "https://github.com/rayanehariri/wassali_project/blob/main/backend/routes/location.py"
click node_users "https://github.com/rayanehariri/wassali_project/blob/main/backend/models.py"
click node_delivery "https://github.com/rayanehariri/wassali_project/blob/main/backend/delivery.py"
click node_verification "https://github.com/rayanehariri/wassali_project/blob/main/backend/verification.py"
click node_location "https://github.com/rayanehariri/wassali_project/blob/main/backend/location.py"
click node_db_config "https://github.com/rayanehariri/wassali_project/blob/main/backend/__init__.py"
click node_users_store "https://github.com/rayanehariri/wassali_project/blob/main/backend/__init__.py"
click node_deliveries_store "https://github.com/rayanehariri/wassali_project/blob/main/backend/__init__.py"
click node_codes_store "https://github.com/rayanehariri/wassali_project/blob/main/backend/__init__.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_web,node_page,node_user toneBlue
class node_app,node_auth_api,node_client_api,node_deliverer_api,node_admin_api,node_location_api toneAmber
class node_users,node_delivery,node_verification toneMint
class node_location,node_db_config,node_users_store,node_deliveries_store,node_codes_store toneRose
class node_geocoder toneIndigo
```

## Components

### Web interface

- [Browser UI](https://github.com/rayanehariri/wassali_project/blob/main/backend/static/project.js): `backend/static/project.js`
- [Application page](https://github.com/rayanehariri/wassali_project/blob/main/backend/templates/project.html): `backend/templates/project.html`

### Flask API

- [Flask entry point](https://github.com/rayanehariri/wassali_project/blob/main/backend/main.py): `backend/main.py`
- [Authentication routes](https://github.com/rayanehariri/wassali_project/blob/main/backend/routes/auth.py): `backend/routes/auth.py`
- [Client routes](https://github.com/rayanehariri/wassali_project/blob/main/backend/routes/client.py): `backend/routes/client.py`
- [Deliverer routes](https://github.com/rayanehariri/wassali_project/blob/main/backend/routes/deliverer.py): `backend/routes/deliverer.py`
- [Admin routes](https://github.com/rayanehariri/wassali_project/blob/main/backend/routes/admin.py): `backend/routes/admin.py`
- [Location routes](https://github.com/rayanehariri/wassali_project/blob/main/backend/routes/location.py): `backend/routes/location.py`

### Delivery domain

- [User model](https://github.com/rayanehariri/wassali_project/blob/main/backend/models.py): `backend/models.py`
- [Delivery manager](https://github.com/rayanehariri/wassali_project/blob/main/backend/delivery.py): `backend/delivery.py`
- [Verification codes](https://github.com/rayanehariri/wassali_project/blob/main/backend/verification.py): `backend/verification.py`

### Persistence and location

- [Location utilities](https://github.com/rayanehariri/wassali_project/blob/main/backend/location.py): `backend/location.py`
- [Mongo configuration](https://github.com/rayanehariri/wassali_project/blob/main/backend/__init__.py): `backend/__init__.py`
- [Users collection](https://github.com/rayanehariri/wassali_project/blob/main/backend/__init__.py): `backend/__init__.py`
- [Deliveries collection](https://github.com/rayanehariri/wassali_project/blob/main/backend/__init__.py): `backend/__init__.py`
- [Verification collection](https://github.com/rayanehariri/wassali_project/blob/main/backend/__init__.py): `backend/__init__.py`

### Other components

- **Client / staff**
- **IP geolocation**

## Connections

- Client / staff → Browser UI: uses
- Browser UI → Flask entry point: requests page
- Flask entry point → Application page: renders
- Browser UI → Authentication routes: calls auth
- Browser UI → Client routes: calls delivery
- Flask entry point → Authentication routes: registers routes
- Flask entry point → Client routes: registers routes
- Flask entry point → Deliverer routes: registers routes
- Flask entry point → Admin routes: registers routes
- Flask entry point → Location routes: registers routes
- Authentication routes → User model: calls
- Client routes → User model: validates client
- Client routes → Delivery manager: manages delivery
- Deliverer routes → Delivery manager: manages delivery
- Admin routes → User model: manages users
- Admin routes → Delivery manager: rejects delivery
- Location routes → User model: reads and updates
- Location routes → Location utilities: resolves coordinates
- User model → Users collection: reads and writes
- Delivery manager → Users collection: reads users
- Delivery manager → Deliveries collection: reads and writes
- Verification codes → Verification collection: reads and writes
- User model → Location utilities: calculates distance
- Location utilities → IP geolocation: looks up IP
- Mongo configuration → Users collection: configures
- Mongo configuration → Deliveries collection: configures
- Mongo configuration → Verification collection: configures
