How saeedhei/team-olha-lazyniuk works
Main components
• Frontend: Built with React and bundled with Vite, it’s housed in the “frontend” directory with its own Dockerfile. This component handles the user interface and interactions.
• Backend: Located in the “backend” folder, it is an Express.js server implemented in TypeScript. The backend organizes its logic using domain-based folders (e.g., “cities” and “users”), configuration files for various environments, and dedicated subdirectories for controllers, models, repositories, validators, and services.
• MongoDB: Although not a distinct application artifact, the “mongodb” folder contains the initialization script (init-mongo.js) used during containerized deployment, and MongoDB runs on port 27017.
• Infrastructure/Containers: Docker Compose (docker-compose.yml) orchestrates the services, ensuring the frontend, backend, and MongoDB are containerized and interconnected.
• Additional Tools: There are testing directories (unit and integration tests) and utility scripts, but for a high-level architecture, focus on the main runtime components.
Understand the relationships and interactions
• The Backend, using Express.js, serves the GraphQL API. Within the backend, logically separate layers (controllers, services, repositories) interact to process requests.
• The Backend establishes a communication link with MongoDB for persisting and querying data.
• Docker is used to containerize each of these layers (frontend, backend, and MongoDB) using individually defined Dockerfiles and orchestrated by docker-compose.
Architectural patterns and design principles
• Separation of Concerns: The project is clearly divided into frontend and backend with distinct domain-specific modules in the backend.
• Containerization: Emphasize how Docker and Docker Compose manage service isolation and deployment consistency.
• Domain-Driven Design: The structure under “backend/src/domain” indicates a domain-centric approach (with separate folders for “cities” and “users”).
• Type Safety and Scalability: The use of TypeScript ensures type-safe code across the stack.
• API Design with GraphQL: Illustrate the role of GraphQL in flexible data fetching between the client and backend, even if it isn’t explicitly divided into its own module, it is central to API interaction.
Relevant technologies and frameworks
• Frontend: React, Vite, TypeScript.
• Backend: Express.js, TypeScript, GraphQL (and possible related middleware).
• Database: MongoDB.
• Containerization: Docker with individual Dockerfiles and docker-compose configuration.
• Testing: Use of Jest for unit/integration tests (found in the “backend/tests” folder).