How chily671/eco-web-microservice works
Main Components
• Front-End Client: Found in the “Front-end-e-co” directory; this is your user interface built likely with React (given the structure with JSX files and assets).
• API Gateway / Proxy: Look at the “gateway” and “proxy” directories. The gateway likely acts as a central entry point to route client requests to the appropriate microservices.
• Microservices: There are multiple backend services, each in its own directory:
• Chat-Service (with the README indicating it runs on PORT 5008)
• Order-service
• Pay-service
• Products-service
• Rating-service
• Users-Service
• Recommender-System-Service (Python-based recommender algorithms)
• Search-image-for-web (for image-based search functionality)
• Infrastructure and Orchestration: Notice the “.github/workflows” for CI/CD pipelines, “docker-compose.yml” files in several services, Kubernetes configuration files in “k8s” and Helm charts in “ecommerce-chart.” These files indicate deployment orchestration.
• Supporting Tools: There is a “Tool” directory that holds scripts and data (like CSVs) possibly used for batch processing or additional utility functions.
Relationships and Interactions
• The front-end communicates with the API Gateway/Proxy, which then routes requests to the appropriate backend service.
• Each microservice (chat, orders, payment, products, users, ratings) is self-contained, typically with its own database configuration (evidenced by separate “database” or “Database-<service>” folders, models, and repository patterns) and service layers.
• The gateway/proxy (often using Nginx, suggested by configuration files such as “nginx.conf”), handles inbound web requests and may also manage load balancing or request routing.
• Inter-service communication may happen through REST APIs (as seen in the “api” folders); also, some event-based or messaging patterns could be implemented (for instance, “app-events.js” files in several services).
Architectural Patterns & Design Principles
• Microservices Architecture: Each service is an independent, containerized component (with its own Dockerfile, deployment configurations).
• Separation of Concerns: Services are separated by business capability (chat, order, payment, product, etc.) and each encapsulates its own “database,” “api,” and “services” layers.
• Containerization & Orchestration: Dockerfiles and docker-compose files per service, along with Kubernetes (“k8s”) and Helm charts (“ecommerce-chart”), indicate a design geared toward portability and scalability.
• CI/CD Pipelines: The GitHub workflows in “.github/workflows” represent the automated build, test, and deploy processes.
Technologies, Frameworks, and Libraries
• Backend: Node.js & Express (multiple “index.js” and “express-app.js” files within services)
• Frontend: Likely React (evident from .jsx files and the typical React project structure)
• Database: Likely usage of relational or NoSQL databases (each service has its “connection.js” and “models” directories)
• Containerization: Docker (Dockerfiles and docker-compose usage)
• Orchestration: Kubernetes configurations and Helm charts
• Others: GitHub Actions for CI/CD pipelines, Nginx (proxy configuration), and Python for recommendation and image search services