# huanglinbao/thriftstore architecture

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

- Interactive diagram: https://gitdiagram.com/huanglinbao/thriftstore
- Repository: https://github.com/huanglinbao/thriftstore

## Overview

##### Project type and purpose
- This is a full-stack web application called “Thrift Store,” a local e-commerce marketplace.
- Frontend: React SPA in the FrontEnd/ directory.
- Backend/API: Node.js + Express in the ThriftStoreApi/ directory.
- Database & storage: SupaBase (PostgreSQL-compatible DB, auth, file storage).
- CI/CD: Azure DevOps (mentioned in README).

##### File structure
- Top-level folders:
- FrontEnd/ – React code, public assets, components, styles.
- ThriftStoreApi/ – Express controllers, database connection, server entrypoints.
- ArchetictureDesign/ – existing architecture notes (can be referenced).
- Backend follows an MVC-style pattern: controllers folder, databaseConnection.js, server.js.
- No nested microservices—just one monolithic API.
- Configuration/build: package.json in both FrontEnd and ThriftStoreApi, plus lint/prettier files at root.

##### README
- Confirms tech stack: React JS, NodeJS + Express, SupaBase, Azure DevOps.
- Describes three user roles (guest, customer, admin) but no separate services per role.

##### Elements
- Browser → FrontEnd (initial load & subsequent API calls)
- FrontEnd → Express API (HTTP requests)
- Express API → SupaBase (DB & storage operations)
- Azure DevOps → FrontEnd / Express API (CI/CD deployments)
- Green for backend services,
- Orange for external services (SupaBase, Azure DevOps).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Side"
        direction TB
        Browser["User Browser"]:::ui
        HTML["Index HTML (public/index.html)"]:::ui
        Entry["Entry Script (src/index.js)"]:::ui
        App["Root Component (src/App.jsx)"]:::ui
        Components["UI Components\n(src/components/)"]:::ui
        Styles["Styles (src/style/)"]:::ui
    end

    subgraph "Server Side"
        direction TB
        Init["App Init (ThriftStoreApi/index.js)"]:::backend
        Server["Server Entry (server.js)"]:::backend
        subgraph "Controllers"
            direction TB
            SignIn["SignIn Controller"]:::backend
            SignUp["SignUp Controller"]:::backend
            Person["Person Controller"]:::backend
            Category["Category Controller"]:::backend
            Product["Product Controller"]:::backend
            Post["Post Controller"]:::backend
        end
        DBConn["DB & Storage Conn\n(databaseConnection.js)"]:::backend
    end

    subgraph "External Services"
        direction TB
        SupaBase["SupaBase\n(DB, Auth, Storage)"]:::external
        Azure["Azure DevOps\nCI/CD Pipeline"]:::external
    end

    Browser -->|"Load index.html"| HTML
    HTML -->|"Load script"| Entry
    Entry -->|"Render App"| App
    App -->|"Uses"| Components
    App -->|"Uses"| Styles
    App -->|"REST API Calls"| Init
    Init -->|"Initialize Express"| Server
    Server -->|"Route requests to"| SignIn
    Server -->|"Route requests to"| SignUp
    Server -->|"Route requests to"| Person
    Server -->|"Route requests to"| Category
    Server -->|"Route requests to"| Product
    Server -->|"Route requests to"| Post
    SignIn -->|"CRUD/Auth"| DBConn
    SignUp -->|"CRUD/Auth"| DBConn
    Person -->|"CRUD"| DBConn
    Category -->|"CRUD"| DBConn
    Product -->|"CRUD"| DBConn
    Post -->|"CRUD & Storage"| DBConn
    DBConn -->|"Queries & Storage Ops"| SupaBase
    Azure -->|"Build & Deploy Frontend"| HTML
    Azure -->|"Build & Deploy Backend"| Server

    click HTML "https://github.com/huanglinbao/thriftstore/blob/master/FrontEnd/public/index.html"
    click Entry "https://github.com/huanglinbao/thriftstore/blob/master/FrontEnd/src/index.js"
    click App "https://github.com/huanglinbao/thriftstore/blob/master/FrontEnd/src/App.jsx"
    click Components "https://github.com/huanglinbao/thriftstore/tree/master/FrontEnd/src/components/"
    click Styles "https://github.com/huanglinbao/thriftstore/tree/master/FrontEnd/src/style/"
    click Browser "https://github.com/huanglinbao/thriftstore/tree/master/FrontEnd/"
    click Init "https://github.com/huanglinbao/thriftstore/blob/master/ThriftStoreApi/index.js"
    click Server "https://github.com/huanglinbao/thriftstore/blob/master/ThriftStoreApi/server.js"
    click SignIn "https://github.com/huanglinbao/thriftstore/blob/master/ThriftStoreApi/Controller/SignIn.js"
    click SignUp "https://github.com/huanglinbao/thriftstore/blob/master/ThriftStoreApi/Controller/SignUp.js"
    click Person "https://github.com/huanglinbao/thriftstore/blob/master/ThriftStoreApi/Controller/Person.js"
    click Category "https://github.com/huanglinbao/thriftstore/blob/master/ThriftStoreApi/Controller/category.js"
    click Product "https://github.com/huanglinbao/thriftstore/blob/master/ThriftStoreApi/Controller/product.js"
    click Post "https://github.com/huanglinbao/thriftstore/blob/master/ThriftStoreApi/Controller/post.js"
    click DBConn "https://github.com/huanglinbao/thriftstore/blob/master/ThriftStoreApi/databaseConnection.js"
    click README "https://github.com/huanglinbao/thriftstore/blob/master/README.md"
    click FEpkg "https://github.com/huanglinbao/thriftstore/blob/master/FrontEnd/package.json"
    click BEpkg "https://github.com/huanglinbao/thriftstore/blob/master/ThriftStoreApi/package.json"
    click Lint "https://github.com/huanglinbao/thriftstore/blob/master/.eslintrc.js"
    click Prettier "https://github.com/huanglinbao/thriftstore/blob/master/.prettierrc.js"

    classDef ui fill:#D0E6FF,stroke:#0366d6,stroke-width:1px;
    classDef backend fill:#e2f0d9,stroke:#228B22,stroke-width:1px;
    classDef external fill:#FFE5B4,stroke:#FF8C00,stroke-width:1px;
```
