How bustixpf/bustix-backend works
This is a BusTix backend API built with NestJS, despite the generic starter README. The main user flow is authentication followed by role-protected access to company and travel services; passengers can purchase tickets, while company administrators manage routes and trips. Superadmins review company, route, and schedule requests and oversee users and sales. The graph also includes notifications, uploads, audit logging, chatbot, and metrics. Relationships reflect the excerpts and SOURCE INDEX references; unsampled implementations are represented by their listed paths, without assuming their internal call flows.
Main entry points: companies.controller.ts Company endpoints · auth Auth and guards · dashboard.service.ts Dashboard workflows · notifications.service.ts Email notifications
Components 25
Identity and access
- Auth endpoints
src/auth/auth.controller.ts - Auth and guards
src/auth - Users
src/users/users.service.ts
Company operations
- Company endpoints
src/companies/companies.controller.ts - Company services
src/companies/companies.service.ts - Company records
src/companies/entities/company.entity.ts - Document uploads
src/file-upload/file-upload.service.ts
Travel and sales
- Route endpoints
src/routes/routes.controller.ts - Route services
src/routes/routes.service.ts - Route records
src/routes/entities/routes.entity.ts - Trip services
src/trips/trips.service.ts - Ticket services
src/tickets/tickets.service.ts - Payment endpoints
src/payments/payments.controller.ts - Payment processing
src/payments/payments.service.ts
Administration
- Dashboard endpoints
src/dashboard/superadmin.controller.ts - Dashboard workflows
src/dashboard/dashboard.service.ts - Review requests
src/dashboard/entities/route-request.entity.ts
Platform services
- Audit logging
src/auditLog/auditLog.interceptor.ts - Notification endpoints
src/notifications/notifications.controller.ts - Email notifications
src/notifications/notifications.service.ts - Email templates
src/notifications/email-templates.service.ts - Brevo email
- Chatbot
src/chatbot/chatbot.service.ts - Metrics
src/metrics/metric.service.ts
Other components
- API client
Connections 28
- API client → Auth endpoints: requests login
src/auth/auth.controller.ts - Auth endpoints → Auth and guards: delegates auth
src/auth/auth.controller.ts - Auth and guards → Users: looks up users
src/auth/auth.service.ts - Auth and guards → Email notifications: sends welcome
src/auth/auth.service.ts - API client → Company endpoints: requests companies
src/companies/companies.controller.ts - Company endpoints → Company services: delegates operations
src/companies/companies.controller.ts - Company endpoints → Document uploads: issues upload token
src/companies/companies.controller.ts - Company endpoints → Audit logging: applies interceptor
src/companies/companies.controller.ts - Company endpoints → Auth and guards: guards access
src/companies/companies.controller.ts - API client → Dashboard endpoints: requests administration
src/dashboard/superadmin.controller.ts - Dashboard endpoints → Dashboard workflows: delegates workflows
src/dashboard/superadmin.controller.ts - Dashboard workflows → Users: queries users
src/dashboard/dashboard.service.ts - Dashboard workflows → Company services: uses company service
src/dashboard/dashboard.service.ts - Dashboard workflows → Review requests: handles requests
src/dashboard/dashboard.service.ts - API client → Route endpoints: requests routes
src/routes/routes.controller.ts - Route endpoints → Route services: delegates operations
src/routes/routes.controller.ts - Route endpoints → Auth and guards: guards access
src/routes/routes.controller.ts - Route records → Company records: references company
src/routes/entities/routes.entity.ts - Route records → Trip services: relates trips
src/routes/entities/routes.entity.ts - API client → Payment endpoints: requests checkout
src/payments/payments.controller.ts - Payment endpoints → Payment processing: delegates payment
src/payments/payments.controller.ts - API client → Ticket services: requests tickets
- API client → Notification endpoints: requests email test
src/notifications/notifications.controller.ts - Notification endpoints → Email notifications: dispatches email
src/notifications/notifications.controller.ts - Email notifications → Email templates: renders templates
src/notifications/notifications.service.ts - Email notifications → Brevo email: sends email
src/notifications/notifications.service.ts - API client → Chatbot: uses chatbot
- API client → Metrics: requests metrics