# abdulwasim-s/slot-booking-backend architecture

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

- Interactive diagram: https://gitdiagram.com/abdulwasim-s/slot-booking-backend
- Repository: https://github.com/abdulwasim-s/slot-booking-backend

## Overview

This is a turf-slot booking backend. A client submits a booking through the booking route; the handler records the selected time slot and booking, sends a confirmation email, and returns a response. A separate route returns booked dates by time slot, while the root route serves a welcome response. The source excerpts show the booking and listing calls; the entry-point and database-connection links are supported by the SOURCE INDEX. No README was provided, so broader product capabilities cannot be confirmed.

Main entry points: [`component/booking.js`](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/component/booking.js) (Booking Handler), [`component/booking_list.js`](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/component/booking_list.js) (Availability Handler), [`router/routers.js`](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/router/routers.js) (Route Registry), [`index.js`](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/index.js) (Application Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_router["Route Registry<br/>[routers.js]"]
  node_welcome["Welcome Handler<br/>[welcome.js]"]
  node_entry["Application Entry<br/>[index.js]"]
end

subgraph group_booking["Booking Domain"]
  node_booking_handler["Booking Handler<br/>[booking.js]"]
  node_list_handler["Availability Handler<br/>[booking_list.js]"]
  node_booking_model[("Booking Records<br/>[booking_model.js]")]
  node_three_model[("Three Slot Dates")]
  node_six_model[("Six Slot Dates")]
  node_nine_model[("Nine Slot Dates")]
  node_twelve_model[("Twelve Slot Dates")]
end

subgraph group_infra["Persistence And Email"]
  node_mailer["Confirmation Mailer<br/>[send_mail.js]"]
  node_db_connection["Database Connection<br/>[db_connection.js]"]
end

node_client(("API Client"))
node_smtp["Gmail SMTP"]
node_mongo[("MongoDB")]

node_client -.->|"sends HTTP"| node_router
node_router -->|"routes GET /"| node_welcome
node_router -->|"routes GET /booking"| node_list_handler
node_router -->|"routes POST /booking"| node_booking_handler
node_booking_handler -->|"saves slot date"| node_three_model
node_booking_handler -->|"saves slot date"| node_six_model
node_booking_handler -->|"saves slot date"| node_nine_model
node_booking_handler -->|"saves slot date"| node_twelve_model
node_booking_handler -->|"saves booking"| node_booking_model
node_booking_handler -->|"sends confirmation"| node_mailer
node_mailer -->|"sends email"| node_smtp
node_list_handler -->|"reads dates"| node_three_model
node_list_handler -->|"reads dates"| node_six_model
node_list_handler -->|"reads dates"| node_nine_model
node_list_handler -->|"reads dates"| node_twelve_model
node_entry -->|"imports router"| node_router
node_entry -->|"imports connection"| node_db_connection
node_db_connection -->|"connects"| node_mongo

click node_router "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/router/routers.js"
click node_welcome "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/component/welcome.js"
click node_booking_handler "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/component/booking.js"
click node_list_handler "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/component/booking_list.js"
click node_booking_model "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/models/booking_model.js"
click node_three_model "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/models/three_o_clock_model.js"
click node_six_model "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/models/six_o_clock_model.js"
click node_nine_model "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/models/nine_o_clock_model.js"
click node_twelve_model "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/models/twelve_o_clock_model.js"
click node_mailer "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/helper/send_mail.js"
click node_db_connection "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/database/db_connection.js"
click node_entry "https://github.com/abdulwasim-s/slot-booking-backend/blob/master/index.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_router,node_welcome,node_entry,node_client toneBlue
class node_booking_handler,node_list_handler,node_booking_model,node_three_model,node_six_model,node_nine_model,node_twelve_model,node_mongo toneAmber
class node_mailer,node_db_connection toneMint
class node_smtp toneIndigo
```

## Components

### HTTP API

- [Route Registry](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/router/routers.js): `router/routers.js`
- [Welcome Handler](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/component/welcome.js): `component/welcome.js`
- [Application Entry](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/index.js): `index.js`

### Booking Domain

- [Booking Handler](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/component/booking.js): `component/booking.js`
- [Availability Handler](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/component/booking_list.js): `component/booking_list.js`
- [Booking Records](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/models/booking_model.js): `models/booking_model.js`
- [Three Slot Dates](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/models/three_o_clock_model.js): `models/three_o_clock_model.js`
- [Six Slot Dates](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/models/six_o_clock_model.js): `models/six_o_clock_model.js`
- [Nine Slot Dates](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/models/nine_o_clock_model.js): `models/nine_o_clock_model.js`
- [Twelve Slot Dates](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/models/twelve_o_clock_model.js): `models/twelve_o_clock_model.js`

### Persistence And Email

- [Confirmation Mailer](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/helper/send_mail.js): `helper/send_mail.js`
- [Database Connection](https://github.com/abdulwasim-s/slot-booking-backend/blob/master/database/db_connection.js): `database/db_connection.js`

### Other components

- **API Client**
- **Gmail SMTP**
- **MongoDB**

## Connections

- API Client → Route Registry: sends HTTP
- Route Registry → Welcome Handler: routes GET / (evidence: `router/routers.js`)
- Route Registry → Availability Handler: routes GET /booking (evidence: `router/routers.js`)
- Route Registry → Booking Handler: routes POST /booking (evidence: `router/routers.js`)
- Booking Handler → Three Slot Dates: saves slot date (evidence: `component/booking.js`)
- Booking Handler → Six Slot Dates: saves slot date (evidence: `component/booking.js`)
- Booking Handler → Nine Slot Dates: saves slot date (evidence: `component/booking.js`)
- Booking Handler → Twelve Slot Dates: saves slot date (evidence: `component/booking.js`)
- Booking Handler → Booking Records: saves booking (evidence: `component/booking.js`)
- Booking Handler → Confirmation Mailer: sends confirmation (evidence: `component/booking.js`)
- Confirmation Mailer → Gmail SMTP: sends email (evidence: `helper/send_mail.js`)
- Availability Handler → Three Slot Dates: reads dates (evidence: `component/booking_list.js`)
- Availability Handler → Six Slot Dates: reads dates (evidence: `component/booking_list.js`)
- Availability Handler → Nine Slot Dates: reads dates (evidence: `component/booking_list.js`)
- Availability Handler → Twelve Slot Dates: reads dates (evidence: `component/booking_list.js`)
- Application Entry → Route Registry: imports router (evidence: `index.js`)
- Application Entry → Database Connection: imports connection (evidence: `index.js`)
- Database Connection → MongoDB: connects (evidence: `database/db_connection.js`)
