# chakma-s/plan-e architecture

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

- Interactive diagram: https://gitdiagram.com/chakma-s/plan-e
- Repository: https://github.com/chakma-s/plan-e

## Overview

This is a travel-stay booking backend for hotels and resorts, with local-guide offerings and customer, vendor, and administrative workflows. The principal flow is a client request through the versioned API into discovery or booking logic, which uses domain records and, for booking operations, payment, regional policy, and notification services. The tree and source index establish additional review, compliance, and vendor-management branches. Some endpoint and integration implementations were not excerpted, so those connections are included only where the index or shown code supports them.

Main entry points: [`backend/app/api/v1/api.py`](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/api.py) (API router), [`backend/app/models/property.py`](https://github.com/chakma-s/plan-e/blob/main/backend/app/models/property.py) (Properties), [`backend/app/core/database.py`](https://github.com/chakma-s/plan-e/blob/main/backend/app/core/database.py) (SQL database), [`backend/app/services/booking_service.py`](https://github.com/chakma-s/plan-e/blob/main/backend/app/services/booking_service.py) (Booking service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and access"]
  node_router["API router<br/>[api.py]"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_booking_api["Booking API<br/>[bookings.py]"]
  node_hotel_api["Hotel API<br/>[hotels.py]"]
  node_resort_api["Resort API<br/>[resorts.py]"]
  node_guide_api["Guide API<br/>[guides.py]"]
  node_review_api["Review API<br/>[reviews.py]"]
  node_compliance_api["Compliance API<br/>[compliance.py]"]
  node_access["Auth dependencies<br/>[deps.py]"]
end

subgraph group_travel["Travel operations"]
  node_booking_service["Booking service<br/>[booking_service.py]"]
  node_hotel_service["Hotel discovery<br/>[hotel_service.py]"]
  node_resort_service["Resort discovery<br/>[resort_service.py]"]
  node_guide_service["Guide service<br/>[guide_service.py]"]
  node_payment["Payment gateway<br/>[payment_gateway.py]"]
end

subgraph group_accounts["Accounts and management"]
  node_vendor_api["Vendor API<br/>[vendor.py]"]
  node_admin_api["Admin API<br/>[admin.py]"]
  node_auth_service["Identity service<br/>[auth_service.py]"]
  node_vendor_service["Vendor service<br/>[vendor_service.py]"]
  node_notifications["Notifications"]
end

subgraph group_domain["Domain data"]
  node_users["Users and vendors<br/>[user.py]"]
  node_properties["Properties<br/>[property.py]"]
  node_rooms["Rooms and allocation<br/>[room.py]"]
  node_guides["Local guides<br/>[guide.py]"]
  node_reservations["Reservations<br/>[booking.py]"]
  node_reviews["Reviews<br/>[review.py]"]
end

subgraph group_platform["Persistence and policy"]
  node_regional["Regional policy<br/>[regional_policy.py]"]
  node_database[("SQL database<br/>[database.py]")]
end

node_client(("API client"))

node_client -->|"sends requests"| node_router
node_router -->|"routes to"| node_auth_api
node_router -->|"routes to"| node_booking_api
node_router -->|"routes to"| node_hotel_api
node_router -->|"routes to"| node_resort_api
node_router -->|"routes to"| node_guide_api
node_router -->|"routes to"| node_review_api
node_router -->|"routes to"| node_compliance_api
node_router -->|"routes to"| node_vendor_api
node_router -->|"routes to"| node_admin_api
node_auth_api -->|"uses"| node_auth_service
node_auth_api -->|"uses"| node_access
node_access -->|"gets session"| node_database
node_access -->|"looks up user"| node_auth_service
node_booking_api -.->|"uses"| node_booking_service
node_hotel_api -.->|"uses"| node_hotel_service
node_resort_api -.->|"uses"| node_resort_service
node_guide_api -->|"uses"| node_guide_service
node_vendor_api -->|"uses"| node_vendor_service
node_booking_service -->|"charges payments"| node_payment
node_booking_service -->|"checks policy"| node_regional
node_booking_service -->|"sends notices"| node_notifications
node_auth_service -->|"dispatches OTP"| node_notifications
node_auth_service -.->|"reads and writes"| node_database
node_booking_service -.->|"reads and writes"| node_database
node_hotel_service -->|"reads"| node_properties
node_hotel_service -->|"reads"| node_rooms
node_resort_service -->|"reads"| node_properties
node_resort_service -->|"reads"| node_guides
node_resort_service -->|"reads"| node_rooms
node_guide_service -->|"uses"| node_guides
node_vendor_service -->|"manages"| node_properties
node_vendor_service -->|"manages"| node_rooms
node_vendor_service -->|"manages"| node_guides
node_review_api -.->|"reads and writes"| node_database
node_compliance_api -->|"checks policy"| node_regional
node_compliance_api -.->|"reads and writes"| node_database
node_vendor_api -.->|"reads and writes"| node_database
node_admin_api -.->|"reads and writes"| node_database
node_reservations -->|"references"| node_properties
node_reservations -->|"books"| node_rooms
node_reservations -->|"books"| node_guides
node_reviews -->|"references"| node_reservations
node_reviews -->|"references"| node_users
node_properties -->|"has room types"| node_rooms
node_properties -->|"associates guides"| node_guides
node_users -->|"owns properties"| node_properties

click node_router "https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/api.py"
click node_auth_api "https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/auth.py"
click node_booking_api "https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/bookings.py"
click node_hotel_api "https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/hotels.py"
click node_resort_api "https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/resorts.py"
click node_guide_api "https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/guides.py"
click node_review_api "https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/reviews.py"
click node_compliance_api "https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/compliance.py"
click node_vendor_api "https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/vendor.py"
click node_admin_api "https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/admin.py"
click node_auth_service "https://github.com/chakma-s/plan-e/blob/main/backend/app/services/auth_service.py"
click node_booking_service "https://github.com/chakma-s/plan-e/blob/main/backend/app/services/booking_service.py"
click node_hotel_service "https://github.com/chakma-s/plan-e/blob/main/backend/app/services/hotel_service.py"
click node_resort_service "https://github.com/chakma-s/plan-e/blob/main/backend/app/services/resort_service.py"
click node_guide_service "https://github.com/chakma-s/plan-e/blob/main/backend/app/services/guide_service.py"
click node_vendor_service "https://github.com/chakma-s/plan-e/blob/main/backend/app/services/vendor_service.py"
click node_payment "https://github.com/chakma-s/plan-e/blob/main/backend/app/services/payment_gateway.py"
click node_notifications "https://github.com/chakma-s/plan-e/blob/main/backend/app/services/notification_service.py"
click node_regional "https://github.com/chakma-s/plan-e/blob/main/backend/app/core/regional_policy.py"
click node_access "https://github.com/chakma-s/plan-e/blob/main/backend/app/api/deps.py"
click node_database "https://github.com/chakma-s/plan-e/blob/main/backend/app/core/database.py"
click node_users "https://github.com/chakma-s/plan-e/blob/main/backend/app/models/user.py"
click node_properties "https://github.com/chakma-s/plan-e/blob/main/backend/app/models/property.py"
click node_rooms "https://github.com/chakma-s/plan-e/blob/main/backend/app/models/room.py"
click node_guides "https://github.com/chakma-s/plan-e/blob/main/backend/app/models/guide.py"
click node_reservations "https://github.com/chakma-s/plan-e/blob/main/backend/app/models/booking.py"
click node_reviews "https://github.com/chakma-s/plan-e/blob/main/backend/app/models/review.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_router,node_auth_api,node_booking_api,node_hotel_api,node_resort_api,node_guide_api,node_review_api,node_compliance_api,node_access,node_client toneBlue
class node_booking_service,node_hotel_service,node_resort_service,node_guide_service,node_payment toneAmber
class node_vendor_api,node_admin_api,node_auth_service,node_vendor_service,node_notifications toneMint
class node_users,node_properties,node_rooms,node_guides,node_reservations,node_reviews toneRose
class node_regional,node_database toneIndigo
```

## Components

### API and access

- [API router](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/api.py): `backend/app/api/v1/api.py`
- [Authentication API](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/auth.py): `backend/app/api/v1/endpoints/auth.py`
- [Booking API](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/bookings.py): `backend/app/api/v1/endpoints/bookings.py`
- [Hotel API](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/hotels.py): `backend/app/api/v1/endpoints/hotels.py`
- [Resort API](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/resorts.py): `backend/app/api/v1/endpoints/resorts.py`
- [Guide API](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/guides.py): `backend/app/api/v1/endpoints/guides.py`
- [Review API](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/reviews.py): `backend/app/api/v1/endpoints/reviews.py`
- [Compliance API](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/compliance.py): `backend/app/api/v1/endpoints/compliance.py`
- [Auth dependencies](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/deps.py): `backend/app/api/deps.py`

### Travel operations

- [Booking service](https://github.com/chakma-s/plan-e/blob/main/backend/app/services/booking_service.py): `backend/app/services/booking_service.py`
- [Hotel discovery](https://github.com/chakma-s/plan-e/blob/main/backend/app/services/hotel_service.py): `backend/app/services/hotel_service.py`
- [Resort discovery](https://github.com/chakma-s/plan-e/blob/main/backend/app/services/resort_service.py): `backend/app/services/resort_service.py`
- [Guide service](https://github.com/chakma-s/plan-e/blob/main/backend/app/services/guide_service.py): `backend/app/services/guide_service.py`
- [Payment gateway](https://github.com/chakma-s/plan-e/blob/main/backend/app/services/payment_gateway.py): `backend/app/services/payment_gateway.py`

### Accounts and management

- [Vendor API](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/vendor.py): `backend/app/api/v1/endpoints/vendor.py`
- [Admin API](https://github.com/chakma-s/plan-e/blob/main/backend/app/api/v1/endpoints/admin.py): `backend/app/api/v1/endpoints/admin.py`
- [Identity service](https://github.com/chakma-s/plan-e/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [Vendor service](https://github.com/chakma-s/plan-e/blob/main/backend/app/services/vendor_service.py): `backend/app/services/vendor_service.py`
- [Notifications](https://github.com/chakma-s/plan-e/blob/main/backend/app/services/notification_service.py): `backend/app/services/notification_service.py`

### Domain data

- [Users and vendors](https://github.com/chakma-s/plan-e/blob/main/backend/app/models/user.py): `backend/app/models/user.py`
- [Properties](https://github.com/chakma-s/plan-e/blob/main/backend/app/models/property.py): `backend/app/models/property.py`
- [Rooms and allocation](https://github.com/chakma-s/plan-e/blob/main/backend/app/models/room.py): `backend/app/models/room.py`
- [Local guides](https://github.com/chakma-s/plan-e/blob/main/backend/app/models/guide.py): `backend/app/models/guide.py`
- [Reservations](https://github.com/chakma-s/plan-e/blob/main/backend/app/models/booking.py): `backend/app/models/booking.py`
- [Reviews](https://github.com/chakma-s/plan-e/blob/main/backend/app/models/review.py): `backend/app/models/review.py`

### Persistence and policy

- [Regional policy](https://github.com/chakma-s/plan-e/blob/main/backend/app/core/regional_policy.py): `backend/app/core/regional_policy.py`
- [SQL database](https://github.com/chakma-s/plan-e/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Other components

- **API client**

## Connections

- API client → API router: sends requests
- API router → Authentication API: routes to (evidence: `backend/app/api/v1/api.py`)
- API router → Booking API: routes to (evidence: `backend/app/api/v1/api.py`)
- API router → Hotel API: routes to (evidence: `backend/app/api/v1/api.py`)
- API router → Resort API: routes to (evidence: `backend/app/api/v1/api.py`)
- API router → Guide API: routes to (evidence: `backend/app/api/v1/api.py`)
- API router → Review API: routes to (evidence: `backend/app/api/v1/api.py`)
- API router → Compliance API: routes to (evidence: `backend/app/api/v1/api.py`)
- API router → Vendor API: routes to (evidence: `backend/app/api/v1/api.py`)
- API router → Admin API: routes to (evidence: `backend/app/api/v1/api.py`)
- Authentication API → Identity service: uses (evidence: `backend/app/api/v1/endpoints/auth.py`)
- Authentication API → Auth dependencies: uses (evidence: `backend/app/api/v1/endpoints/auth.py`)
- Auth dependencies → SQL database: gets session (evidence: `backend/app/api/deps.py`)
- Auth dependencies → Identity service: looks up user (evidence: `backend/app/api/deps.py`)
- Booking API → Booking service: uses
- Hotel API → Hotel discovery: uses
- Resort API → Resort discovery: uses
- Guide API → Guide service: uses (evidence: `backend/app/api/v1/endpoints/guides.py`)
- Vendor API → Vendor service: uses (evidence: `backend/app/api/v1/endpoints/vendor.py`)
- Booking service → Payment gateway: charges payments (evidence: `backend/app/services/booking_service.py`)
- Booking service → Regional policy: checks policy (evidence: `backend/app/services/booking_service.py`)
- Booking service → Notifications: sends notices (evidence: `backend/app/services/booking_service.py`)
- Identity service → Notifications: dispatches OTP (evidence: `backend/app/services/auth_service.py`)
- Identity service → SQL database: reads and writes
- Booking service → SQL database: reads and writes
- Hotel discovery → Properties: reads (evidence: `backend/app/services/hotel_service.py`)
- Hotel discovery → Rooms and allocation: reads (evidence: `backend/app/services/hotel_service.py`)
- Resort discovery → Properties: reads (evidence: `backend/app/services/resort_service.py`)
- Resort discovery → Local guides: reads (evidence: `backend/app/services/resort_service.py`)
- Resort discovery → Rooms and allocation: reads (evidence: `backend/app/services/resort_service.py`)
- Guide service → Local guides: uses (evidence: `backend/app/services/guide_service.py`)
- Vendor service → Properties: manages (evidence: `backend/app/services/vendor_service.py`)
- Vendor service → Rooms and allocation: manages (evidence: `backend/app/services/vendor_service.py`)
- Vendor service → Local guides: manages (evidence: `backend/app/services/vendor_service.py`)
- Review API → SQL database: reads and writes (evidence: `backend/app/api/v1/endpoints/reviews.py`)
- Compliance API → Regional policy: checks policy (evidence: `backend/app/api/v1/endpoints/compliance.py`)
- Compliance API → SQL database: reads and writes (evidence: `backend/app/api/v1/endpoints/compliance.py`)
- Vendor API → SQL database: reads and writes (evidence: `backend/app/api/v1/endpoints/vendor.py`)
- Admin API → SQL database: reads and writes (evidence: `backend/app/api/v1/endpoints/admin.py`)
- Reservations → Properties: references (evidence: `backend/app/models/booking.py`)
- Reservations → Rooms and allocation: books (evidence: `backend/app/models/booking.py`)
- Reservations → Local guides: books (evidence: `backend/app/models/booking.py`)
- Reviews → Reservations: references (evidence: `backend/app/models/review.py`)
- Reviews → Users and vendors: references (evidence: `backend/app/models/review.py`)
- Properties → Rooms and allocation: has room types (evidence: `backend/app/models/property.py`)
- Properties → Local guides: associates guides (evidence: `backend/app/models/property.py`)
- Users and vendors → Properties: owns properties (evidence: `backend/app/models/user.py`)
