# nguyendinhhoai1207/24ct-nguyendinhhoai architecture

> Architecture diagram of the GitHub repository nguyendinhhoai1207/24ct-nguyendinhhoai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nguyendinhhoai1207/24ct-nguyendinhhoai
- Repository: https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai

## Overview

This repository combines an editable-page builder with a dashboard for managing work items. The builder workflow is to add and arrange UI blocks, edit their content and styling, preview the page, and export or save its layout; the dashboard workflow loads records and supports CRUD, status changes, analytics, and reset. The server exposes separate layout and item APIs, using MongoDB when connected and JSON-file fallback storage otherwise. The README documents builder capabilities not fully shown in the sampled client API, so those links are marked as documented rather than inferred from imports.

Main entry points: [`client/src/App.jsx`](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/App.jsx) (Application Shell), [`server/src/controllers/layoutController.js`](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/controllers/layoutController.js) (Layout Controller), [`server/src/controllers/itemController.js`](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/controllers/itemController.js) (Item Controller), [`server/src/server.js`](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/server.js) (Express Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_builder["Page Builder"]
  node_blocklibrary["Block Templates<br/>[defaultBlocks.js]"]
  node_addblock["Add Block Dialog<br/>[AddBlockModal.jsx]"]
  node_toolbar["Builder Toolbar<br/>[Toolbar.jsx]"]
  node_canvas["Page Canvas<br/>[Canvas.jsx]"]
  node_renderer["Block Renderer<br/>[BlockRenderer.jsx]"]
  node_inlineedit["Inline Text Editor<br/>[EditableText.jsx]"]
  node_properties["Property Inspector<br/>[PropertyPanel.jsx]"]
  node_export["Layout Export<br/>[ExportModal.jsx]"]
end

subgraph group_dashboard["Work Dashboard"]
  node_app["Application Shell<br/>[App.jsx]"]
  node_dashboardtab["Dashboard View<br/>[DashboardTab.jsx]"]
  node_crudtab["Item CRUD View<br/>[CrudTab.jsx]"]
  node_analyticstab["Analytics View<br/>[AnalyticsTab.jsx]"]
  node_profiletab["Profile View<br/>[ProfileTab.jsx]"]
  node_itemmodal["Item Editor<br/>[ItemModal.jsx]"]
  node_authmodal["Auth Dialog<br/>[AuthModal.jsx]"]
  node_apihelper["Item API Client<br/>[api.js]"]
end

subgraph group_api["API Routing"]
  node_express["Express Server<br/>[server.js]"]
  node_itemroutes["Item Routes<br/>[itemRoutes.js]"]
  node_layoutroutes["Layout Routes<br/>[layoutRoutes.js]"]
  node_itemcontroller["Item Controller<br/>[itemController.js]"]
  node_layoutcontroller["Layout Controller"]
end

subgraph group_storage["Persistence"]
  node_itemmodel["Item Model<br/>[Item.js]"]
  node_layoutmodel["Layout Model<br/>[Layout.js]"]
  node_dbconfig["Database Connection<br/>[db.js]"]
  node_mongodb[("MongoDB")]
  node_fallbackitems["Item JSON Fallback"]
  node_fallbacklayouts["Layout JSON Fallback"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_dashboardtab
node_app -->|"renders"| node_crudtab
node_app -->|"renders"| node_analyticstab
node_app -->|"renders"| node_profiletab
node_app -->|"renders"| node_itemmodal
node_app -->|"renders"| node_authmodal
node_app -->|"calls item APIs"| node_apihelper
node_user -.->|"adds blocks"| node_addblock
node_blocklibrary -->|"supplies templates"| node_addblock
node_blocklibrary -->|"supplies palettes"| node_toolbar
node_canvas -->|"renders blocks"| node_renderer
node_renderer -->|"uses editor"| node_inlineedit
node_user -.->|"styles blocks"| node_properties
node_user -.->|"exports layout"| node_export
node_apihelper -.->|"requests items"| node_express
node_express -->|"mounts route"| node_itemroutes
node_express -->|"mounts route"| node_layoutroutes
node_itemroutes -->|"dispatches"| node_itemcontroller
node_layoutroutes -->|"dispatches"| node_layoutcontroller
node_itemcontroller -->|"reads and writes"| node_itemmodel
node_layoutcontroller -->|"reads and writes"| node_layoutmodel
node_itemcontroller -->|"checks status"| node_dbconfig
node_layoutcontroller -->|"checks status"| node_dbconfig
node_dbconfig -->|"connects"| node_mongodb
node_itemcontroller -->|"uses fallback"| node_fallbackitems
node_layoutcontroller -->|"uses fallback"| node_fallbacklayouts
node_layoutcontroller -.->|"stores layouts"| node_mongodb

click node_app "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/App.jsx"
click node_dashboardtab "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/DashboardTab.jsx"
click node_crudtab "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/CrudTab.jsx"
click node_analyticstab "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/AnalyticsTab.jsx"
click node_profiletab "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/ProfileTab.jsx"
click node_itemmodal "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/ItemModal.jsx"
click node_authmodal "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/AuthModal.jsx"
click node_apihelper "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/services/api.js"
click node_blocklibrary "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/data/defaultBlocks.js"
click node_addblock "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/AddBlockModal.jsx"
click node_toolbar "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/Toolbar.jsx"
click node_canvas "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/Canvas.jsx"
click node_renderer "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/BlockRenderer.jsx"
click node_inlineedit "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/EditableText.jsx"
click node_properties "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/PropertyPanel.jsx"
click node_export "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/ExportModal.jsx"
click node_express "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/server.js"
click node_itemroutes "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/routes/itemRoutes.js"
click node_layoutroutes "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/routes/layoutRoutes.js"
click node_itemcontroller "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/controllers/itemController.js"
click node_layoutcontroller "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/controllers/layoutController.js"
click node_itemmodel "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/models/Item.js"
click node_layoutmodel "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/models/Layout.js"
click node_dbconfig "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/config/db.js"
click node_fallbackitems "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/data/fallback_items.json"
click node_fallbacklayouts "https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/data/fallback_layouts.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_blocklibrary,node_addblock,node_toolbar,node_canvas,node_renderer,node_inlineedit,node_properties,node_export,node_user toneBlue
class node_app,node_dashboardtab,node_crudtab,node_analyticstab,node_profiletab,node_itemmodal,node_authmodal,node_apihelper toneAmber
class node_express,node_itemroutes,node_layoutroutes,node_itemcontroller,node_layoutcontroller toneMint
class node_itemmodel,node_layoutmodel,node_dbconfig,node_mongodb,node_fallbackitems,node_fallbacklayouts toneRose
```

## Components

### Page Builder

- [Block Templates](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/data/defaultBlocks.js): `client/src/data/defaultBlocks.js`
- [Add Block Dialog](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/AddBlockModal.jsx): `client/src/components/AddBlockModal.jsx`
- [Builder Toolbar](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/Toolbar.jsx): `client/src/components/Toolbar.jsx`
- [Page Canvas](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/Canvas.jsx): `client/src/components/Canvas.jsx`
- [Block Renderer](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/BlockRenderer.jsx): `client/src/components/BlockRenderer.jsx`
- [Inline Text Editor](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/EditableText.jsx): `client/src/components/EditableText.jsx`
- [Property Inspector](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/PropertyPanel.jsx): `client/src/components/PropertyPanel.jsx`
- [Layout Export](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/ExportModal.jsx): `client/src/components/ExportModal.jsx`

### Work Dashboard

- [Application Shell](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Dashboard View](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/DashboardTab.jsx): `client/src/components/DashboardTab.jsx`
- [Item CRUD View](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/CrudTab.jsx): `client/src/components/CrudTab.jsx`
- [Analytics View](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/AnalyticsTab.jsx): `client/src/components/AnalyticsTab.jsx`
- [Profile View](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/ProfileTab.jsx): `client/src/components/ProfileTab.jsx`
- [Item Editor](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/ItemModal.jsx): `client/src/components/ItemModal.jsx`
- [Auth Dialog](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/components/AuthModal.jsx): `client/src/components/AuthModal.jsx`
- [Item API Client](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/client/src/services/api.js): `client/src/services/api.js`

### API Routing

- [Express Server](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/server.js): `server/src/server.js`
- [Item Routes](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/routes/itemRoutes.js): `server/src/routes/itemRoutes.js`
- [Layout Routes](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/routes/layoutRoutes.js): `server/src/routes/layoutRoutes.js`
- [Item Controller](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/controllers/itemController.js): `server/src/controllers/itemController.js`
- [Layout Controller](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/controllers/layoutController.js): `server/src/controllers/layoutController.js`

### Persistence

- [Item Model](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/models/Item.js): `server/src/models/Item.js`
- [Layout Model](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/models/Layout.js): `server/src/models/Layout.js`
- [Database Connection](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/src/config/db.js): `server/src/config/db.js`
- **MongoDB**
- [Item JSON Fallback](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/data/fallback_items.json): `server/data/fallback_items.json`
- [Layout JSON Fallback](https://github.com/nguyendinhhoai1207/24ct-nguyendinhhoai/blob/main/server/data/fallback_layouts.json): `server/data/fallback_layouts.json`

### Other components

- **User**

## Connections

- User → Application Shell: uses (evidence: `client/src/App.jsx`)
- Application Shell → Dashboard View: renders (evidence: `client/src/App.jsx`)
- Application Shell → Item CRUD View: renders (evidence: `client/src/App.jsx`)
- Application Shell → Analytics View: renders (evidence: `client/src/App.jsx`)
- Application Shell → Profile View: renders (evidence: `client/src/App.jsx`)
- Application Shell → Item Editor: renders (evidence: `client/src/App.jsx`)
- Application Shell → Auth Dialog: renders (evidence: `client/src/App.jsx`)
- Application Shell → Item API Client: calls item APIs (evidence: `client/src/App.jsx`)
- User → Add Block Dialog: adds blocks (evidence: `README.md`)
- Block Templates → Add Block Dialog: supplies templates (evidence: `client/src/components/AddBlockModal.jsx`)
- Block Templates → Builder Toolbar: supplies palettes (evidence: `client/src/components/Toolbar.jsx`)
- Page Canvas → Block Renderer: renders blocks (evidence: `client/src/components/Canvas.jsx`)
- Block Renderer → Inline Text Editor: uses editor (evidence: `client/src/components/BlockRenderer.jsx`)
- User → Property Inspector: styles blocks (evidence: `README.md`)
- User → Layout Export: exports layout (evidence: `README.md`)
- Item API Client → Express Server: requests items
- Express Server → Item Routes: mounts route (evidence: `server/src/server.js`)
- Express Server → Layout Routes: mounts route (evidence: `server/src/server.js`)
- Item Routes → Item Controller: dispatches (evidence: `server/src/routes/itemRoutes.js`)
- Layout Routes → Layout Controller: dispatches (evidence: `server/src/routes/layoutRoutes.js`)
- Item Controller → Item Model: reads and writes (evidence: `server/src/controllers/itemController.js`)
- Layout Controller → Layout Model: reads and writes (evidence: `server/src/controllers/layoutController.js`)
- Item Controller → Database Connection: checks status (evidence: `server/src/controllers/itemController.js`)
- Layout Controller → Database Connection: checks status (evidence: `server/src/controllers/layoutController.js`)
- Database Connection → MongoDB: connects (evidence: `server/src/config/db.js`)
- Item Controller → Item JSON Fallback: uses fallback (evidence: `server/src/controllers/itemController.js`)
- Layout Controller → Layout JSON Fallback: uses fallback (evidence: `server/src/controllers/layoutController.js`)
- Layout Controller → MongoDB: stores layouts (evidence: `README.md`)
