How aymanamkassou/distributed-systems-project works
Project Type and Purpose
• The project is a dockerized full-stack application consisting of three primary services. Two of the services (Frontend Service and Gallery Service) are built with Next.js to provide responsive user interfaces, while the Image Service is a Node.js/Express backend that interacts with the Unsplash API and MongoDB.
• The purpose of the project is to fetch and display images from Unsplash: the Frontend Service presents images acquired via the Image Service and the Gallery Service displays and syncs images stored in MongoDB.
File Structure and Key Architectural Insights
• The top-level file structure shows:
• A single .env file and docker-compose.yml in the root, indicating that Docker Compose is used to orchestrate the microservices.
• Three primary directories for services: "frontend", "gallery-service", and "image-service".
• Inside each service folder:
• Frontend: Contains Next.js specific files, API routes, components, and configurations.
• Gallery Service: Similar to Frontend in structure but includes components like SyncButton, and services like imageService indicating actions to trigger fetching/syncing of images.
• Image Service: Uses Node.js/Express with a “src” folder organizing configuration, models, routes, and services for handling communication with Unsplash API and MongoDB.
• The README confirms the role and port assignments for each service:
• Frontend on port 3000,
• Image Service on port 3001,
• Gallery Service on port 3002.
Elements to be Included
• Each component must be clearly labeled:
• “Frontend Service (Next.js) – Port 3000”
• “Gallery Service (Next.js) – Port 3002”
• “Image Service (Node.js/Express) – Port 3001”
• “MongoDB Database”
• “Unsplash API”
• “Docker Compose” as a container manager.
• From Frontend Service → Image Service (indicating API calls to fetch images).
• From Gallery Service → Image Service and/or MongoDB (for image syncing and retrieval).
• From Image Service → Unsplash API (data fetching process).
• From Image Service → MongoDB (CRUD operations for image storage).
• Incorporate annotations:
• Port assignments and any critical operations (e.g., “Sync images”, “Fetch from Unsplash”).