How thesobersobber/orvio-backend works
Project Type & Purpose
• It’s a NestJS-based server-side application that employs a microservices architecture.
• The project hosts several “apps” (or services) – each representing a distinct domain (e.g., authentication, backend API, FCM, FCM token, OTP, and a service component).
• There is also a “shared” area for common entities and utility wrappers used by these services, suggesting reuse of data models (like API keys, devices, sessions, and users).
Main Components
a. Individual Microservices:
– Auth Service (apps/auth): Handles authentication logic.
– Backend Service (apps/backend): Provides main business APIs with controllers (including dedicated controllers for auth, root operations, and service endpoints).
– FCM Service (apps/fcm): Likely manages Firebase Cloud Messaging-related operations.
– FCM Token Service (apps/fcmToken): Deals with token management probably related to push notifications.
– OTP Service (apps/otp): Implements one-time password functions.
– Service Component (apps/service): Manages some business service-related operations.
b. Shared Module:
– The “apps/shared” directory holds common entities and the RPC wrapper, used for shared data models and communication logic across microservices.
c. Containerization/Docker:
– Each service directory contains its own Dockerfile. Include a node for Docker deployment and container orchestration.
– There’s a docker-compose.yml at the project root suggesting that services are meant to be deployed as separate containers.
d. Testing and Configurations:
– Each service includes its own test suites and configuration files (e.g., tsconfig.app.json, jest-e2e configs) to emphasize a unit/e2e testing approach.
– This indicates a robust development process and modular deployment.
Relationships & Data Flow
– The Auth Service may communicate with the Backend Service to validate authentication requests.
– The OTP service might trigger events to the Auth service during multi-factor authentication.
– FCM and FCM Token services are likely interrelated for managing notifications, with potential callbacks to the Backend for status or logging.
• Additionally, container orchestration (reflecting docker-compose) may be shown at a higher level to denote service deployments and network connectivity.
Architectural Patterns and Technologies
• Modularity inherent in the NestJS framework (with separate modules for controllers, services, and guards).
• Microservices pattern – each service being an independent deployable unit.
• Usage of technologies:
– TypeScript for code robustness.
– NestJS for structured modularity.
– Docker for containerization.
– Testing frameworks (Jest e2e, unit test files) to ensure quality.
• If applicable, show potential API gateway or inter-service messaging (hinted by shared rpcWrapper).
– Start with a high-level layer indicating “Deployment/Containers” showing each service’s Docker container.
– Include annotations for the testing frameworks and orchestration layers (e.g., separate testing nodes with e2e tests).