How salekmasudparvez1/bik-server-a8l2 works
This is a Bike Servicing Management API. Clients send HTTP requests to an Express app, which dispatches customer, bike, and service operations; controllers invoke domain services, which persist records through Prisma. The API also validates requests and formats responses, with shared error handling for failures. The README documents CRUD and service-completion capabilities; sampled service code additionally exposes pending/in-progress service lookup. Some route and schema internals were not excerpted, so edges are limited to indexed references or documented behavior.
Main entry points: index.ts API Router · customer.route.ts Customer Routes · bike.route.ts Bike Routes · bikeservice.route.ts Service Routes
Components 22
HTTP API
- Express App
src/app.ts - API Router
src/app/routes/index.ts - Customer Routes
src/app/module/customer/customer.route.ts - Bike Routes
src/app/module/bike/bike.route.ts - Service Routes
src/app/module/service/bikeservice.route.ts
Management Domains
- Customer Controller
src/app/module/customer/customer.controller.ts - Customer Operations
src/app/module/customer/customer.service.ts - Customer Validation
src/app/module/customer/customer.validation.ts - Bike Controller
src/app/module/bike/bike.controller.ts - Bike Operations
src/app/module/bike/bike.service.ts - Bike Validation
src/app/module/bike/bike.validation.ts - Service Controller
src/app/module/service/bikeservice.controller.ts - Service Operations
src/app/module/service/bikeservice.service.ts - Service Validation
src/app/module/service/bikeservice.validation.ts
Persistence
- Prisma Client
src/shared/prisma.ts - PostgreSQL Database
Shared Handling
- Request Validation
src/app/middlewares/ValidateRequest.ts - Response Formatter
src/shared/sendResponse.ts - Async Error Wrapper
src/shared/catchAsync.ts - Global Error Handler
src/app/middlewares/globalErrorHandler.ts - Application Errors
src/app/errors/ApiErrors.ts
Other components
- API Client
Connections 33
- API Client → Express App: sends requests
README.md - Express App → API Router: mounts API
src/app.ts - Express App → Global Error Handler: handles errors
src/app.ts - API Router → Customer Routes: dispatches
src/app/routes/index.ts - API Router → Bike Routes: dispatches
src/app/routes/index.ts - API Router → Service Routes: dispatches
src/app/routes/index.ts - Customer Routes → Request Validation: validates requests
src/app/module/customer/customer.route.ts - Bike Routes → Request Validation: validates requests
src/app/module/bike/bike.route.ts - Service Routes → Request Validation: validates requests
src/app/module/service/bikeservice.route.ts - Customer Routes → Customer Controller: routes to
src/app/module/customer/customer.route.ts - Bike Routes → Bike Controller: routes to
src/app/module/bike/bike.route.ts - Service Routes → Service Controller: routes to
src/app/module/service/bikeservice.route.ts - Customer Controller → Customer Operations: invokes
src/app/module/customer/customer.controller.ts - Bike Controller → Bike Operations: invokes
src/app/module/bike/bike.controller.ts - Service Controller → Service Operations: invokes
src/app/module/service/bikeservice.controller.ts - Customer Controller → Response Formatter: formats response
src/app/module/customer/customer.controller.ts - Bike Controller → Response Formatter: formats response
src/app/module/bike/bike.controller.ts - Service Controller → Response Formatter: formats response
src/app/module/service/bikeservice.controller.ts - Customer Operations → Prisma Client: queries through
src/app/module/customer/customer.service.ts - Bike Operations → Prisma Client: queries through
src/app/module/bike/bike.service.ts - Service Operations → Prisma Client: queries through
src/app/module/service/bikeservice.service.ts - Prisma Client → PostgreSQL Database: connects to
README.md - Customer Controller → Async Error Wrapper: wraps handlers
src/app/module/customer/customer.controller.ts - Bike Controller → Async Error Wrapper: wraps handlers
src/app/module/bike/bike.controller.ts - Service Controller → Async Error Wrapper: wraps handlers
src/app/module/service/bikeservice.controller.ts - Async Error Wrapper → Global Error Handler: forwards errors
src/shared/catchAsync.ts - Customer Operations → Application Errors: raises errors
src/app/module/customer/customer.service.ts - Bike Operations → Application Errors: raises errors
src/app/module/bike/bike.service.ts - Service Operations → Application Errors: raises errors
src/app/module/service/bikeservice.service.ts - Global Error Handler → Application Errors: formats failures
- Customer Routes → Customer Validation: uses schema
src/app/module/customer/customer.route.ts - Bike Routes → Bike Validation: uses schema
src/app/module/bike/bike.route.ts - Service Routes → Service Validation: uses schema
src/app/module/service/bikeservice.route.ts