# lohit20/ecommerce-microservices architecture

> Architecture diagram of the GitHub repository lohit20/ecommerce-microservices, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lohit20/ecommerce-microservices
- Repository: https://github.com/lohit20/ecommerce-microservices

## Overview

##### Project type and purpose
- This is an e-commerce application built as a set of independent microservices.
- Each microservice has its own Dockerfile, dependencies, and isolates one business capability: authentication (ecommerce-auth), product catalog (products), shopping cart (cart), and recommendations/search (recommendation_and_search_system).
- A docker-compose.yml ties them together into one functional system.

##### File structure
- Top-level services:
– cart/
– ecommerce-auth/
– products/
– recommendation_and_search_system/
- Common pattern inside each service:
– Dockerfile — container build
– requirements.txt — Python dependencies
– main.py — entrypoint, HTTP server
– models.py — domain models
– JSON data file (in cart and products) for sample data or simple persistence
- One cross-service orchestration file: docker-compose.yml

##### README for additional insights
- README simply names the project “Ecommerce-Microservices.”

## Diagram (Mermaid)

```mermaid
flowchart TB
    Client["External Client<br/>(Web/Mobile)"]:::external
    Client -->|login| EAuth
    Client -->|get products| Prod
    Client -->|manage cart| Cart
    Client -->|get recommendations/search| Rec

    subgraph "Docker Compose Network"
        direction TB
        DC["docker-compose.yml"]:::orchestration

        EAuth["Auth Service<br/>ecommerce-auth"]:::service
        Prod["Products Service<br/>products"]:::service
        Cart["Cart Service<br/>cart"]:::service
        Rec["Recommendation & Search Service<br/>recommendation_and_search_system"]:::service

        EAuthDS(("Auth Config & DB<br/>(.env/config)")):::datastore
        ProdDS(("products.json")):::datastore
        CartDS(("file.json")):::datastore
        RecDS(("Recommendation Models")):::datastore

        EAuth --> EAuthDS
        Prod --> ProdDS
        Cart --> CartDS
        Rec --> RecDS

        Cart -.->|"validate user"| EAuth
    end

    click EAuth "https://github.com/lohit20/ecommerce-microservices/tree/master/ecommerce-auth/"
    click Prod "https://github.com/lohit20/ecommerce-microservices/tree/master/products/"
    click Cart "https://github.com/lohit20/ecommerce-microservices/tree/master/cart/"
    click Rec "https://github.com/lohit20/ecommerce-microservices/tree/master/recommendation_and_search_system/"
    click DC "https://github.com/lohit20/ecommerce-microservices/blob/master/docker-compose.yml"

    classDef external fill:#f96,stroke:#333,stroke-width:1px;
    classDef service fill:#bbf,stroke:#333,stroke-width:1px;
    classDef datastore fill:#bfb,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5;
    classDef orchestration fill:#eee,stroke:#999,stroke-width:2px,stroke-dasharray: 4 4;
```
