# rayanebsh/dz-carpool architecture

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

- Interactive diagram: https://gitdiagram.com/rayanebsh/dz-carpool
- Repository: https://github.com/rayanebsh/dz-carpool

## Overview

DZ-CarPool is an inter-wilaya carpooling platform: drivers publish trips, passengers search and request seats, and drivers approve reservations. Users also manage profiles, communicate through messaging, and receive notifications. The frontend calls the Django API; WebSocket consumers support chat and live notifications. Pricing and fuel-based suggestions are documented capabilities. The README supports the product workflow, while sampled source confirms selected signal, routing, messaging, and API-client relationships; unsampled connections are omitted.

Main entry points: [`Backend/config/urls.py`](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/config/urls.py) (Django REST API), [`Frontend/app`](https://github.com/rayanebsh/dz-carpool/tree/main/Frontend/app) (Web application), [`Backend/app/core/signals.py`](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/core/signals.py) (Domain signals), [`Backend/app/notifications/routing.py`](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/notifications/routing.py) (WebSocket routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_web["Web application"]
  node_trip_pages["Trip pages<br/>[page.tsx]"]
  node_search_pages["Trip search<br/>[page.tsx]"]
  node_reservation_pages["Reservations<br/>[page.tsx]"]
  node_profile_pages["User profiles<br/>[page.tsx]"]
  node_messages_page["Messaging UI<br/>[page.tsx]"]
  node_notifications_page["Notification UI<br/>[page.tsx]"]
  node_api_client["API client<br/>[api.client.ts]"]
end

subgraph group_api["Core API"]
  node_backend_api["Django REST API<br/>[urls.py]"]
  node_users[("User accounts<br/>[models.py]")]
  node_domain_signals["Domain signals<br/>[signals.py]"]
end

subgraph group_travel["Trip and booking"]
  node_trip_service["Trip management<br/>[views.py]"]
  node_trip_store[("Trip records<br/>[models.py]")]
  node_search["Trip search<br/>[search_utils.py]"]
  node_pricing["Pricing<br/>[pricing.py]"]
  node_reservation_service["Seat reservations<br/>[views.py]"]
  node_reservation_store[("Reservation records<br/>[models.py]")]
end

subgraph group_communication["Communication"]
  node_chat["Chat consumer<br/>[consumers.py]"]
  node_message_store[("Messages and conversations<br/>[models.py]")]
  node_notification_service["Notification delivery<br/>[consumers.py]"]
  node_notification_store[("Notifications<br/>[models.py]")]
  node_ws_routes["WebSocket routing<br/>[routing.py]"]
end

node_rider(("Driver / passenger"))

node_rider -->|"uses"| node_web
node_web -->|"publishes trips"| node_trip_pages
node_web -->|"searches trips"| node_search_pages
node_web -->|"requests seats"| node_reservation_pages
node_web -->|"manages profile"| node_profile_pages
node_web -->|"opens messaging"| node_messages_page
node_web -.->|"views notifications"| node_notifications_page
node_messages_page -->|"loads conversations"| node_api_client
node_api_client -->|"calls API"| node_backend_api
node_trip_pages -.->|"submits trip"| node_backend_api
node_search_pages -.->|"searches trips"| node_backend_api
node_reservation_pages -.->|"requests booking"| node_backend_api
node_profile_pages -.->|"updates profile"| node_backend_api
node_backend_api -.->|"routes trip API"| node_trip_service
node_trip_service -.->|"manages trips"| node_trip_store
node_backend_api -.->|"supports search"| node_search
node_backend_api -.->|"supports pricing"| node_pricing
node_backend_api -.->|"routes booking API"| node_reservation_service
node_reservation_service -.->|"manages reservations"| node_reservation_store
node_domain_signals -->|"observes reservations"| node_reservation_store
node_domain_signals -->|"creates alerts"| node_notification_store
node_ws_routes -->|"routes chat sockets"| node_chat
node_ws_routes -->|"routes notification sockets"| node_notification_service
node_chat -->|"saves messages"| node_message_store
node_notification_service -->|"reads notifications"| node_notification_store

click node_web "https://github.com/rayanebsh/dz-carpool/tree/main/Frontend/app"
click node_trip_pages "https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/offer-ride/page.tsx"
click node_search_pages "https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/search-results/page.tsx"
click node_reservation_pages "https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/reservations/%5Bid%5D/page.tsx"
click node_profile_pages "https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/profile/page.tsx"
click node_messages_page "https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/messages/page.tsx"
click node_notifications_page "https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/notifications/page.tsx"
click node_api_client "https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/services/api.client.ts"
click node_backend_api "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/config/urls.py"
click node_users "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/users/models.py"
click node_trip_service "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/trajets/views.py"
click node_trip_store "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/trajets/models.py"
click node_search "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/utils/search_utils.py"
click node_pricing "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/utils/pricing.py"
click node_reservation_service "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/reservations/views.py"
click node_reservation_store "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/reservations/models.py"
click node_domain_signals "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/core/signals.py"
click node_chat "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/messaging/consumers.py"
click node_message_store "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/notifications/models.py"
click node_notification_service "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/notifications/consumers.py"
click node_notification_store "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/notifications/models.py"
click node_ws_routes "https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/notifications/routing.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_trip_pages,node_search_pages,node_reservation_pages,node_profile_pages,node_messages_page,node_notifications_page,node_api_client toneBlue
class node_backend_api,node_users,node_domain_signals toneAmber
class node_trip_service,node_trip_store,node_search,node_pricing,node_reservation_service,node_reservation_store toneMint
class node_chat,node_message_store,node_notification_service,node_notification_store,node_ws_routes toneRose
class node_rider toneIndigo
```

## Components

### Web client

- [Web application](https://github.com/rayanebsh/dz-carpool/tree/main/Frontend/app): `Frontend/app`
- [Trip pages](https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/offer-ride/page.tsx): `Frontend/app/offer-ride/page.tsx`
- [Trip search](https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/search-results/page.tsx): `Frontend/app/search-results/page.tsx`
- [Reservations](https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/reservations/%5Bid%5D/page.tsx): `Frontend/app/reservations/[id]/page.tsx`
- [User profiles](https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/profile/page.tsx): `Frontend/app/profile/page.tsx`
- [Messaging UI](https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/messages/page.tsx): `Frontend/app/messages/page.tsx`
- [Notification UI](https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/app/notifications/page.tsx): `Frontend/app/notifications/page.tsx`
- [API client](https://github.com/rayanebsh/dz-carpool/blob/main/Frontend/services/api.client.ts): `Frontend/services/api.client.ts`

### Core API

- [Django REST API](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/config/urls.py): `Backend/config/urls.py`
- [User accounts](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/users/models.py): `Backend/app/users/models.py`
- [Domain signals](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/core/signals.py): `Backend/app/core/signals.py`

### Trip and booking

- [Trip management](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/trajets/views.py): `Backend/app/trajets/views.py`
- [Trip records](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/trajets/models.py): `Backend/app/trajets/models.py`
- [Trip search](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/utils/search_utils.py): `Backend/utils/search_utils.py`
- [Pricing](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/utils/pricing.py): `Backend/utils/pricing.py`
- [Seat reservations](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/reservations/views.py): `Backend/app/reservations/views.py`
- [Reservation records](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/reservations/models.py): `Backend/app/reservations/models.py`

### Communication

- [Chat consumer](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/messaging/consumers.py): `Backend/app/messaging/consumers.py`
- [Messages and conversations](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/notifications/models.py): `Backend/app/notifications/models.py`
- [Notification delivery](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/notifications/consumers.py): `Backend/app/notifications/consumers.py`
- [Notifications](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/notifications/models.py): `Backend/app/notifications/models.py`
- [WebSocket routing](https://github.com/rayanebsh/dz-carpool/blob/main/Backend/app/notifications/routing.py): `Backend/app/notifications/routing.py`

### Other components

- **Driver / passenger**

## Connections

- Driver / passenger → Web application: uses
- Web application → Trip pages: publishes trips
- Web application → Trip search: searches trips
- Web application → Reservations: requests seats
- Web application → User profiles: manages profile
- Web application → Messaging UI: opens messaging
- Web application → Notification UI: views notifications
- Messaging UI → API client: loads conversations
- API client → Django REST API: calls API (evidence: `Frontend/services/api.client.ts`)
- Trip pages → Django REST API: submits trip
- Trip search → Django REST API: searches trips
- Reservations → Django REST API: requests booking
- User profiles → Django REST API: updates profile
- Django REST API → Trip management: routes trip API
- Trip management → Trip records: manages trips
- Django REST API → Trip search: supports search
- Django REST API → Pricing: supports pricing
- Django REST API → Seat reservations: routes booking API
- Seat reservations → Reservation records: manages reservations
- Domain signals → Reservation records: observes reservations (evidence: `Backend/app/core/signals.py`)
- Domain signals → Notifications: creates alerts (evidence: `Backend/app/core/signals.py`)
- WebSocket routing → Chat consumer: routes chat sockets (evidence: `Backend/app/notifications/routing.py`)
- WebSocket routing → Notification delivery: routes notification sockets (evidence: `Backend/app/notifications/routing.py`)
- Chat consumer → Messages and conversations: saves messages (evidence: `Backend/app/messaging/consumers.py`)
- Notification delivery → Notifications: reads notifications (evidence: `Backend/app/notifications/consumers.py`)
