# johnnmichael029/sandigan-carwash-car-rental architecture

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

- Interactive diagram: https://gitdiagram.com/johnnmichael029/sandigan-carwash-car-rental
- Repository: https://github.com/johnnmichael029/sandigan-carwash-car-rental

## Overview

Sandigan is a car-wash, rental, and business-operations platform with a web admin/employee interface, public booking, and a mobile app. Its main workflow sends bookings through the API into operational records, with customer notifications and email; administrative branches cover CRM, inventory, finance, HR, and operations. The excerpts show only selected routes and integrations, so unsampled feature links are omitted rather than inferred.

Main entry points: [`backend/server.js`](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/server.js) (API server), [`backend/controllers/bookingController.js`](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/bookingController.js) (Booking workflow), [`frontend/src/App.jsx`](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/frontend/src/App.jsx) (Web application), [`backend/controllers/carRentalController.js`](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/carRentalController.js) (Rental workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Customer and staff apps"]
  node_webapp["Web application<br/>[App.jsx]"]
  node_adminui["Admin modules"]
  node_bookingui["Public booking<br/>[Book.jsx]"]
  node_mobileapp["Mobile app<br/>[App.js]"]
end

subgraph group_api["API and access"]
  node_server["API server<br/>[server.js]"]
  node_routes["API routes"]
  node_bookingroutes["Booking routes<br/>[bookingRoutes.js]"]
end

subgraph group_service["Bookings and rentals"]
  node_booking["Booking workflow"]
  node_bookingstore[("Booking records<br/>[bookingModel.js]")]
  node_rental["Rental workflow"]
  node_rentalstore[("Rental records<br/>[carRentalModel.js]")]
  node_email["Transactional email<br/>[emailService.js]"]
end

subgraph group_admin["Business operations"]
  node_crm["CRM<br/>[crmController.js]"]
  node_customerstore[("Customer records<br/>[customerModel.js]")]
  node_promotions["Promotion manager"]
  node_finance["Finance<br/>[financeRoutes.js]"]
  node_inventory["Inventory management"]
  node_serviceadmin["Service settings<br/>[ServiceManager.jsx]"]
  node_payroll["Payroll"]
  node_audit["Activity logging"]
end

node_customer(("Customer"))
node_staff(("Admin and staff"))

node_customer -.->|"books through"| node_bookingui
node_staff -.->|"uses"| node_webapp
node_webapp -.->|"renders modules"| node_adminui
node_webapp -->|"routes to"| node_bookingui
node_mobileapp -.->|"sends API requests"| node_server
node_server -->|"mounts"| node_routes
node_routes -->|"includes"| node_bookingroutes
node_bookingroutes -->|"dispatches to"| node_booking
node_booking -->|"reads and writes"| node_bookingstore
node_booking -->|"sends confirmation"| node_email
node_rental -->|"reads and writes"| node_rentalstore
node_rental -.->|"sends email"| node_email
node_crm -->|"reads and writes"| node_customerstore
node_promotions -.->|"calls API"| node_server
node_finance -->|"mounted by"| node_server
node_serviceadmin -.->|"requests pricing API"| node_server
node_payroll -->|"creates logs"| node_audit
node_booking -->|"creates logs"| node_audit

click node_webapp "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/frontend/src/App.jsx"
click node_adminui "https://github.com/johnnmichael029/sandigan-carwash-car-rental/tree/master/frontend/src/components/admin"
click node_bookingui "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/frontend/src/pages/public/Book.jsx"
click node_mobileapp "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/mobile/App.js"
click node_server "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/server.js"
click node_routes "https://github.com/johnnmichael029/sandigan-carwash-car-rental/tree/master/backend/routes"
click node_bookingroutes "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/routes/bookingRoutes.js"
click node_booking "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/bookingController.js"
click node_bookingstore "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/models/bookingModel.js"
click node_rental "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/carRentalController.js"
click node_rentalstore "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/models/carRentalModel.js"
click node_email "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/utils/emailService.js"
click node_crm "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/crmController.js"
click node_customerstore "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/models/customerModel.js"
click node_promotions "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/frontend/src/components/admin/crm/PromotionManager.jsx"
click node_finance "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/routes/financeRoutes.js"
click node_inventory "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/frontend/src/components/admin/inventory/InventoryManager.jsx"
click node_serviceadmin "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/frontend/src/components/admin/inventory/ServiceManager.jsx"
click node_payroll "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/payrollController.js"
click node_audit "https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/activityLogController.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_webapp,node_adminui,node_bookingui,node_mobileapp toneBlue
class node_server,node_routes,node_bookingroutes toneAmber
class node_booking,node_bookingstore,node_rental,node_rentalstore,node_email toneMint
class node_crm,node_customerstore,node_promotions,node_finance,node_inventory,node_serviceadmin,node_payroll,node_audit toneRose
class node_customer,node_staff toneIndigo
```

## Components

### Customer and staff apps

- [Web application](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Admin modules](https://github.com/johnnmichael029/sandigan-carwash-car-rental/tree/master/frontend/src/components/admin): `frontend/src/components/admin`
- [Public booking](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/frontend/src/pages/public/Book.jsx): `frontend/src/pages/public/Book.jsx`
- [Mobile app](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/mobile/App.js): `mobile/App.js`

### API and access

- [API server](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/server.js): `backend/server.js`
- [API routes](https://github.com/johnnmichael029/sandigan-carwash-car-rental/tree/master/backend/routes): `backend/routes`
- [Booking routes](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/routes/bookingRoutes.js): `backend/routes/bookingRoutes.js`

### Bookings and rentals

- [Booking workflow](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/bookingController.js): `backend/controllers/bookingController.js`
- [Booking records](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/models/bookingModel.js): `backend/models/bookingModel.js`
- [Rental workflow](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/carRentalController.js): `backend/controllers/carRentalController.js`
- [Rental records](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/models/carRentalModel.js): `backend/models/carRentalModel.js`
- [Transactional email](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/utils/emailService.js): `backend/utils/emailService.js`

### Business operations

- [CRM](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/crmController.js): `backend/controllers/crmController.js`
- [Customer records](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/models/customerModel.js): `backend/models/customerModel.js`
- [Promotion manager](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/frontend/src/components/admin/crm/PromotionManager.jsx): `frontend/src/components/admin/crm/PromotionManager.jsx`
- [Finance](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/routes/financeRoutes.js): `backend/routes/financeRoutes.js`
- [Inventory management](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/frontend/src/components/admin/inventory/InventoryManager.jsx): `frontend/src/components/admin/inventory/InventoryManager.jsx`
- [Service settings](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/frontend/src/components/admin/inventory/ServiceManager.jsx): `frontend/src/components/admin/inventory/ServiceManager.jsx`
- [Payroll](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/payrollController.js): `backend/controllers/payrollController.js`
- [Activity logging](https://github.com/johnnmichael029/sandigan-carwash-car-rental/blob/master/backend/controllers/activityLogController.js): `backend/controllers/activityLogController.js`

### Other components

- **Customer**
- **Admin and staff**

## Connections

- Customer → Public booking: books through
- Admin and staff → Web application: uses
- Web application → Admin modules: renders modules
- Web application → Public booking: routes to (evidence: `frontend/src/App.jsx`)
- Mobile app → API server: sends API requests
- API server → API routes: mounts (evidence: `backend/server.js`)
- API routes → Booking routes: includes (evidence: `backend/server.js`)
- Booking routes → Booking workflow: dispatches to (evidence: `backend/routes/bookingRoutes.js`)
- Booking workflow → Booking records: reads and writes (evidence: `backend/controllers/bookingController.js`)
- Booking workflow → Transactional email: sends confirmation (evidence: `backend/controllers/bookingController.js`)
- Rental workflow → Rental records: reads and writes (evidence: `backend/controllers/carRentalController.js`)
- Rental workflow → Transactional email: sends email (evidence: `backend/controllers/carRentalController.js`)
- CRM → Customer records: reads and writes (evidence: `backend/controllers/crmController.js`)
- Promotion manager → API server: calls API
- Finance → API server: mounted by (evidence: `backend/server.js`)
- Service settings → API server: requests pricing API
- Payroll → Activity logging: creates logs (evidence: `backend/controllers/payrollController.js`)
- Booking workflow → Activity logging: creates logs (evidence: `backend/controllers/bookingController.js`)
