# pushkar212007/routex architecture

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

- Interactive diagram: https://gitdiagram.com/pushkar212007/routex
- Repository: https://github.com/pushkar212007/routex

## Overview

RouteX is a Django delivery-routing app. Customers sign up, choose pickup and drop-off nodes, and create orders; assignment selects the nearest available partner by road-graph distance and stores a delivery route. Partners manage availability and location, update delivery status, and customers track orders through a map view. The README also documents Leaflet visualization with optional OSRM road snapping and admin management of graph, partners, and orders. Source excerpts show the assignment and route-coordinate flow; template rendering and OSRM wiring are documented but not sampled.

Main entry points: [`orders/views.py`](https://github.com/pushkar212007/routex/blob/main/orders/views.py) (Order workflows), [`orders/models.py`](https://github.com/pushkar212007/routex/blob/main/orders/models.py) (Order records), [`accounts`](https://github.com/pushkar212007/routex/tree/main/accounts) (Roles and signup), [`partners/views.py`](https://github.com/pushkar212007/routex/blob/main/partners/views.py) (Partner dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Accounts"]
  node_accounts["Roles and signup"]
  node_user_store[("User records<br/>[models.py]")]
  node_signup_form["Signup form<br/>[forms.py]"]
end

subgraph group_network["Road network"]
  node_graph_store[("Road graph<br/>[models.py]")]
  node_routing["Dijkstra routing<br/>[dijkstra.py]"]
  node_graph_admin["Graph administration"]
end

subgraph group_delivery["Delivery operations"]
  node_partner_profile[("Partner profile<br/>[models.py]")]
  node_partner_dashboard["Partner dashboard<br/>[views.py]"]
  node_status_updates["Delivery status<br/>[views.py]"]
  node_orders[("Order records<br/>[models.py]")]
  node_order_views["Order workflows<br/>[views.py]"]
  node_assignment["Partner assignment<br/>[services.py]"]
end

subgraph group_presentation["Tracking and map"]
  node_order_tracking["Order detail map<br/>[views.py]"]
  node_map_client["Leaflet map<br/>[main.js]"]
  node_osrm["OSRM service"]
end

node_customer(("Customer"))
node_partner_user(("Delivery partner"))

node_customer -->|"signs up"| node_accounts
node_accounts -->|"validates with"| node_signup_form
node_signup_form -->|"creates user"| node_user_store
node_accounts -->|"authenticates"| node_user_store
node_accounts -->|"creates profile"| node_partner_profile
node_partner_user -->|"manages"| node_partner_dashboard
node_partner_dashboard -->|"reads and updates"| node_partner_profile
node_partner_dashboard -->|"reads active orders"| node_orders
node_partner_dashboard -->|"loads locations"| node_graph_store
node_partner_user -->|"advances delivery"| node_status_updates
node_status_updates -->|"updates status"| node_orders
node_status_updates -->|"updates availability"| node_partner_profile
node_customer -->|"places order"| node_order_views
node_order_views -->|"creates order"| node_orders
node_order_views -->|"requests assignment"| node_assignment
node_assignment -->|"selects and reserves"| node_partner_profile
node_assignment -->|"computes distances"| node_routing
node_routing -->|"loads graph"| node_graph_store
node_assignment -->|"stores route and status"| node_orders
node_order_views -->|"lists and retrieves"| node_orders
node_order_views -->|"renders detail"| node_order_tracking
node_order_tracking -->|"decodes route coordinates"| node_graph_store
node_order_tracking -.->|"provides map data"| node_map_client
node_map_client -.->|"snaps roads"| node_osrm
node_graph_admin -.->|"manages graph"| node_graph_store

click node_accounts "https://github.com/pushkar212007/routex/tree/main/accounts"
click node_user_store "https://github.com/pushkar212007/routex/blob/main/accounts/models.py"
click node_signup_form "https://github.com/pushkar212007/routex/blob/main/accounts/forms.py"
click node_partner_profile "https://github.com/pushkar212007/routex/blob/main/partners/models.py"
click node_partner_dashboard "https://github.com/pushkar212007/routex/blob/main/partners/views.py"
click node_status_updates "https://github.com/pushkar212007/routex/blob/main/partners/views.py"
click node_orders "https://github.com/pushkar212007/routex/blob/main/orders/models.py"
click node_order_views "https://github.com/pushkar212007/routex/blob/main/orders/views.py"
click node_assignment "https://github.com/pushkar212007/routex/blob/main/orders/services.py"
click node_graph_store "https://github.com/pushkar212007/routex/blob/main/core/models.py"
click node_routing "https://github.com/pushkar212007/routex/blob/main/core/dijkstra.py"
click node_graph_admin "https://github.com/pushkar212007/routex/tree/main/core"
click node_order_tracking "https://github.com/pushkar212007/routex/blob/main/orders/views.py"
click node_map_client "https://github.com/pushkar212007/routex/blob/main/static/js/main.js"

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_accounts,node_user_store,node_signup_form toneBlue
class node_graph_store,node_routing,node_graph_admin toneAmber
class node_partner_profile,node_partner_dashboard,node_status_updates,node_orders,node_order_views,node_assignment toneMint
class node_order_tracking,node_map_client,node_osrm toneRose
class node_customer,node_partner_user toneIndigo
```

## Components

### Accounts

- [Roles and signup](https://github.com/pushkar212007/routex/tree/main/accounts): `accounts`
- [User records](https://github.com/pushkar212007/routex/blob/main/accounts/models.py): `accounts/models.py`
- [Signup form](https://github.com/pushkar212007/routex/blob/main/accounts/forms.py): `accounts/forms.py`

### Road network

- [Road graph](https://github.com/pushkar212007/routex/blob/main/core/models.py): `core/models.py`
- [Dijkstra routing](https://github.com/pushkar212007/routex/blob/main/core/dijkstra.py): `core/dijkstra.py`
- [Graph administration](https://github.com/pushkar212007/routex/tree/main/core): `core`

### Delivery operations

- [Partner profile](https://github.com/pushkar212007/routex/blob/main/partners/models.py): `partners/models.py`
- [Partner dashboard](https://github.com/pushkar212007/routex/blob/main/partners/views.py): `partners/views.py`
- [Delivery status](https://github.com/pushkar212007/routex/blob/main/partners/views.py): `partners/views.py`
- [Order records](https://github.com/pushkar212007/routex/blob/main/orders/models.py): `orders/models.py`
- [Order workflows](https://github.com/pushkar212007/routex/blob/main/orders/views.py): `orders/views.py`
- [Partner assignment](https://github.com/pushkar212007/routex/blob/main/orders/services.py): `orders/services.py`

### Tracking and map

- [Order detail map](https://github.com/pushkar212007/routex/blob/main/orders/views.py): `orders/views.py`
- [Leaflet map](https://github.com/pushkar212007/routex/blob/main/static/js/main.js): `static/js/main.js`
- **OSRM service**

### Other components

- **Customer**
- **Delivery partner**

## Connections

- Customer → Roles and signup: signs up (evidence: `accounts/views.py`)
- Roles and signup → Signup form: validates with (evidence: `accounts/views.py`)
- Signup form → User records: creates user (evidence: `accounts/forms.py`)
- Roles and signup → User records: authenticates (evidence: `accounts/views.py`)
- Roles and signup → Partner profile: creates profile (evidence: `accounts/views.py`)
- Delivery partner → Partner dashboard: manages (evidence: `partners/views.py`)
- Partner dashboard → Partner profile: reads and updates (evidence: `partners/views.py`)
- Partner dashboard → Order records: reads active orders (evidence: `partners/views.py`)
- Partner dashboard → Road graph: loads locations (evidence: `partners/views.py`)
- Delivery partner → Delivery status: advances delivery (evidence: `partners/views.py`)
- Delivery status → Order records: updates status (evidence: `partners/views.py`)
- Delivery status → Partner profile: updates availability (evidence: `partners/views.py`)
- Customer → Order workflows: places order (evidence: `orders/views.py`)
- Order workflows → Order records: creates order (evidence: `orders/views.py`)
- Order workflows → Partner assignment: requests assignment (evidence: `orders/views.py`)
- Partner assignment → Partner profile: selects and reserves (evidence: `orders/services.py`)
- Partner assignment → Dijkstra routing: computes distances (evidence: `orders/services.py`)
- Dijkstra routing → Road graph: loads graph (evidence: `core/dijkstra.py`)
- Partner assignment → Order records: stores route and status (evidence: `orders/services.py`)
- Order workflows → Order records: lists and retrieves (evidence: `orders/views.py`)
- Order workflows → Order detail map: renders detail (evidence: `orders/views.py`)
- Order detail map → Road graph: decodes route coordinates (evidence: `orders/views.py`)
- Order detail map → Leaflet map: provides map data (evidence: `README.md`)
- Leaflet map → OSRM service: snaps roads (evidence: `README.md`)
- Graph administration → Road graph: manages graph (evidence: `README.md`)
