# siddanth-6365/vercellite architecture

> Architecture diagram of the GitHub repository siddanth-6365/vercellite, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/siddanth-6365/vercellite
- Repository: https://github.com/siddanth-6365/vercellite

## Overview

##### Project type and purpose
- This is a full-stack “serverless” deployment platform prototype (“VercelLite”) with four main services:
- A Next.js frontend (UI)
- A Node.js/Express backend API server
- A build worker service (“build-servers”) that runs Docker builds
- A reverse-proxy service for custom domain routing
- Its goal is to let users submit a Git URL, build inside Docker/ECS, store artifacts in S3, and serve them via custom domains, with real-time build logs over WebSockets.

##### File structure
- Top-level directories:
- ui/ → Next.js frontend (app/, components/, hooks/, etc.)
- node-api-server/ → Express API, Prisma for Postgres, ECS/Redis/SOCKET integration
- build-servers/ → Shell scripts, Node.js scripts to clone, build, push to ECR/S3
- reverse-proxy-s3/ → Small Node.js reverse-proxy that maps custom domains to S3 buckets
- Configuration and infra:
- Dockerfile in build-servers/
- main.sh and script.js orchestrate the build container
- Prisma schema and migrations under node-api-server/prisma
- Separately defined package.json in each service
- Patterns:
- Microservices (each directory is an independent deployable)
- Event-driven build logs via Redis Pub/Sub
- Real-time client updates via Socket.IO
- Separation of concerns: UI ↔ API ↔ Builder ↔ Proxy

##### Extract key points from README
- Workflow: submit URL → build in Docker/ECS → store artifacts in S3 → map custom domain → stream logs via Redis + Socket.IO
- Tech stack calls out AWS S3, ECS/ECR, Redis, Socket.IO
- Prototype status: no advanced scaling/auth yet

##### Final advice
- Data flows end-to-end: from user action to artifact delivery
- Both control flows (API triggers) and data flows (logs, artifacts)
- Avoid clutter: group related sub-components (e.g., Prisma + Postgres) inside a single “Database” boundary
- Review the file tree to ensure no component is missed (e.g., reverse-proxy-s3, build-servers scripts)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend (Next.js)" 
        direction TB
        Browser["Client Browser"]:::frontend
        NextUI["Next.js Frontend"]:::frontend
        Pages["Pages/Layouts"]:::frontend
        Components["Components"]:::frontend
        Hooks["Hooks"]:::frontend
        Config["Config & Assets"]:::frontend
    end

    %% API Layer
    subgraph "API (Express + Prisma)" 
        direction TB
        API["Express API Server"]:::api
        Routes["API Routes"]:::api
        Controllers["API Controllers"]:::api
        ECSService["ECS Build Trigger Service"]:::api
        RedisSub["Redis Pub/Sub Subscriber"]:::api
        SocketIO["Socket.IO Server Integration"]:::api
        DB["Postgres Database"]:::infra
        Schema["Prisma Schema"]:::api
        Migrations["Prisma Migrations"]:::api
    end

    %% Worker Layer
    subgraph "Build Worker (ECS Task)" 
        direction TB
        WorkerDocker["Dockerfile"]:::worker
        MainScript["main.sh"]:::worker
        BuildScript["script.js"]:::worker
        WorkerPkg["package.json"]:::worker
        ECR["AWS ECR"]:::infra
        S3Store["AWS S3 (Artifacts)"]:::infra
        RedisChan["Redis Pub/Sub"]:::infra
    end

    %% Proxy Layer
    subgraph "Reverse Proxy Service" 
        direction TB
        ReverseProxy["Reverse-Proxy Service"]:::infra
        ProxyPkg["package.json"]:::infra
    end

    %% Infrastructure
    subgraph "AWS & Infra" 
        direction TB
        ECS["AWS ECS (Build Tasks)"]:::infra
        Route53["Route 53 (DNS)"]:::infra
        S3Host["AWS S3 (Static Hosting)"]:::infra
    end

    %% Connections
    Browser -->|"HTTP/REST"| NextUI
    NextUI -->|"HTTP/REST"| API
    API -->|"AWS SDK/ECS"| ECS
    ECS -->|"runs task in"| WorkerDocker
    WorkerDocker -->|"build scripts"| MainScript
    MainScript -->|"executes"| BuildScript
    BuildScript -->|"push image"| ECR
    BuildScript -->|"upload artifacts"| S3Store
    BuildScript -.-|"publish logs"| RedisChan
    RedisChan -.-|"subscribe"| RedisSub
    RedisSub -->|"emit logs"| SocketIO
    SocketIO ~~~|"WebSocket"| NextUI
    API -->|"read/write"| DB
    API -->|"uses schema"| Schema
    API -->|"applies migrations"| Migrations
    API -->|"trigger build"| ECSService
    Browser -->|"WebSocket"| SocketIO

    Route53 -->|"DNS lookup"| ReverseProxy
    ReverseProxy -->|"HTTP proxy"| S3Host

    %% Click Events
    click NextUI "https://github.com/siddanth-6365/vercellite/tree/main/ui/"
    click Pages "https://github.com/siddanth-6365/vercellite/tree/main/ui/app/"
    click Components "https://github.com/siddanth-6365/vercellite/tree/main/ui/components/"
    click Hooks "https://github.com/siddanth-6365/vercellite/tree/main/ui/hooks/"
    click Config "https://github.com/siddanth-6365/vercellite/blob/main/ui/next.config.mjs"
    click API "https://github.com/siddanth-6365/vercellite/blob/main/node-api-server/src/app.js"
    click Routes "https://github.com/siddanth-6365/vercellite/tree/main/node-api-server/src/routes/"
    click Controllers "https://github.com/siddanth-6365/vercellite/tree/main/node-api-server/src/controllers/"
    click Schema "https://github.com/siddanth-6365/vercellite/blob/main/node-api-server/prisma/schema.prisma"
    click Migrations "https://github.com/siddanth-6365/vercellite/tree/main/node-api-server/prisma/migrations/"
    click ECSService "https://github.com/siddanth-6365/vercellite/blob/main/node-api-server/src/services/ecs.js"
    click RedisSub "https://github.com/siddanth-6365/vercellite/blob/main/node-api-server/src/services/redisSubscriber.js"
    click SocketIO "https://github.com/siddanth-6365/vercellite/blob/main/node-api-server/src/socket.js"
    click WorkerDocker "https://github.com/siddanth-6365/vercellite/tree/main/build-servers/Dockerfile"
    click MainScript "https://github.com/siddanth-6365/vercellite/blob/main/build-servers/main.sh"
    click BuildScript "https://github.com/siddanth-6365/vercellite/blob/main/build-servers/script.js"
    click WorkerPkg "https://github.com/siddanth-6365/vercellite/blob/main/build-servers/package.json"
    click ReverseProxy "https://github.com/siddanth-6365/vercellite/blob/main/reverse-proxy-s3/index.js"
    click ProxyPkg "https://github.com/siddanth-6365/vercellite/blob/main/reverse-proxy-s3/package.json"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#084B8A,color:#000
    classDef api fill:#D0F0D6,stroke:#0A5728,color:#000
    classDef worker fill:#FFE2B3,stroke:#A65E00,color:#000
    classDef infra fill:#E0E0E0,stroke:#777,color:#000
```
