# nishantpal30/bool-me architecture

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

- Interactive diagram: https://gitdiagram.com/nishantpal30/bool-me
- Repository: https://github.com/nishantpal30/bool-me

## Overview

This repository implements a booking platform backend: providers configure services and availability, while customers discover open slots, verify email, book and pay. Providers can manage bookings, connect calendars, and review wallet payouts and withdrawals. The public booking controller is the main customer workflow orchestrator; separate controllers handle provider operations and account management. The frontend tree is minimal, so its user interface behavior is not represented. Several route and service implementations are unsampled; their connections are included only where the source index or shown routes support them.

Main entry points: [`backend/src/controllers/public.controller.js`](https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/public.controller.js) (Customer booking flow), [`backend/src/server.js`](https://github.com/nishantpal30/bool-me/blob/main/backend/src/server.js) (Express server), [`backend/src/controllers/booking.controller.js`](https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/booking.controller.js) (Booking management), [`backend/src/middlewares/isauth.middleware.js`](https://github.com/nishantpal30/bool-me/blob/main/backend/src/middlewares/isauth.middleware.js) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_server["Express server<br/>[server.js]"]
  node_publicroutes["Public booking routes<br/>[public.routes.js]"]
  node_authroutes["Account routes<br/>[auth.routes.js]"]
  node_bookingroutes["Booking routes<br/>[booking.routes.js]"]
  node_availroutes["Availability routes"]
  node_calroutes["Calendar routes<br/>[calendar.routes.js]"]
  node_payroutes["Payment routes<br/>[payment.routes.js]"]
  node_servicesroutes["Service routes<br/>[services.routes.js]"]
end

subgraph group_accounts["Accounts"]
  node_auth["Authentication"]
  node_users["Registration and login<br/>[user.controller.js]"]
  node_register["Registration service"]
  node_registerotp["Registration OTP"]
  node_verifyotp["OTP verification<br/>[verifyOTP.js]"]
  node_userlogin["Login service"]
  node_userstore[("Users<br/>[user.js]")]
end

subgraph group_scheduling["Booking operations"]
  node_publicbooking["Customer booking flow"]
  node_bookingmanage["Booking management"]
  node_availability["Availability management"]
  node_services["Service management"]
  node_slots["Slot generation"]
  node_bookingstore[("Bookings<br/>[booking.js]")]
  node_availabilitystore[("Availability<br/>[avalability.js]")]
  node_servicestore[("Services<br/>[service.js]")]
end

subgraph group_money["Payments and wallet"]
  node_paymentcontroller["Wallet and withdrawals"]
  node_wallet["Wallet service<br/>[wallet.service.js]"]
  node_transactions[("Wallet transactions")]
  node_withdrawals[("Withdrawals<br/>[withdrawl.js]")]
end

subgraph group_integrations["External integrations"]
  node_calendarcontroller["Calendar connection"]
  node_calendarservice["Google Calendar service"]
  node_notifications["Booking notifications<br/>[sendBookingNoti.js]"]
end

node_client(("API client"))
node_googlecalendar["Google Calendar"]
node_emailservice["Email delivery"]
node_razorpay["Razorpay"]

node_client -->|"sends requests"| node_server
node_server -->|"mounts routes"| node_publicroutes
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_bookingroutes
node_server -->|"mounts routes"| node_availroutes
node_server -->|"mounts routes"| node_calroutes
node_server -->|"mounts routes"| node_payroutes
node_server -->|"mounts routes"| node_servicesroutes
node_publicroutes -->|"routes requests"| node_publicbooking
node_authroutes -->|"routes requests"| node_users
node_authroutes -->|"protects routes"| node_auth
node_bookingroutes -->|"routes requests"| node_bookingmanage
node_bookingroutes -->|"protects routes"| node_auth
node_availroutes -->|"routes requests"| node_availability
node_availroutes -->|"protects routes"| node_auth
node_calroutes -->|"routes requests"| node_calendarcontroller
node_calroutes -->|"protects routes"| node_auth
node_payroutes -->|"routes requests"| node_paymentcontroller
node_payroutes -->|"protects routes"| node_auth
node_servicesroutes -->|"routes requests"| node_services
node_servicesroutes -->|"protects routes"| node_auth
node_users -->|"registers users"| node_register
node_users -->|"requests OTP"| node_registerotp
node_users -->|"verifies OTP"| node_verifyotp
node_users -->|"authenticates users"| node_userlogin
node_register -->|"creates users"| node_userstore
node_register -->|"validates OTP"| node_verifyotp
node_registerotp -->|"stores OTP"| node_verifyotp
node_userlogin -->|"reads users"| node_userstore
node_publicbooking -->|"reads services"| node_servicestore
node_publicbooking -->|"reads providers"| node_userstore
node_publicbooking -->|"requests slots"| node_slots
node_slots -->|"reads schedules"| node_availabilitystore
node_slots -->|"checks bookings"| node_bookingstore
node_publicbooking -->|"creates bookings"| node_bookingstore
node_publicbooking -->|"verifies customer"| node_verifyotp
node_publicbooking -.->|"creates payment orders"| node_razorpay
node_publicbooking -->|"creates calendar events"| node_calendarservice
node_calendarservice -->|"writes events"| node_googlecalendar
node_publicbooking -->|"sends confirmations"| node_notifications
node_notifications -.->|"sends email"| node_emailservice
node_bookingmanage -->|"updates bookings"| node_bookingstore
node_bookingmanage -->|"updates events"| node_calendarservice
node_bookingmanage -->|"sends updates"| node_notifications
node_bookingmanage -->|"reads services"| node_servicestore
node_bookingmanage -->|"reads providers"| node_userstore
node_availability -.->|"manages schedules"| node_availabilitystore
node_services -->|"manages services"| node_servicestore

click node_server "https://github.com/nishantpal30/bool-me/blob/main/backend/src/server.js"
click node_publicroutes "https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/public.routes.js"
click node_authroutes "https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/auth.routes.js"
click node_bookingroutes "https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/booking.routes.js"
click node_availroutes "https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/availability.routes.js"
click node_calroutes "https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/calendar.routes.js"
click node_payroutes "https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/payment.routes.js"
click node_servicesroutes "https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/services.routes.js"
click node_auth "https://github.com/nishantpal30/bool-me/blob/main/backend/src/middlewares/isauth.middleware.js"
click node_users "https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/user.controller.js"
click node_register "https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/register.service.js"
click node_registerotp "https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/registerOTP.service.js"
click node_verifyotp "https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/verifyOTP.js"
click node_userlogin "https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/userlogin.service.js"
click node_publicbooking "https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/public.controller.js"
click node_bookingmanage "https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/booking.controller.js"
click node_availability "https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/availability.controller.js"
click node_services "https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/service.controller.js"
click node_slots "https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/slotgenerator.service.js"
click node_bookingstore "https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/booking.js"
click node_availabilitystore "https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/avalability.js"
click node_servicestore "https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/service.js"
click node_userstore "https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/user.js"
click node_calendarcontroller "https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/integartingCalendar.controller.js"
click node_calendarservice "https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/googleCalendar.service.js"
click node_notifications "https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/sendBookingNoti.js"
click node_paymentcontroller "https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/payment.controller.js"
click node_wallet "https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/wallet.service.js"
click node_transactions "https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/walletTransaction.js"
click node_withdrawals "https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/withdrawl.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_server,node_publicroutes,node_authroutes,node_bookingroutes,node_availroutes,node_calroutes,node_payroutes,node_servicesroutes,node_client toneBlue
class node_auth,node_users,node_register,node_registerotp,node_verifyotp,node_userlogin,node_userstore toneAmber
class node_publicbooking,node_bookingmanage,node_availability,node_services,node_slots,node_bookingstore,node_availabilitystore,node_servicestore toneMint
class node_paymentcontroller,node_wallet,node_transactions,node_withdrawals toneRose
class node_calendarcontroller,node_calendarservice,node_notifications,node_googlecalendar,node_emailservice,node_razorpay toneIndigo
```

## Components

### API entry

- [Express server](https://github.com/nishantpal30/bool-me/blob/main/backend/src/server.js): `backend/src/server.js`
- [Public booking routes](https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/public.routes.js): `backend/src/routers/public.routes.js`
- [Account routes](https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/auth.routes.js): `backend/src/routers/auth.routes.js`
- [Booking routes](https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/booking.routes.js): `backend/src/routers/booking.routes.js`
- [Availability routes](https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/availability.routes.js): `backend/src/routers/availability.routes.js`
- [Calendar routes](https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/calendar.routes.js): `backend/src/routers/calendar.routes.js`
- [Payment routes](https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/payment.routes.js): `backend/src/routers/payment.routes.js`
- [Service routes](https://github.com/nishantpal30/bool-me/blob/main/backend/src/routers/services.routes.js): `backend/src/routers/services.routes.js`

### Accounts

- [Authentication](https://github.com/nishantpal30/bool-me/blob/main/backend/src/middlewares/isauth.middleware.js): `backend/src/middlewares/isauth.middleware.js`
- [Registration and login](https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/user.controller.js): `backend/src/controllers/user.controller.js`
- [Registration service](https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/register.service.js): `backend/src/services/register.service.js`
- [Registration OTP](https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/registerOTP.service.js): `backend/src/services/registerOTP.service.js`
- [OTP verification](https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/verifyOTP.js): `backend/src/services/verifyOTP.js`
- [Login service](https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/userlogin.service.js): `backend/src/services/userlogin.service.js`
- [Users](https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/user.js): `backend/src/db/models/user.js`

### Booking operations

- [Customer booking flow](https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/public.controller.js): `backend/src/controllers/public.controller.js`
- [Booking management](https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/booking.controller.js): `backend/src/controllers/booking.controller.js`
- [Availability management](https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/availability.controller.js): `backend/src/controllers/availability.controller.js`
- [Service management](https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/service.controller.js): `backend/src/controllers/service.controller.js`
- [Slot generation](https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/slotgenerator.service.js): `backend/src/services/slotgenerator.service.js`
- [Bookings](https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/booking.js): `backend/src/db/models/booking.js`
- [Availability](https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/avalability.js): `backend/src/db/models/avalability.js`
- [Services](https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/service.js): `backend/src/db/models/service.js`

### Payments and wallet

- [Wallet and withdrawals](https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/payment.controller.js): `backend/src/controllers/payment.controller.js`
- [Wallet service](https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/wallet.service.js): `backend/src/services/wallet.service.js`
- [Wallet transactions](https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/walletTransaction.js): `backend/src/db/models/walletTransaction.js`
- [Withdrawals](https://github.com/nishantpal30/bool-me/blob/main/backend/src/db/models/withdrawl.js): `backend/src/db/models/withdrawl.js`

### External integrations

- [Calendar connection](https://github.com/nishantpal30/bool-me/blob/main/backend/src/controllers/integartingCalendar.controller.js): `backend/src/controllers/integartingCalendar.controller.js`
- [Google Calendar service](https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/googleCalendar.service.js): `backend/src/services/googleCalendar.service.js`
- [Booking notifications](https://github.com/nishantpal30/bool-me/blob/main/backend/src/services/sendBookingNoti.js): `backend/src/services/sendBookingNoti.js`

### Other components

- **API client**
- **Google Calendar**
- **Email delivery**
- **Razorpay**

## Connections

- API client → Express server: sends requests
- Express server → Public booking routes: mounts routes (evidence: `backend/src/server.js`)
- Express server → Account routes: mounts routes (evidence: `backend/src/server.js`)
- Express server → Booking routes: mounts routes (evidence: `backend/src/server.js`)
- Express server → Availability routes: mounts routes (evidence: `backend/src/server.js`)
- Express server → Calendar routes: mounts routes (evidence: `backend/src/server.js`)
- Express server → Payment routes: mounts routes (evidence: `backend/src/server.js`)
- Express server → Service routes: mounts routes (evidence: `backend/src/server.js`)
- Public booking routes → Customer booking flow: routes requests (evidence: `backend/src/routers/public.routes.js`)
- Account routes → Registration and login: routes requests (evidence: `backend/src/routers/auth.routes.js`)
- Account routes → Authentication: protects routes (evidence: `backend/src/routers/auth.routes.js`)
- Booking routes → Booking management: routes requests (evidence: `backend/src/routers/booking.routes.js`)
- Booking routes → Authentication: protects routes (evidence: `backend/src/routers/booking.routes.js`)
- Availability routes → Availability management: routes requests (evidence: `backend/src/routers/availability.routes.js`)
- Availability routes → Authentication: protects routes (evidence: `backend/src/routers/availability.routes.js`)
- Calendar routes → Calendar connection: routes requests (evidence: `backend/src/routers/calendar.routes.js`)
- Calendar routes → Authentication: protects routes (evidence: `backend/src/routers/calendar.routes.js`)
- Payment routes → Wallet and withdrawals: routes requests (evidence: `backend/src/routers/payment.routes.js`)
- Payment routes → Authentication: protects routes (evidence: `backend/src/routers/payment.routes.js`)
- Service routes → Service management: routes requests (evidence: `backend/src/routers/services.routes.js`)
- Service routes → Authentication: protects routes (evidence: `backend/src/routers/services.routes.js`)
- Registration and login → Registration service: registers users (evidence: `backend/src/controllers/user.controller.js`)
- Registration and login → Registration OTP: requests OTP (evidence: `backend/src/controllers/user.controller.js`)
- Registration and login → OTP verification: verifies OTP (evidence: `backend/src/controllers/user.controller.js`)
- Registration and login → Login service: authenticates users (evidence: `backend/src/controllers/user.controller.js`)
- Registration service → Users: creates users (evidence: `backend/src/services/register.service.js`)
- Registration service → OTP verification: validates OTP (evidence: `backend/src/services/register.service.js`)
- Registration OTP → OTP verification: stores OTP (evidence: `backend/src/services/registerOTP.service.js`)
- Login service → Users: reads users (evidence: `backend/src/services/userlogin.service.js`)
- Customer booking flow → Services: reads services (evidence: `backend/src/controllers/public.controller.js`)
- Customer booking flow → Users: reads providers (evidence: `backend/src/controllers/public.controller.js`)
- Customer booking flow → Slot generation: requests slots (evidence: `backend/src/controllers/public.controller.js`)
- Slot generation → Availability: reads schedules (evidence: `backend/src/services/slotgenerator.service.js`)
- Slot generation → Bookings: checks bookings (evidence: `backend/src/services/slotgenerator.service.js`)
- Customer booking flow → Bookings: creates bookings (evidence: `backend/src/controllers/public.controller.js`)
- Customer booking flow → OTP verification: verifies customer (evidence: `backend/src/controllers/public.controller.js`)
- Customer booking flow → Razorpay: creates payment orders
- Customer booking flow → Google Calendar service: creates calendar events (evidence: `backend/src/controllers/public.controller.js`)
- Google Calendar service → Google Calendar: writes events (evidence: `backend/src/services/googleCalendar.service.js`)
- Customer booking flow → Booking notifications: sends confirmations (evidence: `backend/src/controllers/public.controller.js`)
- Booking notifications → Email delivery: sends email
- Booking management → Bookings: updates bookings (evidence: `backend/src/controllers/booking.controller.js`)
- Booking management → Google Calendar service: updates events (evidence: `backend/src/controllers/booking.controller.js`)
- Booking management → Booking notifications: sends updates (evidence: `backend/src/controllers/booking.controller.js`)
- Booking management → Services: reads services (evidence: `backend/src/controllers/booking.controller.js`)
- Booking management → Users: reads providers (evidence: `backend/src/controllers/booking.controller.js`)
- Availability management → Availability: manages schedules
- Service management → Services: manages services (evidence: `backend/src/controllers/service.controller.js`)
