# pranjal360agarwal/apnabharat-bus-booking-reservation-system architecture

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

- Interactive diagram: https://gitdiagram.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system
- Repository: https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system

## Overview

ApnaBharat is presented as a Python/Tkinter bus-reservation desktop application backed by SQLite. The main booking workflow is a passenger entering trip details, searching buses, booking seats, and receiving a generated ticket; operators can maintain bus, route, and operator details. The sampled main module combines interface and booking logic, so those responsibilities share its path. The README also describes payment and confirmation, but the sampled code does not establish a payment integration. Login implementations and the newer feature modules are visible in the tree, but their wiring to the booking flow is not established by the excerpts.

Main entry points: [`bus-booking-system/main.py`](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/main.py) (Booking interface), [`bus-booking-system/My_database`](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/My_database) (Reservation data), [`bus-booking-system/Modules/SignIn_Module/SignIn_page.py`](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/Modules/SignIn_Module/SignIn_page.py) (Sign-in flow), [`New Features/user_profile.py`](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/New%20Features/user_profile.py) (User profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_booking["Booking workflow"]
  node_booking_ui["Booking interface<br/>[main.py]"]
  node_bus_search["Bus search<br/>[main.py]"]
  node_seat_booking["Seat booking<br/>[main.py]"]
  node_ticket["Ticket PDF<br/>[main.py]"]
  node_reservation_db[("Reservation data")]
end

subgraph group_operations["Operator tools"]
  node_operator_tools["Operator tools<br/>[main.py]"]
end

subgraph group_account["Accounts and extras"]
  node_login["Sign-in flow<br/>[SignIn_page.py]"]
  node_credentials[("Credential database")]
  node_account_delete["Account deletion<br/>[AccountDelete.py]"]
  node_profile["User profile<br/>[user_profile.py]"]
  node_profile_db[("Profile database<br/>[user_database.db]")]
  node_booking_history["Booking history<br/>[booking_history.py]"]
  node_recommendations["Recommendations"]
  node_live_tracking["Live tracking<br/>[realtime.py]"]
end

subgraph group_integrations["External services"]
  node_weather_api{{"Weather service"}}
end

node_passenger(("Passenger"))

node_passenger -->|"enters trip details"| node_booking_ui
node_booking_ui -->|"requests search"| node_bus_search
node_bus_search -->|"queries availability"| node_reservation_db
node_booking_ui -->|"books seats"| node_seat_booking
node_seat_booking -->|"writes reservation"| node_reservation_db
node_booking_ui -->|"generates ticket"| node_ticket
node_booking_ui -->|"offers admin tools"| node_operator_tools
node_operator_tools -->|"updates bus routes"| node_reservation_db
node_login -->|"reads and updates"| node_credentials
node_profile -->|"reads and updates"| node_profile_db
node_booking_ui -.->|"requests weather"| node_weather_api

click node_booking_ui "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/main.py"
click node_bus_search "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/main.py"
click node_seat_booking "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/main.py"
click node_ticket "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/main.py"
click node_reservation_db "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/My_database"
click node_operator_tools "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/main.py"
click node_login "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/Modules/SignIn_Module/SignIn_page.py"
click node_credentials "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/user_credentials.db"
click node_account_delete "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/Modules/DeleteAccount/AccountDelete.py"
click node_profile "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/New%20Features/user_profile.py"
click node_profile_db "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/New%20Features/user_database.db"
click node_booking_history "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/New%20Features/booking_history.py"
click node_recommendations "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/New%20Features/recommendation_feature.py"
click node_live_tracking "https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/New%20Features/realtime.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_booking_ui,node_bus_search,node_seat_booking,node_ticket,node_reservation_db toneBlue
class node_operator_tools toneAmber
class node_login,node_credentials,node_account_delete,node_profile,node_profile_db,node_booking_history,node_recommendations,node_live_tracking toneMint
class node_weather_api toneRose
class node_passenger toneIndigo
```

## Components

### Booking workflow

- [Booking interface](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/main.py): `bus-booking-system/main.py`
- [Bus search](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/main.py): `bus-booking-system/main.py`
- [Seat booking](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/main.py): `bus-booking-system/main.py`
- [Ticket PDF](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/main.py): `bus-booking-system/main.py`
- [Reservation data](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/My_database): `bus-booking-system/My_database`

### Operator tools

- [Operator tools](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/main.py): `bus-booking-system/main.py`

### Accounts and extras

- [Sign-in flow](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/Modules/SignIn_Module/SignIn_page.py): `bus-booking-system/Modules/SignIn_Module/SignIn_page.py`
- [Credential database](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/user_credentials.db): `bus-booking-system/user_credentials.db`
- [Account deletion](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/bus-booking-system/Modules/DeleteAccount/AccountDelete.py): `bus-booking-system/Modules/DeleteAccount/AccountDelete.py`
- [User profile](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/New%20Features/user_profile.py): `New Features/user_profile.py`
- [Profile database](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/New%20Features/user_database.db): `New Features/user_database.db`
- [Booking history](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/New%20Features/booking_history.py): `New Features/booking_history.py`
- [Recommendations](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/New%20Features/recommendation_feature.py): `New Features/recommendation_feature.py`
- [Live tracking](https://github.com/pranjal360agarwal/apnabharat-bus-booking-reservation-system/blob/master/New%20Features/realtime.py): `New Features/realtime.py`

### External services

- **Weather service**

### Other components

- **Passenger**

## Connections

- Passenger → Booking interface: enters trip details
- Booking interface → Bus search: requests search
- Bus search → Reservation data: queries availability
- Booking interface → Seat booking: books seats
- Seat booking → Reservation data: writes reservation
- Booking interface → Ticket PDF: generates ticket
- Booking interface → Operator tools: offers admin tools
- Operator tools → Reservation data: updates bus routes
- Sign-in flow → Credential database: reads and updates
- User profile → Profile database: reads and updates
- Booking interface → Weather service: requests weather
