# rishabhjune-22/roombooking_backend architecture

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

- Interactive diagram: https://gitdiagram.com/rishabhjune-22/roombooking_backend
- Repository: https://github.com/rishabhjune-22/roombooking_backend

## Overview

This Django application manages hostel-room bookings, from account approval and booking requests through administrative decisions and ongoing booking management. Its principal workflow is exposed through account and booking API views, backed by role checks, serializers, and relational models; a separate web view serves shared booking and charge-sheet information. Booking expiry and Google Sheets calendar synchronization are additional operational capabilities. The excerpts and source index establish several module relationships, but the README is empty and URL routing and most UI behavior were not sampled, so those connections are not asserted as verified.

Main entry points: [`bookings/models.py`](https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/models.py) (Booking records), [`bookings/services/google_sheet_sync.py`](https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/services/google_sheet_sync.py) (Calendar sync), [`accounts/views.py`](https://github.com/rishabhjune-22/roombooking_backend/blob/main/accounts/views.py) (Account API), [`bookings/views.py`](https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/views.py) (Booking API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts and access"]
  node_account_api["Account API<br/>[views.py]"]
  node_access_rules["Roles and permissions<br/>[roles.py]"]
  node_profiles[("Profiles and notices<br/>[models.py]")]
  node_notification_service["Notification service"]
end

subgraph group_booking["Booking workflow"]
  node_booking_api["Booking API<br/>[views.py]"]
  node_booking_data[("Booking records<br/>[models.py]")]
  node_booking_serializers["Booking serializers<br/>[serializers.py]"]
  node_idempotency["Request idempotency<br/>[idempotency.py]"]
  node_booking_signals["Booking signals<br/>[signals.py]"]
end

subgraph group_inventory["Hostel inventory"]
  node_room_data[("Room inventory<br/>[models.py]")]
  node_hostel_api["Hostel API<br/>[views.py]"]
end

subgraph group_web["Web views"]
  node_shared_views["Shared booking views<br/>[views.py]"]
  node_web_ui["Browser application<br/>[app.js]"]
end

subgraph group_ops["Background integrations"]
  node_expiry_service["Booking expiry<br/>[expiry_service.py]"]
  node_sheet_sync["Calendar sync"]
  node_sync_task["Sync task<br/>[tasks.py]"]
end

node_user(("User"))
node_google_sheets[("Google Sheets")]

node_user -.->|"uses"| node_account_api
node_user -.->|"requests"| node_booking_api
node_user -.->|"browses"| node_hostel_api
node_user -.->|"views"| node_shared_views
node_account_api -->|"uses"| node_profiles
node_account_api -->|"checks"| node_access_rules
node_account_api -->|"notifies"| node_notification_service
node_account_api -->|"accesses"| node_booking_data
node_access_rules -->|"reads"| node_profiles
node_notification_service -->|"creates notices"| node_profiles
node_booking_api -->|"manages"| node_booking_data
node_booking_api -->|"validates"| node_booking_serializers
node_booking_api -->|"checks"| node_access_rules
node_booking_api -->|"records requests"| node_idempotency
node_booking_data -->|"references rooms"| node_room_data
node_hostel_api -->|"accesses"| node_room_data
node_shared_views -->|"queries"| node_booking_data
node_shared_views -->|"queries"| node_room_data
node_booking_signals -->|"handles events"| node_booking_data
node_booking_signals -->|"notifies"| node_notification_service
node_booking_signals -->|"requests sync"| node_sheet_sync
node_expiry_service -->|"expires records"| node_booking_data
node_expiry_service -->|"requests sync"| node_sheet_sync
node_sync_task -->|"runs"| node_sheet_sync
node_sheet_sync -->|"reads bookings"| node_booking_data
node_sheet_sync -->|"reads rooms"| node_room_data
node_sheet_sync -->|"updates calendar"| node_google_sheets

click node_account_api "https://github.com/rishabhjune-22/roombooking_backend/blob/main/accounts/views.py"
click node_access_rules "https://github.com/rishabhjune-22/roombooking_backend/blob/main/accounts/roles.py"
click node_profiles "https://github.com/rishabhjune-22/roombooking_backend/blob/main/accounts/models.py"
click node_notification_service "https://github.com/rishabhjune-22/roombooking_backend/blob/main/accounts/notification_service.py"
click node_booking_api "https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/views.py"
click node_booking_data "https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/models.py"
click node_booking_serializers "https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/serializers.py"
click node_idempotency "https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/idempotency.py"
click node_booking_signals "https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/signals.py"
click node_room_data "https://github.com/rishabhjune-22/roombooking_backend/blob/main/hostels/models.py"
click node_hostel_api "https://github.com/rishabhjune-22/roombooking_backend/blob/main/hostels/views.py"
click node_shared_views "https://github.com/rishabhjune-22/roombooking_backend/blob/main/webapp/views.py"
click node_web_ui "https://github.com/rishabhjune-22/roombooking_backend/blob/main/webapp/static/webapp/app.js"
click node_expiry_service "https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/services/expiry_service.py"
click node_sheet_sync "https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/services/google_sheet_sync.py"
click node_sync_task "https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/tasks.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_account_api,node_access_rules,node_profiles,node_notification_service,node_user toneBlue
class node_booking_api,node_booking_data,node_booking_serializers,node_idempotency,node_booking_signals,node_google_sheets toneAmber
class node_room_data,node_hostel_api toneMint
class node_shared_views,node_web_ui toneRose
class node_expiry_service,node_sheet_sync,node_sync_task toneIndigo
```

## Components

### Accounts and access

- [Account API](https://github.com/rishabhjune-22/roombooking_backend/blob/main/accounts/views.py): `accounts/views.py`
- [Roles and permissions](https://github.com/rishabhjune-22/roombooking_backend/blob/main/accounts/roles.py): `accounts/roles.py`
- [Profiles and notices](https://github.com/rishabhjune-22/roombooking_backend/blob/main/accounts/models.py): `accounts/models.py`
- [Notification service](https://github.com/rishabhjune-22/roombooking_backend/blob/main/accounts/notification_service.py): `accounts/notification_service.py`

### Booking workflow

- [Booking API](https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/views.py): `bookings/views.py`
- [Booking records](https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/models.py): `bookings/models.py`
- [Booking serializers](https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/serializers.py): `bookings/serializers.py`
- [Request idempotency](https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/idempotency.py): `bookings/idempotency.py`
- [Booking signals](https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/signals.py): `bookings/signals.py`

### Hostel inventory

- [Room inventory](https://github.com/rishabhjune-22/roombooking_backend/blob/main/hostels/models.py): `hostels/models.py`
- [Hostel API](https://github.com/rishabhjune-22/roombooking_backend/blob/main/hostels/views.py): `hostels/views.py`

### Web views

- [Shared booking views](https://github.com/rishabhjune-22/roombooking_backend/blob/main/webapp/views.py): `webapp/views.py`
- [Browser application](https://github.com/rishabhjune-22/roombooking_backend/blob/main/webapp/static/webapp/app.js): `webapp/static/webapp/app.js`

### Background integrations

- [Booking expiry](https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/services/expiry_service.py): `bookings/services/expiry_service.py`
- [Calendar sync](https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/services/google_sheet_sync.py): `bookings/services/google_sheet_sync.py`
- [Sync task](https://github.com/rishabhjune-22/roombooking_backend/blob/main/bookings/tasks.py): `bookings/tasks.py`

### Other components

- **User**
- **Google Sheets**

## Connections

- User → Account API: uses
- User → Booking API: requests
- User → Hostel API: browses
- User → Shared booking views: views
- Account API → Profiles and notices: uses (evidence: `accounts/views.py`)
- Account API → Roles and permissions: checks (evidence: `accounts/views.py`)
- Account API → Notification service: notifies (evidence: `accounts/views.py`)
- Account API → Booking records: accesses (evidence: `accounts/views.py`)
- Roles and permissions → Profiles and notices: reads (evidence: `accounts/roles.py`)
- Notification service → Profiles and notices: creates notices (evidence: `accounts/notification_service.py`)
- Booking API → Booking records: manages (evidence: `bookings/views.py`)
- Booking API → Booking serializers: validates (evidence: `bookings/views.py`)
- Booking API → Roles and permissions: checks (evidence: `bookings/views.py`)
- Booking API → Request idempotency: records requests (evidence: `bookings/views.py`)
- Booking records → Room inventory: references rooms (evidence: `bookings/models.py`)
- Hostel API → Room inventory: accesses (evidence: `hostels/views.py`)
- Shared booking views → Booking records: queries (evidence: `webapp/views.py`)
- Shared booking views → Room inventory: queries (evidence: `webapp/views.py`)
- Booking signals → Booking records: handles events (evidence: `bookings/signals.py`)
- Booking signals → Notification service: notifies (evidence: `bookings/signals.py`)
- Booking signals → Calendar sync: requests sync (evidence: `bookings/signals.py`)
- Booking expiry → Booking records: expires records (evidence: `bookings/services/expiry_service.py`)
- Booking expiry → Calendar sync: requests sync (evidence: `bookings/services/expiry_service.py`)
- Sync task → Calendar sync: runs (evidence: `bookings/tasks.py`)
- Calendar sync → Booking records: reads bookings (evidence: `bookings/services/google_sheet_sync.py`)
- Calendar sync → Room inventory: reads rooms (evidence: `bookings/services/google_sheet_sync.py`)
- Calendar sync → Google Sheets: updates calendar (evidence: `bookings/services/google_sheet_sync.py`)
