# malix55/car-workshop_management_system architecture

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

- Interactive diagram: https://gitdiagram.com/malix55/car-workshop_management_system
- Repository: https://github.com/malix55/car-workshop_management_system

## Overview

#### Purpose and Topology
Car Workshop Management System is a split JavaScript application: a React frontend for workshop operations and a Node.js backend API. The stated scope includes workshop/client management, ecommerce, scheduling, financial workflows, location/remote-mechanic features, and authenticated web/mobile access. The repository contains no separate mobile client or dedicated integrations implementation.
- Backend entry point: `Workshop-server/server.js`
- Frontend entry point and route composition: `workshop-frontend/src/index.js`, `workshop-frontend/src/Routes.js`

#### Backend API and Application Boundary
The backend is organized as an HTTP server with route, controller, middleware, schema, and persistence-model layers. `Workshop-server/server.js` initializes the process; `Workshop-server/routes/user.js` exposes the currently visible route surface; `Workshop-server/controllers/user.js` holds request handling/business actions. This is the primary boundary consumed by the frontend and any future mobile client.
- `Workshop-server/server.js`
- `Workshop-server/routes/user.js`
- `Workshop-server/controllers/user.js`

#### Identity, Authorization, and User Lifecycle
Authentication and authorization are middleware-enforced around API access. JWT authentication is explicitly represented, while a separate user authorization middleware suggests role- or user-state checks. User persistence and admin validation schemas support account administration.
- `Workshop-server/middleware/jwt-auth.js`
- `Workshop-server/middleware/userAuth.js`
- `Workshop-server/models/users.js`
- `Workshop-server/schemas/admin.js`

#### Core Operational Data Domain
Server-side models define the system-of-record entities for the workshop: clients, staff, appointments/events, products, orders, and expenses. These models form the key persistence boundary; frontend screens should treat the API as authoritative rather than managing these entities locally.
- `Workshop-server/models/client.js`, `Workshop-server/models/staff.js`
- `Workshop-server/models/appointments.js`, `Workshop-server/models/event.js`
- `Workshop-server/models/products.js`, `Workshop-server/models/orders.js`, `Workshop-server/models/expense.js`

#### Frontend Shell, Navigation, and Session State
The React client composes application routes, sign-in, a dashboard shell, sidebar/navigation, and a sign-in context. Route-level views host workflow-specific component trees; `SigninContext` is the visible client-side session/auth state boundary.
- `workshop-frontend/src/Routes.js`
- `workshop-frontend/src/storage/SigninContext.js`
- `workshop-frontend/src/views/Signin/Signin.js`
- `workshop-frontend/src/components/Sidebar/Sidebar.js`

#### Workshop Operations Workflows
Operational UI is divided into domain modules: customer and employee management, inventory, orders, calendar scheduling, requests/expenses/time-off, reporting, and pricing. Dashboard views aggregate operational status and reusable dashboard widgets rather than constituting the data source.
- `workshop-frontend/src/components/Client/Clients.js`, `workshop-frontend/src/components/AddClients/AddClients.js`
- `workshop-frontend/src/components/Employee/Employees.js`, `workshop-frontend/src/components/AddEmployees/AddEmployees.js`
- `workshop-frontend/src/components/Inventory/Inventory.js`, `workshop-frontend/src/components/Orders/Orders.js`
- `workshop-frontend/src/components/Calander/Calander.js`, `workshop-frontend/src/components/Requests/Expense/Expense.js`
- `workshop-frontend/src/views/Dashboard/Dashboard.js`

#### Files, Configuration, and External Dependencies
Uploads are handled server-side through dedicated middleware and a local image upload directory, making local filesystem storage an infrastructure dependency. Environment settings and runtime configuration are separated into `.env` and `config.js`. The tree does not establish concrete payment, chat, scraping, mapping, or realtime-service adapters despite those README claims.
- `Workshop-server/middleware/file-upload.js`
- `Workshop-server/uploads/images`
- `Workshop-server/config.js`
- `Workshop-server/.env`

Main entry points: [`workshop-frontend/src/Routes.js`](https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/Routes.js) (Route composition), [`Workshop-server/routes/user.js`](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/routes/user.js) (API routes), [`Workshop-server/controllers/user.js`](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/controllers/user.js) (Request actions), [`Workshop-server/server.js`](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/server.js) (API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React frontend"]
  node_frontend_entry["Frontend entry<br/>React bootstrap<br/>[index.js]"]
  node_routes["Route composition<br/>React routes<br/>[Routes.js]"]
  node_session["Sign-in session<br/>auth context<br/>[SigninContext.js]"]
  node_signin["Sign-in<br/>auth view<br/>[Signin.js]"]
  node_navigation["Sidebar navigation<br/>shared UI<br/>[Sidebar.js]"]
  node_dashboard["Dashboard<br/>operations view<br/>[Dashboard.js]"]
  node_operations_ui["Operations workflows<br/>domain UI modules<br/>[Clients.js]"]
end

subgraph group_backend["Node.js backend"]
  node_server["API server<br/>Node.js HTTP server<br/>[server.js]"]
  node_user_routes["API routes<br/>route layer<br/>[user.js]"]
  node_user_controller["Request actions<br/>controller layer<br/>[user.js]"]
  node_jwt_auth["JWT authentication<br/>auth middleware<br/>[jwt-auth.js]"]
  node_user_auth["User authorization<br/>authorization middleware<br/>[userAuth.js]"]
  node_upload["File upload middleware<br/>[file-upload.js]"]
  node_runtime_config["Runtime configuration<br/>server configuration<br/>[config.js]"]
end

subgraph group_data["Persistence &amp; storage"]
  node_users[("Users &amp; admin validation<br/>identity persistence<br/>[users.js]")]
  node_workshop_data[("Workshop domain data<br/>operational models<br/>[client.js]")]
  node_image_storage[("Uploaded images<br/>local filesystem storage")]
end

node_frontend_entry -->|"mounts"| node_routes
node_routes -->|"renders"| node_signin
node_routes -->|"renders"| node_dashboard
node_routes -->|"renders"| node_operations_ui
node_signin -->|"establishes"| node_session
node_session -->|"gates session"| node_routes
node_navigation -->|"navigates"| node_routes
node_dashboard -->|"API requests"| node_user_routes
node_operations_ui -->|"API requests"| node_user_routes
node_server -->|"hosts"| node_user_routes
node_user_routes -->|"authenticates"| node_jwt_auth
node_jwt_auth -->|"authorizes"| node_user_auth
node_user_auth -->|"permits requests"| node_user_controller
node_user_controller -->|"manages accounts"| node_users
node_user_controller -->|"reads and writes"| node_workshop_data
node_user_routes -->|"accepts uploads"| node_upload
node_upload -->|"stores files"| node_image_storage
node_server -->|"loads"| node_runtime_config

click node_frontend_entry "https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/index.js"
click node_routes "https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/Routes.js"
click node_session "https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/storage/SigninContext.js"
click node_signin "https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/views/Signin/Signin.js"
click node_navigation "https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/components/Sidebar/Sidebar.js"
click node_dashboard "https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/views/Dashboard/Dashboard.js"
click node_operations_ui "https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/components/Client/Clients.js"
click node_server "https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/server.js"
click node_user_routes "https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/routes/user.js"
click node_user_controller "https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/controllers/user.js"
click node_jwt_auth "https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/middleware/jwt-auth.js"
click node_user_auth "https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/middleware/userAuth.js"
click node_upload "https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/middleware/file-upload.js"
click node_users "https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/models/users.js"
click node_workshop_data "https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/models/client.js"
click node_image_storage "https://github.com/malix55/car-workshop_management_system/tree/main/Workshop-server/uploads/images"
click node_runtime_config "https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/config.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_frontend_entry,node_routes,node_session,node_signin,node_navigation,node_dashboard,node_operations_ui toneBlue
class node_server,node_user_routes,node_user_controller,node_jwt_auth,node_user_auth,node_upload,node_runtime_config toneAmber
class node_users,node_workshop_data,node_image_storage toneMint
```

## Components

### React frontend

- [Frontend entry](https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/index.js): React bootstrap · `workshop-frontend/src/index.js`
- [Route composition](https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/Routes.js): React routes · `workshop-frontend/src/Routes.js`
- [Sign-in session](https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/storage/SigninContext.js): auth context · Client-side session and authentication state. · `workshop-frontend/src/storage/SigninContext.js`
- [Sign-in](https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/views/Signin/Signin.js): auth view · `workshop-frontend/src/views/Signin/Signin.js`
- [Sidebar navigation](https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/components/Sidebar/Sidebar.js): shared UI · `workshop-frontend/src/components/Sidebar/Sidebar.js`
- [Dashboard](https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/views/Dashboard/Dashboard.js): operations view · Aggregates workshop status and widgets. · `workshop-frontend/src/views/Dashboard/Dashboard.js`
- [Operations workflows](https://github.com/malix55/car-workshop_management_system/blob/main/workshop-frontend/src/components/Client/Clients.js): domain UI modules · Clients, staff, inventory, orders, calendar, and expenses. · `workshop-frontend/src/components/Client/Clients.js`

### Node.js backend

- [API server](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/server.js): Node.js HTTP server · `Workshop-server/server.js`
- [API routes](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/routes/user.js): route layer · Visible API route surface. · `Workshop-server/routes/user.js`
- [Request actions](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/controllers/user.js): controller layer · Handles API requests and business actions. · `Workshop-server/controllers/user.js`
- [JWT authentication](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/middleware/jwt-auth.js): auth middleware · `Workshop-server/middleware/jwt-auth.js`
- [User authorization](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/middleware/userAuth.js): authorization middleware · Applies role or user-state checks. · `Workshop-server/middleware/userAuth.js`
- [File upload middleware](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/middleware/file-upload.js): upload middleware · `Workshop-server/middleware/file-upload.js`
- [Runtime configuration](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/config.js): server configuration · Environment and server runtime settings. · `Workshop-server/config.js`

### Persistence & storage

- [Users & admin validation](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/models/users.js): identity persistence · User records supported by admin validation schemas. · `Workshop-server/models/users.js`
- [Workshop domain data](https://github.com/malix55/car-workshop_management_system/blob/main/Workshop-server/models/client.js): operational models · Clients, staff, appointments, events, products, orders, and expenses. · `Workshop-server/models/client.js`
- [Uploaded images](https://github.com/malix55/car-workshop_management_system/tree/main/Workshop-server/uploads/images): local filesystem storage · `Workshop-server/uploads/images`

## Connections

- Frontend entry → Route composition: mounts
- Route composition → Sign-in: renders
- Route composition → Dashboard: renders
- Route composition → Operations workflows: renders
- Sign-in → Sign-in session: establishes
- Sign-in session → Route composition: gates session
- Sidebar navigation → Route composition: navigates
- Dashboard → API routes: API requests
- Operations workflows → API routes: API requests
- API server → API routes: hosts
- API routes → JWT authentication: authenticates
- JWT authentication → User authorization: authorizes
- User authorization → Request actions: permits requests
- Request actions → Users & admin validation: manages accounts
- Request actions → Workshop domain data: reads and writes
- API routes → File upload middleware: accepts uploads
- File upload middleware → Uploaded images: stores files
- API server → Runtime configuration: loads
