How sn1perzgg/driveo-back-end works
Driveo is a NestJS REST API for vehicle rentals. The main workflow is a renter searching vehicles and creating a date-based booking; the booking service checks availability and rental details, applies route fees or promo codes, and supports payment confirmation, cancellation, and status changes. Admin and fleet-management APIs maintain vehicles and their reference data, while authentication and role guards protect operations. MongoDB/Mongoose is the persistent store. The map follows README-described capabilities and shown controller/service relationships; unsampled module wiring and integrations are not inferred.
Main entry points: app.module.ts Application modules · bookings.service.ts Booking workflow · vehicles.service.ts Vehicle search and management · auth.controller.ts Authentication
Components 26
API entry and access
- API bootstrap
src/main.ts - Application modules
src/app.module.ts - Authentication
src/auth/auth.controller.ts - Role authorization
src/auth/roles.guard.ts
Rental operations
- Booking workflow
src/bookings/bookings.service.ts - Booking endpoints
src/bookings/bookings.controller.ts - Booking records
src/bookings/booking.schema.ts - Promo codes
src/promo-codes/promocodes.controller.ts - Promo validation
src/promo-codes/promocodes.service.ts - Promo records
src/promo-codes/promo-code.schema.ts
Fleet catalog
- Vehicle endpoints
src/vehicles/vehicles.controller.ts - Vehicle search and management
src/vehicles/vehicles.service.ts - Vehicle records
src/vehicles/vehicle.schema.ts
Accounts and engagement
- User endpoints
src/users/users.controller.ts - User accounts
src/users/users.service.ts - User records
src/users/user.schema.ts - Contact requests
src/contacts/contacts.controller.ts
Rental reference data
- City catalog
src/cities/cities.service.ts - City records
src/cities/city.schema.ts - One-way route fees
src/one-way-fees/one-way-fees.service.ts - Fee records
src/one-way-fees/one-way-fee.schema.ts - Category catalog
src/categories/categories.service.ts - Category records
src/categories/category.schema.ts - Brand catalog
src/brands/brands.service.ts - Model catalog
src/models/models.service.ts
Other components
- Renter / Admin
Connections 43
- Renter / Admin → API bootstrap: sends API requests
README.md - API bootstrap → Application modules: starts application
src/main.ts - Application modules → Authentication: registers module
src/app.module.ts - Application modules → Booking endpoints: registers module
src/app.module.ts - Application modules → Vehicle endpoints: registers module
src/app.module.ts - Application modules → User endpoints: registers module
src/app.module.ts - Application modules → City catalog: registers module
src/app.module.ts - Application modules → Category catalog: registers module
src/app.module.ts - Application modules → One-way route fees: registers module
src/app.module.ts - Application modules → Promo codes: registers module
src/app.module.ts - Application modules → Brand catalog: registers module
src/app.module.ts - Application modules → Model catalog: registers module
src/app.module.ts - Application modules → Contact requests: registers module
src/app.module.ts - Renter / Admin → Authentication: logs in or registers
src/auth/auth.controller.ts - Authentication → User accounts: uses account service
src/auth/auth.controller.ts - Authentication → Role authorization: protects routes
- Renter / Admin → Vehicle endpoints: searches vehicles
src/vehicles/vehicles.controller.ts - Vehicle endpoints → Vehicle search and management: delegates requests
src/vehicles/vehicles.controller.ts - Vehicle search and management → Vehicle records: reads and writes
src/vehicles/vehicles.service.ts - Vehicle search and management → Booking records: checks booked vehicles
src/vehicles/vehicles.service.ts - Renter / Admin → Booking endpoints: creates and manages rentals
src/bookings/bookings.controller.ts - Booking endpoints → Booking workflow: delegates booking actions
src/bookings/bookings.controller.ts - Booking workflow → Booking records: reads and writes
src/bookings/bookings.service.ts - Booking workflow → Vehicle records: checks and updates vehicle
src/bookings/bookings.service.ts - Booking workflow → User records: checks renter
src/bookings/bookings.service.ts - Booking workflow → City records: checks rental cities
src/bookings/bookings.service.ts - Booking workflow → Fee records: reads route fee
src/bookings/bookings.service.ts - Booking workflow → Promo records: validates discount
src/bookings/bookings.service.ts - Renter / Admin → User endpoints: manages profile
src/users/users.controller.ts - User endpoints → User accounts: delegates account actions
src/users/users.controller.ts - User accounts → User records: reads and writes
src/users/users.service.ts - Renter / Admin → Promo codes: manages promotions
- Promo codes → Promo validation: delegates
src/promo-codes/promocodes.controller.ts - Promo validation → Promo records: reads and writes
src/promo-codes/promocodes.service.ts - City catalog → City records: reads and writes
src/cities/cities.service.ts - Category catalog → Category records: reads and writes
src/categories/categories.service.ts - Category catalog → Vehicle records: updates vehicle counts
src/categories/categories.service.ts - One-way route fees → Fee records: reads and writes
src/one-way-fees/one-way-fees.service.ts - One-way route fees → City records: validates cities
src/one-way-fees/one-way-fees.service.ts - Vehicle search and management → City records: validates cities
src/vehicles/vehicles.service.ts - Vehicle search and management → Category records: populates category
src/vehicles/vehicles.service.ts - Vehicle search and management → Brand catalog: populates brand
- Vehicle search and management → Model catalog: populates model