# arceus1ooo/fullstackdemo architecture

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

- Interactive diagram: https://gitdiagram.com/arceus1ooo/fullstackdemo
- Repository: https://github.com/arceus1ooo/fullstackdemo

## Overview

This is a small client-and-interaction management dashboard. A user works in the dashboard to view, add, edit, and delete client records and interaction records; browser behavior sends HTTP requests to the Express server, which dispatches them to API routes and services that persist JSON files. Client deletion also removes related interactions, and interaction creation checks that its client exists. The README documents the UI/API workflow; the sampled source confirms the route-to-service and service-to-file relationships.

Main entry points: [`api/server.js`](https://github.com/arceus1ooo/fullstackdemo/blob/main/api/server.js) (Express server), [`ui/index.html`](https://github.com/arceus1ooo/fullstackdemo/blob/main/ui/index.html) (Dashboard page), [`api/routes/client-routes.js`](https://github.com/arceus1ooo/fullstackdemo/blob/main/api/routes/client-routes.js) (Client API routes), [`api/routes/interaction-routes.js`](https://github.com/arceus1ooo/fullstackdemo/blob/main/api/routes/interaction-routes.js) (Interaction API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard UI"]
  node_page["Dashboard page<br/>[index.html]"]
  node_client_ui["Client management<br/>[client-behavior.js]"]
  node_interaction_ui["Interaction management"]
end

subgraph group_api["HTTP API"]
  node_server["Express server<br/>[server.js]"]
  node_client_routes["Client API routes<br/>[client-routes.js]"]
  node_interaction_routes["Interaction API routes"]
end

subgraph group_services["Domain Services"]
  node_client_service["Client services<br/>[client-services.js]"]
  node_interaction_service["Interaction services"]
end

subgraph group_storage["JSON Storage"]
  node_clients_file[("Client records<br/>[clients.json]")]
  node_interactions_file[("Interaction records<br/>[interactions.json]")]
end

node_user(("Dashboard user"))

node_user -->|"uses"| node_page
node_server -->|"serves"| node_page
node_page -->|"loads behavior"| node_client_ui
node_page -->|"loads behavior"| node_interaction_ui
node_client_ui -->|"requests clients"| node_server
node_interaction_ui -->|"requests interactions"| node_server
node_server -->|"routes requests"| node_client_routes
node_server -->|"routes requests"| node_interaction_routes
node_client_routes -->|"calls"| node_client_service
node_client_routes -->|"deletes related"| node_interaction_service
node_interaction_routes -->|"calls"| node_interaction_service
node_interaction_routes -->|"checks client"| node_client_service
node_client_service -->|"reads and writes"| node_clients_file
node_interaction_service -->|"reads and writes"| node_interactions_file

click node_page "https://github.com/arceus1ooo/fullstackdemo/blob/main/ui/index.html"
click node_client_ui "https://github.com/arceus1ooo/fullstackdemo/blob/main/ui/client-behavior.js"
click node_interaction_ui "https://github.com/arceus1ooo/fullstackdemo/blob/main/ui/interaction-behavior.js"
click node_server "https://github.com/arceus1ooo/fullstackdemo/blob/main/api/server.js"
click node_client_routes "https://github.com/arceus1ooo/fullstackdemo/blob/main/api/routes/client-routes.js"
click node_interaction_routes "https://github.com/arceus1ooo/fullstackdemo/blob/main/api/routes/interaction-routes.js"
click node_client_service "https://github.com/arceus1ooo/fullstackdemo/blob/main/api/services/client-services.js"
click node_interaction_service "https://github.com/arceus1ooo/fullstackdemo/blob/main/api/services/interaction-services.js"
click node_clients_file "https://github.com/arceus1ooo/fullstackdemo/blob/main/database/clients.json"
click node_interactions_file "https://github.com/arceus1ooo/fullstackdemo/blob/main/database/interactions.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_page,node_client_ui,node_interaction_ui,node_user toneBlue
class node_server,node_client_routes,node_interaction_routes toneAmber
class node_client_service,node_interaction_service toneMint
class node_clients_file,node_interactions_file toneRose
```

## Components

### Dashboard UI

- [Dashboard page](https://github.com/arceus1ooo/fullstackdemo/blob/main/ui/index.html): `ui/index.html`
- [Client management](https://github.com/arceus1ooo/fullstackdemo/blob/main/ui/client-behavior.js): `ui/client-behavior.js`
- [Interaction management](https://github.com/arceus1ooo/fullstackdemo/blob/main/ui/interaction-behavior.js): `ui/interaction-behavior.js`

### HTTP API

- [Express server](https://github.com/arceus1ooo/fullstackdemo/blob/main/api/server.js): `api/server.js`
- [Client API routes](https://github.com/arceus1ooo/fullstackdemo/blob/main/api/routes/client-routes.js): `api/routes/client-routes.js`
- [Interaction API routes](https://github.com/arceus1ooo/fullstackdemo/blob/main/api/routes/interaction-routes.js): `api/routes/interaction-routes.js`

### Domain Services

- [Client services](https://github.com/arceus1ooo/fullstackdemo/blob/main/api/services/client-services.js): `api/services/client-services.js`
- [Interaction services](https://github.com/arceus1ooo/fullstackdemo/blob/main/api/services/interaction-services.js): `api/services/interaction-services.js`

### JSON Storage

- [Client records](https://github.com/arceus1ooo/fullstackdemo/blob/main/database/clients.json): `database/clients.json`
- [Interaction records](https://github.com/arceus1ooo/fullstackdemo/blob/main/database/interactions.json): `database/interactions.json`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Dashboard page: uses (evidence: `README.md`)
- Express server → Dashboard page: serves (evidence: `api/server.js`)
- Dashboard page → Client management: loads behavior (evidence: `README.md`)
- Dashboard page → Interaction management: loads behavior (evidence: `README.md`)
- Client management → Express server: requests clients (evidence: `README.md`)
- Interaction management → Express server: requests interactions (evidence: `README.md`)
- Express server → Client API routes: routes requests (evidence: `api/server.js`)
- Express server → Interaction API routes: routes requests (evidence: `api/server.js`)
- Client API routes → Client services: calls (evidence: `api/routes/client-routes.js`)
- Client API routes → Interaction services: deletes related (evidence: `api/routes/client-routes.js`)
- Interaction API routes → Interaction services: calls (evidence: `api/routes/interaction-routes.js`)
- Interaction API routes → Client services: checks client (evidence: `api/routes/interaction-routes.js`)
- Client services → Client records: reads and writes (evidence: `api/services/client-services.js`)
- Interaction services → Interaction records: reads and writes (evidence: `api/services/interaction-services.js`)
