# ebrahimhossaincse/store-management-system-mock-server architecture

> Architecture diagram of the GitHub repository ebrahimhossaincse/store-management-system-mock-server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ebrahimhossaincse/store-management-system-mock-server
- Repository: https://github.com/ebrahimhossaincse/store-management-system-mock-server

## Overview

##### Main Components

a) Frontend Layer:
- HTML pages as client-side components:
- home.html (Dashboard)
- product.html (Product Management)
- category.html (Category Management)
- customers.html (Customer Management)
- orders.html (Order Management)

b) Backend Layer:
- Mock Server (index.js)
- Data Storage (db.json)

##### Architecture Style

a) Top Level (Client Tier):
- Individual HTML pages as components within this container

b) Middle Level (Server Tier):
- RESTful endpoints that handle different operations

c) Bottom Level (Data Tier):
- Db.json as the data storage layer
- Connection between the mock server and the data storage

##### Component Relationships

- HTTP requests from HTML pages to the mock server
- Data flow between the mock server and db.json

**┌─────────────────────────────────────────┐**
- Frontend Layer               │
- ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐│
- Home │ │Prod.│ │Cat. │ │Cust.│ │Order││
- ┘ └─────┘ └─────┘ └─────┘ └─────┘│
- ┘
- ↕ HTTP/REST
**┌─────────────────────────────────────────┐**
- Mock Server (index.js)          │
- ┘
- ↕ File I/O
**┌─────────────────────────────────────────┐**
- Data Storage (db.json)          │
- ┘

##### Additional Elements

- Component types

##### Technical Details
- HTTP methods (GET, POST, PUT, DELETE)
- Data format (JSON)
- Key endpoints for each module
- Static asset handling (images folder)

##### Notes
- A title: "Store Management System Architecture"
- A version number
- A brief description of the mock server's role
- Technical constraints or limitations

Remember to:
- Use consistent styling throughout
- Related components together
- Clear boundaries between different layers
- Major interaction paths
- Document any assumptions made

## Diagram (Mermaid)

```mermaid
graph TB
    %% Title and Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef server fill:#2ecc71,stroke:#27ae60,color:white
    classDef storage fill:#f1c40f,stroke:#f39c12,color:black
    classDef api fill:#e74c3c,stroke:#c0392b,color:white

    %% Frontend Layer
    subgraph Frontend
        Home["Home Dashboard"]:::frontend
        Products["Product Management"]:::frontend
        Categories["Category Management"]:::frontend
        Customers["Customer Management"]:::frontend
        Orders["Order Management"]:::frontend
        Assets["Static Assets"]:::frontend
    end

    %% Server Layer
    subgraph Server
        MockServer["Mock Server"]:::server
    end

    %% Data Layer
    subgraph Storage
        DB["Data Storage (JSON)"]:::storage
    end

    %% Relationships
    Home --> |HTTP/REST| MockServer
    Products --> |HTTP/REST| MockServer
    Categories --> |HTTP/REST| MockServer
    Customers --> |HTTP/REST| MockServer
    Orders --> |HTTP/REST| MockServer
    MockServer --> |File I/O| DB

    %% Legend
    subgraph Legend
        FE["Frontend Component"]:::frontend
        SE["Server Component"]:::server
        ST["Storage Component"]:::storage
        API["API Endpoint"]:::api
    end

    %% Click Events
    click Home "https://github.com/ebrahimhossaincse/Store-Management-System-Mock-Server/blob/main/home.html"
    click Products "https://github.com/ebrahimhossaincse/Store-Management-System-Mock-Server/blob/main/product.html"
    click Categories "https://github.com/ebrahimhossaincse/Store-Management-System-Mock-Server/blob/main/category.html"
    click Customers "https://github.com/ebrahimhossaincse/Store-Management-System-Mock-Server/blob/main/customers.html"
    click Orders "https://github.com/ebrahimhossaincse/Store-Management-System-Mock-Server/blob/main/orders.html"
    click MockServer "https://github.com/ebrahimhossaincse/Store-Management-System-Mock-Server/blob/main/index.js"
    click DB "https://github.com/ebrahimhossaincse/Store-Management-System-Mock-Server/blob/main/db.json"
    click Assets "https://github.com/ebrahimhossaincse/Store-Management-System-Mock-Server/tree/main/images/"
```
