How divi-1910/codellosium works
Project Type and Purpose
• This project is a full-stack, microservices-based application organized as a monorepo (using Turbo via turbo.json) that includes multiple backend services, a frontend client, shared packages, and database models.
• The application is composed of an API Gateway, several domain-specific services (auth, notification, problem, submission, worker), and a client interface, each built likely in Node.js, with containerization using Docker and configuration files for orchestration.
Analyzing the File Structure
• Top-Level Directories:
• apps: Holds all microservices and the frontend client.
▪ api-gateway: Likely serves as a reverse proxy routing client requests to appropriate backend services.
▪ auth-service: Manages authentication/authorization.
▪ notification-service: Handles sending notifications (also includes websockets for real-time communication).
▪ problem-service: Manages problem related functions (possibly coding problems/challenges).
▪ submission-service: Processes submissions with additional queues and middleware.
▪ worker-service: Executes tasks asynchronously (including code execution, Docker management, and job processing).
▪ client: The frontend files using components, hooks, and a state store for user interactions.
• packages: Contains shared code such as database models (Problem, Submission, User), linting and TypeScript configuration, and a UI package.
• There are additional configuration files (docker-compose.yml, container.json, spec.yaml) for deployment orchestration.
• Architectural Patterns Indicated:
• Microservices Architecture: Each service is isolated within its own directory with independent controllers, routes, middleware, and configuration.
• API Gateway Pattern: Separating client-facing APIs (api-gateway) from backend service logic.
• Containerization: Dockerfiles for multiple services and a docker-compose file indicate container orchestration.
• Shared Libraries/Packages: The “packages” directory shows usage of common modules across services (e.g., database models, eslint, TypeScript, UI components).
• Align the backend microservices (Auth, Notification, Problem, Submission, Worker) in a row or grid, indicating their individual roles.
• Microservice to the central Database component.
• Annotations or notes about middleware components (such as rate-limiters, authentication middleware) at the API gateway and within services as necessary.