# jeetpatel13/theme-park-booking architecture

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

- Interactive diagram: https://gitdiagram.com/jeetpatel13/theme-park-booking
- Repository: https://github.com/jeetpatel13/theme-park-booking

## Overview

Theme Park Booking lets visitors browse rides, register or sign in, then choose a ride slot and manage bookings. The browser scripts call Express routes; the server handles authentication and booking operations against SQLite. The graph also includes the documented protected dashboard and booking-management capabilities. The Mongoose model files are not connected to the sampled runtime, so they are omitted; dashboard and booking-list behavior is represented from README documentation, not inspected source.

Main entry points: [`database/db.js`](https://github.com/jeetpatel13/theme-park-booking/blob/main/database/db.js) (SQLite database), [`public/js/booking.js`](https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/booking.js) (Booking form), [`server.js`](https://github.com/jeetpatel13/theme-park-booking/blob/main/server.js) (Express routes), [`public/js/rides.js`](https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/rides.js) (Ride browser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_ride_ui["Ride browser<br/>[rides.js]"]
  node_booking_ui["Booking form<br/>[booking.js]"]
  node_account_ui["Account forms<br/>[register.js]"]
  node_login_ui["Login form<br/>[login.js]"]
  node_navigation["Navigation<br/>[navigation.js]"]
  node_dashboard_ui["Dashboard<br/>[dashboard.js]"]
  node_mybookings_ui["My bookings<br/>[mybookings.js]"]
end

subgraph group_identity["Identity and access"]
  node_server["Express routes<br/>[server.js]"]
  node_auth_guard["Session guard<br/>[authMiddleware.js]"]
  node_account_service["Account service<br/>[server.js]"]
end

subgraph group_rides["Ride catalog"]
  node_ride_catalog["Ride catalog API<br/>[server.js]"]
end

subgraph group_booking["Booking management"]
  node_booking_service["Booking API<br/>[server.js]"]
end

subgraph group_storage["Persistence"]
  node_sqlite[("SQLite database<br/>[db.js]")]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_ride_ui
node_visitor -->|"registers"| node_account_ui
node_visitor -->|"signs in"| node_login_ui
node_visitor -->|"books slot"| node_booking_ui
node_visitor -->|"views dashboard"| node_dashboard_ui
node_visitor -->|"manages bookings"| node_mybookings_ui
node_ride_ui -->|"fetches rides"| node_ride_catalog
node_booking_ui -->|"loads ride slots"| node_ride_catalog
node_booking_ui -->|"submits booking"| node_booking_service
node_account_ui -->|"registers account"| node_account_service
node_login_ui -->|"submits credentials"| node_account_service
node_navigation -->|"checks session"| node_server
node_server -->|"guards routes"| node_auth_guard
node_ride_catalog -->|"queries rides"| node_sqlite
node_account_service -->|"reads and writes"| node_sqlite
node_booking_service -->|"reads and writes"| node_sqlite
node_server -->|"creates tables"| node_sqlite

click node_ride_ui "https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/rides.js"
click node_booking_ui "https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/booking.js"
click node_account_ui "https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/register.js"
click node_login_ui "https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/login.js"
click node_navigation "https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/navigation.js"
click node_dashboard_ui "https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/dashboard.js"
click node_mybookings_ui "https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/mybookings.js"
click node_server "https://github.com/jeetpatel13/theme-park-booking/blob/main/server.js"
click node_auth_guard "https://github.com/jeetpatel13/theme-park-booking/blob/main/middleware/authMiddleware.js"
click node_ride_catalog "https://github.com/jeetpatel13/theme-park-booking/blob/main/server.js"
click node_account_service "https://github.com/jeetpatel13/theme-park-booking/blob/main/server.js"
click node_booking_service "https://github.com/jeetpatel13/theme-park-booking/blob/main/server.js"
click node_sqlite "https://github.com/jeetpatel13/theme-park-booking/blob/main/database/db.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_ride_ui,node_booking_ui,node_account_ui,node_login_ui,node_navigation,node_dashboard_ui,node_mybookings_ui toneBlue
class node_server,node_auth_guard,node_account_service toneAmber
class node_ride_catalog toneMint
class node_booking_service toneRose
class node_sqlite,node_visitor toneIndigo
```

## Components

### Web experience

- [Ride browser](https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/rides.js): `public/js/rides.js`
- [Booking form](https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/booking.js): `public/js/booking.js`
- [Account forms](https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/register.js): `public/js/register.js`
- [Login form](https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/login.js): `public/js/login.js`
- [Navigation](https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/navigation.js): `public/js/navigation.js`
- [Dashboard](https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/dashboard.js): `public/js/dashboard.js`
- [My bookings](https://github.com/jeetpatel13/theme-park-booking/blob/main/public/js/mybookings.js): `public/js/mybookings.js`

### Identity and access

- [Express routes](https://github.com/jeetpatel13/theme-park-booking/blob/main/server.js): `server.js`
- [Session guard](https://github.com/jeetpatel13/theme-park-booking/blob/main/middleware/authMiddleware.js): `middleware/authMiddleware.js`
- [Account service](https://github.com/jeetpatel13/theme-park-booking/blob/main/server.js): `server.js`

### Ride catalog

- [Ride catalog API](https://github.com/jeetpatel13/theme-park-booking/blob/main/server.js): `server.js`

### Booking management

- [Booking API](https://github.com/jeetpatel13/theme-park-booking/blob/main/server.js): `server.js`

### Persistence

- [SQLite database](https://github.com/jeetpatel13/theme-park-booking/blob/main/database/db.js): `database/db.js`

### Other components

- **Visitor**

## Connections

- Visitor → Ride browser: browses (evidence: `README.md`)
- Visitor → Account forms: registers (evidence: `README.md`)
- Visitor → Login form: signs in (evidence: `README.md`)
- Visitor → Booking form: books slot (evidence: `README.md`)
- Visitor → Dashboard: views dashboard (evidence: `README.md`)
- Visitor → My bookings: manages bookings (evidence: `README.md`)
- Ride browser → Ride catalog API: fetches rides (evidence: `public/js/rides.js`)
- Booking form → Ride catalog API: loads ride slots (evidence: `public/js/booking.js`)
- Booking form → Booking API: submits booking (evidence: `public/js/booking.js`)
- Account forms → Account service: registers account (evidence: `public/js/register.js`)
- Login form → Account service: submits credentials (evidence: `public/js/login.js`)
- Navigation → Express routes: checks session (evidence: `public/js/navigation.js`)
- Express routes → Session guard: guards routes (evidence: `server.js`)
- Ride catalog API → SQLite database: queries rides (evidence: `server.js`)
- Account service → SQLite database: reads and writes (evidence: `server.js`)
- Booking API → SQLite database: reads and writes (evidence: `server.js`)
- Express routes → SQLite database: creates tables (evidence: `database/db.js`)
