# archiebalagtas098-beep/tattoo-system-v3 architecture

> Architecture diagram of the GitHub repository archiebalagtas098-beep/tattoo-system-v3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/archiebalagtas098-beep/tattoo-system-v3
- Repository: https://github.com/archiebalagtas098-beep/tattoo-system-v3

## Overview

TattooSystem is an appointment-booking and studio-management web application, with client booking and staff-facing administration for appointments, dashboards, inventory, reports, photos, and uploaded files. The main domain flow is a client submitting or managing an appointment, with appointment data handled by server routes and persisted in MongoDB; staff can manage bookings and review metrics. The tree also shows browser-side pages for these capabilities. Some server wiring and frontend-to-API calls are not shown, so those relationships are omitted rather than inferred.

Main entry points: [`server.js`](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/server.js) (HTTP server), [`routes/dashboardRoutes.js`](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/dashboardRoutes.js) (Dashboard metrics), [`models/appoinment.js`](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/appoinment.js) (Appointment records), [`routes/appointmentRoutes.js`](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/appointmentRoutes.js) (Appointment routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_server["HTTP server<br/>[server.js]"]
  node_client_booking_ui["Booking interface"]
  node_client_dashboard_ui["Client dashboard<br/>[clientdashboard.js]"]
  node_admin_dashboard_ui["Admin dashboard<br/>[dashboard.js]"]
  node_reports_ui["Reports interface<br/>[report.js]"]
end

subgraph group_booking["Appointments"]
  node_appointment_routes["Appointment routes"]
  node_appointment_handlers["Appointment handlers"]
  node_appointment_model[("Appointment records<br/>[appoinment.js]")]
end

subgraph group_studio["Studio operations"]
  node_dashboard_routes["Dashboard metrics<br/>[dashboardRoutes.js]"]
  node_dashboard_model[("Dashboard data<br/>[dashboard.js]")]
  node_inventory_routes["Inventory API<br/>[inventoryRoutes.js]"]
  node_inventory_model[("Inventory records<br/>[Inventory.js]")]
  node_report_routes["Report routes<br/>[reportRoutes.js]"]
  node_photo_routes["Photo gallery API<br/>[photoRoutes.js]"]
  node_photo_controller["Photo handlers"]
  node_photo_model[("Photo records<br/>[photo.js]")]
  node_storage_routes["File storage API<br/>[storageRoutes.js]"]
  node_storage_controller["File handlers"]
  node_storage_model[("Stored-file records<br/>[storage.js]")]
end

subgraph group_platform["Access and persistence"]
  node_auth["Role access<br/>[requireRole.js]"]
  node_user_model[("User records<br/>[user.js]")]
  node_db_config["MongoDB connection<br/>[Database.js]"]
end

node_client(("Client"))
node_staff(("Studio staff"))
node_mongo[("MongoDB")]

node_server -->|"connects"| node_db_config
node_server -->|"imports"| node_appointment_routes
node_server -->|"imports"| node_dashboard_routes
node_server -->|"imports"| node_inventory_routes
node_server -->|"imports"| node_report_routes
node_server -->|"imports"| node_photo_routes
node_server -.->|"imports"| node_storage_routes
node_appointment_routes -->|"queries"| node_appointment_model
node_appointment_handlers -->|"queries"| node_appointment_model
node_dashboard_routes -->|"reads"| node_appointment_model
node_dashboard_routes -->|"reads and writes"| node_dashboard_model
node_inventory_routes -->|"reads and writes"| node_inventory_model
node_storage_routes -->|"dispatches"| node_storage_controller
node_storage_controller -->|"reads and writes"| node_storage_model
node_auth -->|"loads user"| node_user_model
node_db_config -->|"connects"| node_mongo

click node_server "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/server.js"
click node_client_booking_ui "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/public/js/clientappointment.js"
click node_client_dashboard_ui "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/public/js/clientdashboard.js"
click node_admin_dashboard_ui "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/public/js/dashboard.js"
click node_appointment_routes "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/appointmentRoutes.js"
click node_appointment_handlers "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/controllers/appointmentControllers.js"
click node_appointment_model "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/appoinment.js"
click node_dashboard_routes "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/dashboardRoutes.js"
click node_dashboard_model "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/dashboard.js"
click node_inventory_routes "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/inventoryRoutes.js"
click node_inventory_model "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/Inventory.js"
click node_reports_ui "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/public/js/report.js"
click node_report_routes "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/reportRoutes.js"
click node_photo_routes "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/photoRoutes.js"
click node_photo_controller "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/controllers/photoControllers.js"
click node_photo_model "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/photo.js"
click node_storage_routes "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/storageRoutes.js"
click node_storage_controller "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/controllers/storageControllers.js"
click node_storage_model "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/storage.js"
click node_auth "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/middleware/requireRole.js"
click node_user_model "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/user.js"
click node_db_config "https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/config/Database.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_server,node_client_booking_ui,node_client_dashboard_ui,node_admin_dashboard_ui,node_reports_ui,node_client toneBlue
class node_appointment_routes,node_appointment_handlers,node_appointment_model,node_mongo toneAmber
class node_dashboard_routes,node_dashboard_model,node_inventory_routes,node_inventory_model,node_report_routes,node_photo_routes,node_photo_controller,node_photo_model,node_storage_routes,node_storage_controller,node_storage_model toneMint
class node_auth,node_user_model,node_db_config toneRose
class node_staff toneIndigo
```

## Components

### Web application

- [HTTP server](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/server.js): `server.js`
- [Booking interface](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/public/js/clientappointment.js): `public/js/clientappointment.js`
- [Client dashboard](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/public/js/clientdashboard.js): `public/js/clientdashboard.js`
- [Admin dashboard](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/public/js/dashboard.js): `public/js/dashboard.js`
- [Reports interface](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/public/js/report.js): `public/js/report.js`

### Appointments

- [Appointment routes](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/appointmentRoutes.js): `routes/appointmentRoutes.js`
- [Appointment handlers](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/controllers/appointmentControllers.js): `controllers/appointmentControllers.js`
- [Appointment records](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/appoinment.js): `models/appoinment.js`

### Studio operations

- [Dashboard metrics](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/dashboardRoutes.js): `routes/dashboardRoutes.js`
- [Dashboard data](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/dashboard.js): `models/dashboard.js`
- [Inventory API](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/inventoryRoutes.js): `routes/inventoryRoutes.js`
- [Inventory records](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/Inventory.js): `models/Inventory.js`
- [Report routes](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/reportRoutes.js): `routes/reportRoutes.js`
- [Photo gallery API](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/photoRoutes.js): `routes/photoRoutes.js`
- [Photo handlers](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/controllers/photoControllers.js): `controllers/photoControllers.js`
- [Photo records](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/photo.js): `models/photo.js`
- [File storage API](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/routes/storageRoutes.js): `routes/storageRoutes.js`
- [File handlers](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/controllers/storageControllers.js): `controllers/storageControllers.js`
- [Stored-file records](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/storage.js): `models/storage.js`

### Access and persistence

- [Role access](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/middleware/requireRole.js): `middleware/requireRole.js`
- [User records](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/models/user.js): `models/user.js`
- [MongoDB connection](https://github.com/archiebalagtas098-beep/tattoo-system-v3/blob/main/config/Database.js): `config/Database.js`

### Other components

- **Client**
- **Studio staff**
- **MongoDB**

## Connections

- HTTP server → MongoDB connection: connects (evidence: `server.js`)
- HTTP server → Appointment routes: imports (evidence: `server.js`)
- HTTP server → Dashboard metrics: imports (evidence: `server.js`)
- HTTP server → Inventory API: imports (evidence: `server.js`)
- HTTP server → Report routes: imports (evidence: `server.js`)
- HTTP server → Photo gallery API: imports (evidence: `server.js`)
- HTTP server → File storage API: imports
- Appointment routes → Appointment records: queries (evidence: `routes/appointmentRoutes.js`)
- Appointment handlers → Appointment records: queries (evidence: `controllers/appointmentControllers.js`)
- Dashboard metrics → Appointment records: reads (evidence: `routes/dashboardRoutes.js`)
- Dashboard metrics → Dashboard data: reads and writes (evidence: `routes/dashboardRoutes.js`)
- Inventory API → Inventory records: reads and writes (evidence: `routes/inventoryRoutes.js`)
- File storage API → File handlers: dispatches (evidence: `routes/storageRoutes.js`)
- File handlers → Stored-file records: reads and writes (evidence: `controllers/storageControllers.js`)
- Role access → User records: loads user (evidence: `middleware/requireRole.js`)
- MongoDB connection → MongoDB: connects (evidence: `config/Database.js`)
