How riajuddinrumman/shebabook works
ShebaBook is a NestJS service-booking API. Customers register or log in, receive a JWT, then submit an appointment request; the booking service derives the end time, checks the listing and booking window, and checks provider/customer conflicts before writing. PostgreSQL constraints provide a final concurrency-safe safeguard. The graph also shows authentication guards and the liveness route. Provider discovery and service-listing management are described as product context, but no corresponding implemented routes are shown. Booking internals are supported by excerpts; other links rely on the README or SOURCE INDEX.
Main entry points: bookings.controller.ts Booking endpoint · booking.service.ts Booking rules · auth.service.ts Register and login · app.module.ts App module
Components 19
API application
- App module
src/app.module.ts - Liveness route
src/app.controller.ts - Health response
src/app.service.ts
Identity and access
- Auth endpoints
src/auth/auth.controller.ts - Register and login
src/auth/auth.service.ts - Password hashing
src/auth/password.ts - JWT service
src/auth/token.service.ts - JWT guard
src/auth/jwt-auth.guard.ts - Role guard
src/auth/roles.guard.ts - Current identity
src/auth/current-user.decorator.ts
Booking rules
- Booking endpoint
src/bookings/bookings.controller.ts - Booking rules
src/bookings/booking.service.ts - Request validation
src/bookings/dto/create-booking.dto.ts - Interval calculation
src/bookings/overlap.ts - Constraint mapping
src/bookings/slot-constraint.ts
Persistence
- Prisma data access
src/prisma/prisma.service.ts - PostgreSQL
Other components
- Customer
- JWT provider
Connections 23
- App module → Auth endpoints: wires
- App module → Booking endpoint: wires
src/app.module.ts - App module → Liveness route: registers
src/app.module.ts - Liveness route → Health response: calls
src/app.controller.ts - Customer → Auth endpoints: registers or logs in
README.md - Auth endpoints → Register and login: delegates
src/auth/auth.controller.ts - Register and login → Password hashing: hashes and verifies
src/auth/auth.service.ts - Register and login → Prisma data access: reads and creates users
src/auth/auth.service.ts - Register and login → JWT service: signs token
src/auth/auth.service.ts - JWT service → JWT provider: signs and verifies
src/auth/token.service.ts - Customer → Booking endpoint: requests appointment
README.md - Booking endpoint → JWT guard: guards request
src/bookings/bookings.controller.ts - Booking endpoint → Role guard: checks role
src/bookings/bookings.controller.ts - Booking endpoint → Current identity: gets identity
src/bookings/bookings.controller.ts - Booking endpoint → Request validation: accepts request
src/bookings/bookings.controller.ts - JWT guard → JWT service: verifies token
src/auth/jwt-auth.guard.ts - Role guard → Customer: authorizes role
README.md - Booking endpoint → Booking rules: creates booking
src/bookings/bookings.controller.ts - Booking rules → Prisma data access: queries and writes
src/bookings/booking.service.ts - Booking rules → Interval calculation: derives end time
src/bookings/booking.service.ts - Booking rules → Constraint mapping: maps constraint failure
src/bookings/booking.service.ts - Prisma data access → PostgreSQL: persists data
src/prisma/prisma.service.ts - PostgreSQL → Booking rules: rejects overlapping writes
README.md