How scvapp/scvappbackend works
Project type and purpose
• This is a monolithic, full-stack backend service built on NestJS (TypeScript) that manages lockers, door access passes, notifications, authentication, and administrative functions for a school or facility.
• Key use cases include: user authentication/authorization, opening/locking lockers, creating door passes, logging door events, real-time updates via WebSockets, and sending notifications to registered devices.
File structure
• src/ contains domain modules:
• auth (login, JWT, guards)
• user (profile, schedules)
• admin (school/class configuration)
• lockers (locker entities, controllers, WebSocket gateway)
• pass (door pass entities, pass gateway, logging)
• notification (API-key middleware, device registry, sending pushes)
• search (search across entities)
• token (token DTOs/service for refresh/verification)
• config/ and .env.example hold environment settings and deploy.yml for CI/CD.
• SCVApp/ holds Bruno runtime scripts or use-case specifications.
• db_migrations/ contains SQL for stored procedures.
• test/ holds unit and e2e tests.
• Dockerfile, .kamal hooks, and nest-cli.json point to containerized deployment and Nest CLI usage.
README for additional insights
• Confirms use of NestJS modules, TypeScript, and standard Nest application structure.
Recommendations
• Be exhaustive: include all eight modules plus config/CI artifacts.
• Data flow in two scenarios: synchronous HTTP calls (e.g., openLocker) and asynchronous real-time events (socket push).
• Use layering: Presentation (Clients), Application (Controllers + Gateways), Domain (Services + Entities), Infrastructure (Database, External APIs), Deployment.