# digibuggyai/nas-town architecture

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

- Interactive diagram: https://gitdiagram.com/digibuggyai/nas-town
- Repository: https://github.com/digibuggyai/nas-town

## Overview

NASTOWN is a NAS sales and support website with a staff administration area and an Express API. The main customer journey is to explore NAS products and capacity guidance, use the Finder or configurator to identify a system, then send an enquiry; separate branches cover rentals, services, solutions, reviews, and editorial content. Staff manage catalogue and pricing data, enquiries, blog content, and reviews. The graph reflects documented routes and SOURCE INDEX references; some connections to unsampled UI and API code are shown only as unverified dashed edges.

Main entry points: [`client/src/lib/api.js`](https://github.com/digibuggyai/nas-town/blob/main/client/src/lib/api.js) (API client), [`client/src/App.jsx`](https://github.com/digibuggyai/nas-town/blob/main/client/src/App.jsx) (Site routes), [`client/src/pages/admin/AdminApp.jsx`](https://github.com/digibuggyai/nas-town/blob/main/client/src/pages/admin/AdminApp.jsx) (Staff console), [`server/src/db/store.js`](https://github.com/digibuggyai/nas-town/blob/main/server/src/db/store.js) (Data store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer website"]
  node_site_routes["Site routes<br/>[App.jsx]"]
  node_product_browse["Product catalogue<br/>[Products.jsx]"]
  node_capacity_guides["Capacity guidance<br/>[CapacityPage.jsx]"]
  node_content_pages["Solutions and services<br/>[site.js]"]
  node_blog_content["Blog content<br/>[BlogPost.jsx]"]
  node_reviews["Customer reviews<br/>[Reviews.jsx]"]
  node_enquiries["Enquiry forms<br/>[EnquiryForm.jsx]"]
end

subgraph group_tools["NAS selection tools"]
  node_nas_finder["NAS Finder<br/>[Finder.jsx]"]
  node_configurator_ui["Configurator UI<br/>[Configurator.jsx]"]
  node_nas_engine["Configurator engine<br/>[logic.js]"]
  node_capacity_logic["Capacity calculations<br/>[capacity.js]"]
end

subgraph group_staff["Staff workspace"]
  node_admin_app["Staff console<br/>[AdminApp.jsx]"]
  node_catalogue_admin["Catalogue and pricing admin<br/>[CatalogueTable.jsx]"]
  node_blog_admin["Blog management<br/>[BlogManager.jsx]"]
  node_review_admin["Review management<br/>[ReviewsManager.jsx]"]
end

subgraph group_backend["API and data"]
  node_api_client["API client<br/>[api.js]"]
  node_api_server["HTTP API<br/>[index.js]"]
  node_route_handlers["API route handlers<br/>[routes.js]"]
  node_admin_handlers["Admin routes<br/>[admin-routes.js]"]
  node_review_handlers["Review routes<br/>[review-routes.js]"]
  node_auth["Staff authentication<br/>[auth.js]"]
  node_pricing["Pricing service<br/>[pricing.js]"]
  node_data_store[("Data store<br/>[store.js]")]
end

node_visitor(("Site visitor"))
node_staff_user(("Staff user"))

node_visitor -->|"opens site"| node_site_routes
node_site_routes -->|"routes to"| node_product_browse
node_site_routes -->|"routes to"| node_capacity_guides
node_site_routes -->|"routes to"| node_content_pages
node_site_routes -->|"routes to"| node_blog_content
node_site_routes -->|"routes to"| node_admin_app
node_capacity_guides -->|"uses calculations"| node_capacity_logic
node_capacity_guides -->|"loads pricing"| node_api_client
node_visitor -.->|"answers questions"| node_nas_finder
node_nas_finder -.->|"logs recommendation"| node_api_client
node_visitor -.->|"configures NAS"| node_configurator_ui
node_configurator_ui -.->|"calculates configuration"| node_nas_engine
node_configurator_ui -.->|"gets price list"| node_api_client
node_visitor -.->|"submits enquiry"| node_enquiries
node_visitor -->|"views reviews"| node_reviews
node_reviews -->|"loads reviews"| node_api_client
node_staff_user -->|"uses console"| node_admin_app
node_admin_app -->|"renders manager"| node_catalogue_admin
node_admin_app -->|"renders manager"| node_blog_admin
node_admin_app -->|"renders manager"| node_review_admin
node_blog_admin -->|"manages posts"| node_api_client
node_review_admin -->|"updates reviews"| node_api_client
node_catalogue_admin -.->|"edits catalogue"| node_api_client
node_api_client -->|"sends API requests"| node_api_server
node_api_server -->|"mounts routes"| node_route_handlers
node_api_server -->|"mounts routes"| node_admin_handlers
node_api_server -->|"mounts routes"| node_review_handlers
node_route_handlers -->|"reads and writes"| node_data_store
node_route_handlers -->|"requests pricing"| node_pricing
node_admin_handlers -->|"reads and writes"| node_data_store
node_admin_handlers -->|"builds staff pricing"| node_pricing
node_admin_handlers -->|"checks roles"| node_auth
node_review_handlers -->|"reads and writes"| node_data_store
node_review_handlers -->|"checks admin"| node_auth
node_pricing -->|"reads catalogue"| node_data_store
node_auth -->|"checks staff records"| node_data_store

click node_site_routes "https://github.com/digibuggyai/nas-town/blob/main/client/src/App.jsx"
click node_product_browse "https://github.com/digibuggyai/nas-town/blob/main/client/src/pages/Products.jsx"
click node_capacity_guides "https://github.com/digibuggyai/nas-town/blob/main/client/src/pages/CapacityPage.jsx"
click node_content_pages "https://github.com/digibuggyai/nas-town/blob/main/client/src/data/site.js"
click node_blog_content "https://github.com/digibuggyai/nas-town/blob/main/client/src/pages/BlogPost.jsx"
click node_reviews "https://github.com/digibuggyai/nas-town/blob/main/client/src/sections/Reviews.jsx"
click node_enquiries "https://github.com/digibuggyai/nas-town/blob/main/client/src/components/EnquiryForm.jsx"
click node_nas_finder "https://github.com/digibuggyai/nas-town/blob/main/client/src/components/Finder.jsx"
click node_configurator_ui "https://github.com/digibuggyai/nas-town/blob/main/client/src/components/configurator/Configurator.jsx"
click node_nas_engine "https://github.com/digibuggyai/nas-town/blob/main/client/src/lib/nas/logic.js"
click node_capacity_logic "https://github.com/digibuggyai/nas-town/blob/main/client/src/lib/nas/capacity.js"
click node_admin_app "https://github.com/digibuggyai/nas-town/blob/main/client/src/pages/admin/AdminApp.jsx"
click node_catalogue_admin "https://github.com/digibuggyai/nas-town/blob/main/client/src/components/admin/CatalogueTable.jsx"
click node_blog_admin "https://github.com/digibuggyai/nas-town/blob/main/client/src/components/admin/BlogManager.jsx"
click node_review_admin "https://github.com/digibuggyai/nas-town/blob/main/client/src/components/admin/ReviewsManager.jsx"
click node_api_client "https://github.com/digibuggyai/nas-town/blob/main/client/src/lib/api.js"
click node_api_server "https://github.com/digibuggyai/nas-town/blob/main/server/src/index.js"
click node_route_handlers "https://github.com/digibuggyai/nas-town/blob/main/server/src/routes.js"
click node_admin_handlers "https://github.com/digibuggyai/nas-town/blob/main/server/src/admin-routes.js"
click node_review_handlers "https://github.com/digibuggyai/nas-town/blob/main/server/src/review-routes.js"
click node_auth "https://github.com/digibuggyai/nas-town/blob/main/server/src/auth.js"
click node_pricing "https://github.com/digibuggyai/nas-town/blob/main/server/src/pricing.js"
click node_data_store "https://github.com/digibuggyai/nas-town/blob/main/server/src/db/store.js"

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_site_routes,node_product_browse,node_capacity_guides,node_content_pages,node_blog_content,node_reviews,node_enquiries,node_staff_user toneBlue
class node_nas_finder,node_configurator_ui,node_nas_engine,node_capacity_logic toneAmber
class node_admin_app,node_catalogue_admin,node_blog_admin,node_review_admin toneMint
class node_api_client,node_api_server,node_route_handlers,node_admin_handlers,node_review_handlers,node_auth,node_pricing,node_data_store toneRose
class node_visitor toneIndigo
```

## Components

### Customer website

- [Site routes](https://github.com/digibuggyai/nas-town/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Product catalogue](https://github.com/digibuggyai/nas-town/blob/main/client/src/pages/Products.jsx): `client/src/pages/Products.jsx`
- [Capacity guidance](https://github.com/digibuggyai/nas-town/blob/main/client/src/pages/CapacityPage.jsx): `client/src/pages/CapacityPage.jsx`
- [Solutions and services](https://github.com/digibuggyai/nas-town/blob/main/client/src/data/site.js): `client/src/data/site.js`
- [Blog content](https://github.com/digibuggyai/nas-town/blob/main/client/src/pages/BlogPost.jsx): `client/src/pages/BlogPost.jsx`
- [Customer reviews](https://github.com/digibuggyai/nas-town/blob/main/client/src/sections/Reviews.jsx): `client/src/sections/Reviews.jsx`
- [Enquiry forms](https://github.com/digibuggyai/nas-town/blob/main/client/src/components/EnquiryForm.jsx): `client/src/components/EnquiryForm.jsx`

### NAS selection tools

- [NAS Finder](https://github.com/digibuggyai/nas-town/blob/main/client/src/components/Finder.jsx): `client/src/components/Finder.jsx`
- [Configurator UI](https://github.com/digibuggyai/nas-town/blob/main/client/src/components/configurator/Configurator.jsx): `client/src/components/configurator/Configurator.jsx`
- [Configurator engine](https://github.com/digibuggyai/nas-town/blob/main/client/src/lib/nas/logic.js): `client/src/lib/nas/logic.js`
- [Capacity calculations](https://github.com/digibuggyai/nas-town/blob/main/client/src/lib/nas/capacity.js): `client/src/lib/nas/capacity.js`

### Staff workspace

- [Staff console](https://github.com/digibuggyai/nas-town/blob/main/client/src/pages/admin/AdminApp.jsx): `client/src/pages/admin/AdminApp.jsx`
- [Catalogue and pricing admin](https://github.com/digibuggyai/nas-town/blob/main/client/src/components/admin/CatalogueTable.jsx): `client/src/components/admin/CatalogueTable.jsx`
- [Blog management](https://github.com/digibuggyai/nas-town/blob/main/client/src/components/admin/BlogManager.jsx): `client/src/components/admin/BlogManager.jsx`
- [Review management](https://github.com/digibuggyai/nas-town/blob/main/client/src/components/admin/ReviewsManager.jsx): `client/src/components/admin/ReviewsManager.jsx`

### API and data

- [API client](https://github.com/digibuggyai/nas-town/blob/main/client/src/lib/api.js): `client/src/lib/api.js`
- [HTTP API](https://github.com/digibuggyai/nas-town/blob/main/server/src/index.js): `server/src/index.js`
- [API route handlers](https://github.com/digibuggyai/nas-town/blob/main/server/src/routes.js): `server/src/routes.js`
- [Admin routes](https://github.com/digibuggyai/nas-town/blob/main/server/src/admin-routes.js): `server/src/admin-routes.js`
- [Review routes](https://github.com/digibuggyai/nas-town/blob/main/server/src/review-routes.js): `server/src/review-routes.js`
- [Staff authentication](https://github.com/digibuggyai/nas-town/blob/main/server/src/auth.js): `server/src/auth.js`
- [Pricing service](https://github.com/digibuggyai/nas-town/blob/main/server/src/pricing.js): `server/src/pricing.js`
- [Data store](https://github.com/digibuggyai/nas-town/blob/main/server/src/db/store.js): `server/src/db/store.js`

### Other components

- **Site visitor**
- **Staff user**

## Connections

- Site visitor → Site routes: opens site (evidence: `client/src/App.jsx`)
- Site routes → Product catalogue: routes to (evidence: `client/src/App.jsx`)
- Site routes → Capacity guidance: routes to (evidence: `client/src/App.jsx`)
- Site routes → Solutions and services: routes to (evidence: `client/src/App.jsx`)
- Site routes → Blog content: routes to (evidence: `client/src/App.jsx`)
- Site routes → Staff console: routes to (evidence: `client/src/App.jsx`)
- Capacity guidance → Capacity calculations: uses calculations (evidence: `client/src/pages/CapacityPage.jsx`)
- Capacity guidance → API client: loads pricing (evidence: `client/src/pages/CapacityPage.jsx`)
- Site visitor → NAS Finder: answers questions
- NAS Finder → API client: logs recommendation
- Site visitor → Configurator UI: configures NAS
- Configurator UI → Configurator engine: calculates configuration
- Configurator UI → API client: gets price list
- Site visitor → Enquiry forms: submits enquiry
- Site visitor → Customer reviews: views reviews (evidence: `client/src/sections/Reviews.jsx`)
- Customer reviews → API client: loads reviews (evidence: `client/src/sections/Reviews.jsx`)
- Staff user → Staff console: uses console (evidence: `client/src/pages/admin/AdminApp.jsx`)
- Staff console → Catalogue and pricing admin: renders manager (evidence: `client/src/pages/admin/AdminApp.jsx`)
- Staff console → Blog management: renders manager (evidence: `client/src/pages/admin/AdminApp.jsx`)
- Staff console → Review management: renders manager (evidence: `client/src/pages/admin/AdminApp.jsx`)
- Blog management → API client: manages posts (evidence: `client/src/components/admin/BlogManager.jsx`)
- Review management → API client: updates reviews (evidence: `client/src/components/admin/ReviewsManager.jsx`)
- Catalogue and pricing admin → API client: edits catalogue
- API client → HTTP API: sends API requests (evidence: `client/src/lib/api.js`)
- HTTP API → API route handlers: mounts routes (evidence: `server/src/index.js`)
- HTTP API → Admin routes: mounts routes (evidence: `server/src/index.js`)
- HTTP API → Review routes: mounts routes (evidence: `server/src/index.js`)
- API route handlers → Data store: reads and writes (evidence: `server/src/routes.js`)
- API route handlers → Pricing service: requests pricing (evidence: `server/src/routes.js`)
- Admin routes → Data store: reads and writes (evidence: `server/src/admin-routes.js`)
- Admin routes → Pricing service: builds staff pricing (evidence: `server/src/admin-routes.js`)
- Admin routes → Staff authentication: checks roles (evidence: `server/src/admin-routes.js`)
- Review routes → Data store: reads and writes (evidence: `server/src/review-routes.js`)
- Review routes → Staff authentication: checks admin (evidence: `server/src/review-routes.js`)
- Pricing service → Data store: reads catalogue (evidence: `server/src/pricing.js`)
- Staff authentication → Data store: checks staff records (evidence: `server/src/auth.js`)
