How nguyenchithannh/loopme-apis works
Project Type and Purpose
• LoopMe-apis is a social networking backend platform built with a microservices architecture. Each core capability (authentication, chat, comments, friend management, groups, notifications, posts, post votes, realtime features) has its own service.
• The README and file tree clearly indicate that this is a containerized, Kubernetes-deployed, full-stack backend system that serves as the API layer for a social platform.
File Structure
• The “app” directory contains separate folders for each microservice (auth-service, chat-service, comment-service, friend-service, group-service, notification-service, post-service, post-vote-service, realtime-service, and gateway-api). Each service has its own configuration files, Dockerfiles, build scripts, and TypeScript source code (organized in directories like src/controllers, src/routes, and src/services).
• There’s also a “common” directory that contains shared modules (such as configuration, utilities, middlewares, models, error handling, and mail functionalities), which hints at a centralized reusable library across services.
• Command scripts in the “cmd” folder support tasks like image pushing, local run, and Kubernetes deployments.
README for Additional Insights
• The README confirms the microservices layout by listing individual services with their assigned ports and describes the role of the API Gateway as the single entry point that manages routing, rate limiting, and WebSocket proxy capabilities.
• It also lists the technologies used (TypeScript, Express, Node.js, MongoDB, RabbitMQ, Redis, etc.), which should be depicted where relevant.
• The provided images and deployment results (dashboard, pods, services, ingress, etc.) are evidence that the design is deployed on Kubernetes and uses Docker for containerization.
a. Main Components:
• API Gateway (Gateway Service): Represent this as the front-door or entry point for all external client requests. Include the designated port (8000) and its functions (reverse proxy, rate limiting, WebSocket proxy).
• Auth Service (Port 8001)
• Chat Service (Port 8002)
• Comment Service (Port 8003)
• Friend Service (Port 8004)
• Service (Port 8005)
• Notification Service (Port 8006)
• Post Service (Port 8007)
• Post Vote Service (Port 8008)
• Realtime Service (Port 8009)
• Shared/Common Module: Represent the common library (inside the “common” directory) that supplies configurations, models, error handling, and utilities across services.
• External Dependencies: Indicate the external systems such as MongoDB (NoSQL database for persistent storage), RabbitMQ (for asynchronous communication/message broker), and Redis (for caching and session management).
b. Relationships and Interactions:
• That each service communicates with MongoDB (and possibly uses Mongoose for ODM) for data storage.
• Intra-service dependencies (like how the Post Service might interact with the Comment or Vote Service through shared business logic or asynchronous events).
c. Architectural Patterns and Design Principles:
• Microservices architecture where each service is independently deployed (as seen in the individual Dockerfiles and Kubernetes YAML configurations).
• Separation of concerns (controllers, services, validations) within individual services as an adherence to standard RESTful API practices.
• That the API Gateway is a central pattern for routing requests, rate limiting, and handling WebSocket connections.
d. Relevant Technologies: