# vuongnguyen333/trello-web architecture

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

- Interactive diagram: https://gitdiagram.com/vuongnguyen333/trello-web
- Repository: https://github.com/vuongnguyen333/trello-web

## Overview

##### Project type and purpose
- This is a full-stack Trello-style board application (a web front-end with a Node.js/MongoDB back-end).
- Users can create boards, drag & drop columns and cards, and perform CRUD operations via a REST API.

##### File structure
- Root files & config:
- package.json, package-lock.json, vite.config.js (build/config)
- .eslintrc.cjs, jsconfig.json (linting/IDE)
- Public assets: index.html, public/
- Front-end source (src/):
- main.jsx + App.jsx (entry point & root component)
- src/apis/ (API layer: request functions & mocks)
- src/redux/ (Redux store, slices & async requests)
- src/components/ (reusable UI components & menus)
- src/pages/ (page-level components, e.g., Auth, Boards)
- src/customHooks/ (React hooks)
- src/customLibraries/ (DndKitSensors for drag/drop)
- src/utils/ and theme.js (constants, formatters, styling)

##### README insights
- Front-end: React, Redux Toolkit, Vite
- Back-end (deployed separately): Node.js + MongoDB

##### Main components
a. Client (Browser) with React App
- Sub-components: UI Pages, Components, Custom Hooks, Redux Store
b. API Layer
- src/apis module (HTTP client, endpoints)
c. Back-end Service (Node.js/Express)
- Auth service
- Boards service (CRUD for columns/cards)
d. Database (MongoDB)
e. Optional: CDN or Static Asset Server (serving index.html and public/)

##### Relationships & data flows
- Browser → React UI → Redux actions → src/apis HTTP calls → Node.js API → MongoDB
- Response flows back: MongoDB → Node.js → Front-end → Redux store → UI updates
- Drag & drop events handled in UI (DndKitSensors) update state, then trigger API updates

##### Architectural patterns & design principles
- Separation of concerns:
- Presentation layer (React Components & Pages)
- State management (Redux Toolkit slices)
- API abstraction (src/apis)
- Persistence layer (MongoDB via Node/Express)
- Single-page application served over Vite dev server or static host

##### Technologies & frameworks
- Front-end: React, Redux Toolkit, Vite, DndKitSensors, CSS Modules (App.css)
- Back-end: Node.js, Express (implicit), Mongoose/MongoDB
- Misc: ESLint, jsconfig (path aliases)

##### Detail level
- Back-end’s major logical modules (authentication, board management)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Front-end Zone
    subgraph "Front-end"
        direction TB
        Browser["Browser"]:::external
        ReactApp["React App"]:::frontend
        Browser --> ReactApp

        subgraph "UI & Pages"
            direction TB
            App["App.jsx"]:::frontend
            Login["LoginPage.jsx"]:::frontend
            Register["Register.jsx"]:::frontend
            BoardsIndex["Boards/index.jsx"]:::frontend
            BoardDetail["Boards/_id.jsx"]:::frontend
            BoardBar["BoardBar.jsx"]:::frontend
            BoardContent["BoardContent.jsx"]:::frontend
            ListColumns["ListColumns.jsx"]:::frontend
            Column["Column.jsx"]:::frontend
            ListCards["ListCards.jsx"]:::frontend
            Card["Card.jsx"]:::frontend
            ReactApp --> App
            App --> Login
            App --> Register
            App --> BoardsIndex
            BoardsIndex --> BoardDetail
            BoardDetail --> BoardBar
            BoardDetail --> BoardContent
            BoardContent --> ListColumns
            ListColumns --> Column
            Column --> ListCards
            ListCards --> Card
        end

        subgraph "Components & State"
            direction TB
            AppBar["AppBar.jsx"]:::frontend
            ModeSelect["ModeSelect.jsx"]:::frontend
            ReduxStore["store.js"]:::state
            BoardSlice["boardSlice.js"]:::state
            ColumnSlice["listColumnSlice.js"]:::state
            CardSlice["listCardSlice.js"]:::state
            Hooks["customHooks/index.js"]:::state
            DndKit["DndKitSensors.js"]:::state
            Theme["theme.js"]:::utils
            Constants["constants.js"]:::utils
            Formatters["formatters.js"]:::utils
            Sorts["sorts.js"]:::utils

            App --> AppBar
            App --> ModeSelect
            App --> ReduxStore
            ReduxStore --> BoardSlice
            ReduxStore --> ColumnSlice
            ReduxStore --> CardSlice
            App --> Hooks
            App --> DndKit
            App --> Theme
            App --> Constants
            App --> Formatters
            App --> Sorts
        end

        subgraph "API Module"
            direction TB
            APIIndex["index.js"]:::api
            MockData["mock-data.js"]:::api
            ReduxStore --> APIIndex
            APIIndex --> MockData
        end
    end

    %% Static Assets
    subgraph "Static Assets"
        direction TB
        HTML["index.html"]:::static
        Public["public/"]:::static
        CSS1["index.css"]:::static
        CSS2["App.css"]:::static
        HTML --> ReactApp
        Public --> ReactApp
        CSS1 --> ReactApp
        CSS2 --> ReactApp
    end

    %% Back-end and Database
    subgraph "Back-end + DB"
        direction TB
        subgraph "Back-end Services"
            direction TB
            AuthService["Auth Service"]:::server
            BoardsService["Boards Service"]:::server
        end
        subgraph "Database"
            direction TB
            MongoDB["MongoDB"]:::db
        end
        APIIndex -->|"POST/GET/PUT/DELETE"| AuthService
        APIIndex -->|"POST/GET/PUT/DELETE"| BoardsService
        AuthService --> MongoDB
        BoardsService --> MongoDB
    end

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#006064,color:#00363a;
    classDef state fill:#E8F5E9,stroke:#1B5E20,color:#2E7D32;
    classDef api fill:#E3F2FD,stroke:#0D47A1,color:#1565C0;
    classDef server fill:#FFE0B2,stroke:#E65100,color:#BF360C;
    classDef db fill:#F3E5F5,stroke:#6A1B9A,color:#4A148C;
    classDef external fill:#CFD8DC,stroke:#37474F,color:#263238;
    classDef static fill:#ECEFF1,stroke:#455A64,color:#263238;
    classDef utils fill:#FFF3E0,stroke:#FF6F00,color:#E65100;

    %% Click Events
    click ReactApp "https://github.com/vuongnguyen333/trello-web/blob/master/src/main.jsx"
    click App "https://github.com/vuongnguyen333/trello-web/blob/master/src/App.jsx"
    click Login "https://github.com/vuongnguyen333/trello-web/blob/master/src/pages/Auth/LoginPage.jsx"
    click Register "https://github.com/vuongnguyen333/trello-web/blob/master/src/pages/Auth/Register.jsx"
    click BoardsIndex "https://github.com/vuongnguyen333/trello-web/blob/master/src/pages/Boards/index.jsx"
    click BoardDetail "https://github.com/vuongnguyen333/trello-web/blob/master/src/pages/Boards/_id.jsx"
    click BoardBar "https://github.com/vuongnguyen333/trello-web/blob/master/src/pages/Boards/BoardBar/BoardBar.jsx"
    click BoardContent "https://github.com/vuongnguyen333/trello-web/blob/master/src/pages/Boards/BoardContent/BoardContent.jsx"
    click ListColumns "https://github.com/vuongnguyen333/trello-web/blob/master/src/pages/Boards/BoardContent/ListColumns/ListColumns.jsx"
    click Column "https://github.com/vuongnguyen333/trello-web/blob/master/src/pages/Boards/BoardContent/ListColumns/Column/Column.jsx"
    click ListCards "https://github.com/vuongnguyen333/trello-web/blob/master/src/pages/Boards/BoardContent/ListColumns/Column/ListCards/ListCards.jsx"
    click Card "https://github.com/vuongnguyen333/trello-web/blob/master/src/pages/Boards/BoardContent/ListColumns/Column/ListCards/Card/Card.jsx"
    click AppBar "https://github.com/vuongnguyen333/trello-web/blob/master/src/components/AppBar/AppBar.jsx"
    click ModeSelect "https://github.com/vuongnguyen333/trello-web/blob/master/src/components/ModeSelect/ModeSelect.jsx"
    click ReduxStore "https://github.com/vuongnguyen333/trello-web/blob/master/src/redux/store.js"
    click BoardSlice "https://github.com/vuongnguyen333/trello-web/blob/master/src/redux/slice/boardSlice.js"
    click ColumnSlice "https://github.com/vuongnguyen333/trello-web/blob/master/src/redux/slice/listColumnSlice.js"
    click CardSlice "https://github.com/vuongnguyen333/trello-web/blob/master/src/redux/slice/listCardSlice.js"
    click APIIndex "https://github.com/vuongnguyen333/trello-web/blob/master/src/apis/index.js"
    click MockData "https://github.com/vuongnguyen333/trello-web/blob/master/src/apis/mock-data.js"
    click Hooks "https://github.com/vuongnguyen333/trello-web/blob/master/src/customHooks/index.js"
    click DndKit "https://github.com/vuongnguyen333/trello-web/blob/master/src/customLibraries/DndKitSensors.js"
    click Theme "https://github.com/vuongnguyen333/trello-web/blob/master/src/theme.js"
    click Constants "https://github.com/vuongnguyen333/trello-web/blob/master/src/utils/constants.js"
    click Formatters "https://github.com/vuongnguyen333/trello-web/blob/master/src/utils/formatters.js"
    click Sorts "https://github.com/vuongnguyen333/trello-web/blob/master/src/utils/sorts.js"
    click HTML "https://github.com/vuongnguyen333/trello-web/blob/master/index.html"
    click Public "https://github.com/vuongnguyen333/trello-web/tree/master/public/"
    click CSS1 "https://github.com/vuongnguyen333/trello-web/blob/master/src/index.css"
    click CSS2 "https://github.com/vuongnguyen333/trello-web/blob/master/src/App.css"
    click vite.config.js "https://github.com/vuongnguyen333/trello-web/blob/master/vite.config.js"
    click .eslintrc.cjs "https://github.com/vuongnguyen333/trello-web/blob/master/.eslintrc.cjs"
    click jsconfig.json "https://github.com/vuongnguyen333/trello-web/blob/master/jsconfig.json"
    click package.json "https://github.com/vuongnguyen333/trello-web/blob/master/package.json"
    click package-lock.json "https://github.com/vuongnguyen333/trello-web/blob/master/package-lock.json"
```
