Skip to content

Repository files navigation

Project Overview

This application is a high-throughput backend system designed to simulate real-world e-commerce analytics platforms. It serves as a centralized engine for bulk inventory ingestion (CSV) and real-time marketing analytics (URL shortener and click tracking).

Unlike typical CRUD apps, this project focuses on architectural resilience. It is engineered to handle massive file uploads and concurrent traffic spikes without crashing, utilizing streams, connection pooling, and a stateless architecture.

graph TD
    %% Actors
    User([User / Client])
    Admin([Admin])

    %% Main Application Container
    subgraph "Docker Container: Node.js App"
        style API fill:#e1f5fe,stroke:#01579b
        
        Middleware["Middleware Layer<br/>(Auth, Rate Limit, Helmet)"]
        
        subgraph "Controller Layer"
            AuthCtrl[Auth Controller]
            ItemCtrl[Item Controller]            
        end

        subgraph "Service Layer (Business Logic)"
            AuthSvc[Auth Service]
            ItemSvc["Item Service<br/>(CSV Stream Processor)"]
        end

        subgraph "Data Access Layer"
            DAO["Database Module<br/>(Connection Pool + Retry Logic)"]
        end
        
        Logger[Winston Logger]
    end

    %% Infrastructure
    subgraph "Docker Container: Database"
        style DB fill:#e8f5e9,stroke:#2e7d32
        DB[(PostgreSQL)]
    end

    FileSystem["File System<br/>(Logs & Temp Uploads)"]

    %% Relationships
    User -->|HTTP GET/POST| Middleware
    Admin -->|Upload CSV| Middleware

    Middleware --> AuthCtrl
    Middleware --> ItemCtrl
    Middleware --> UrlCtrl

    %% Controller -> Service
    AuthCtrl --> AuthSvc
    ItemCtrl --> ItemSvc
    UrlCtrl --> UrlSvc

    %% Service Logic
    AuthSvc -->|Generate JWT| AuthSvc
    ItemSvc -->|1. Stream File| ItemSvc
    ItemSvc -->|2. Batch Process| DAO
    UrlSvc -->|Check Cache/DB| DAO

    %% Database Interaction
    DAO <-->|Connection Pool| DB

    %% Logging
    Middleware -.->|Error/Info| Logger
    ItemSvc -.->|Log Batch Status| Logger
    Logger -.->|Write JSON| FileSystem
Loading

About

backend system designed to simulate real-world e-commerce analytics platforms

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages