# soxshaa/camping architecture

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

- Interactive diagram: https://gitdiagram.com/soxshaa/camping
- Repository: https://github.com/soxshaa/camping

## Overview

Camping Los Maitenes is a reservation and site-operations app: staff manage Camping and Picnic reservations, track payments and stays, record cash handoffs, review audit logs, and produce a cash report. The browser app calls a hosted Express API, which persists records in Supabase. The repository also contains a second Express server implementation and an older SQLite-backed API prototype; the excerpts do not show these as the hosted app’s active backend. No README was provided, so capability coverage is based on the sampled source.

Main entry points: [`api/index.js`](https://github.com/soxshaa/camping/blob/main/api/index.js) (Hosted API), [`www/app.js`](https://github.com/soxshaa/camping/blob/main/www/app.js) (Reservation interface), [`server.js`](https://github.com/soxshaa/camping/blob/main/server.js) (Local API variant), [`www/script.js`](https://github.com/soxshaa/camping/blob/main/www/script.js) (SQLite API prototype)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_staff["Staff Interface"]
  node_webapp["Reservation interface<br/>[app.js]"]
  node_reports["Dashboard and reports<br/>[app.js]"]
end

subgraph group_operations["Operations API"]
  node_api["Hosted API<br/>[index.js]"]
  node_reservation_ops["Reservation operations<br/>[index.js]"]
  node_cash_audit["Cash and audit<br/>[index.js]"]
  node_local_server["Local API variant<br/>[server.js]"]
end

subgraph group_persistence["Data Stores"]
  node_supabase[("Supabase data")]
  node_sqlite_prototype["SQLite API prototype<br/>[script.js]"]
  node_sqlite_db[("SQLite database")]
end

node_staff(("Camping staff"))

node_staff -->|"uses"| node_webapp
node_webapp -->|"requests API"| node_api
node_reports -->|"requests logs"| node_api
node_api -->|"routes reservations"| node_reservation_ops
node_api -->|"routes cash and logs"| node_cash_audit
node_reservation_ops -->|"reads and writes"| node_supabase
node_cash_audit -->|"reads and writes"| node_supabase
node_local_server -->|"reads and writes"| node_supabase
node_sqlite_prototype -->|"reads and writes"| node_sqlite_db

click node_webapp "https://github.com/soxshaa/camping/blob/main/www/app.js"
click node_reports "https://github.com/soxshaa/camping/blob/main/www/app.js"
click node_api "https://github.com/soxshaa/camping/blob/main/api/index.js"
click node_reservation_ops "https://github.com/soxshaa/camping/blob/main/api/index.js"
click node_cash_audit "https://github.com/soxshaa/camping/blob/main/api/index.js"
click node_local_server "https://github.com/soxshaa/camping/blob/main/server.js"
click node_sqlite_prototype "https://github.com/soxshaa/camping/blob/main/www/script.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_reports toneBlue
class node_api,node_reservation_ops,node_cash_audit,node_local_server toneAmber
class node_supabase,node_sqlite_prototype,node_sqlite_db toneMint
class node_staff toneIndigo
```

## Components

### Staff Interface

- [Reservation interface](https://github.com/soxshaa/camping/blob/main/www/app.js): `www/app.js`
- [Dashboard and reports](https://github.com/soxshaa/camping/blob/main/www/app.js): `www/app.js`

### Operations API

- [Hosted API](https://github.com/soxshaa/camping/blob/main/api/index.js): `api/index.js`
- [Reservation operations](https://github.com/soxshaa/camping/blob/main/api/index.js): `api/index.js`
- [Cash and audit](https://github.com/soxshaa/camping/blob/main/api/index.js): `api/index.js`
- [Local API variant](https://github.com/soxshaa/camping/blob/main/server.js): `server.js`

### Data Stores

- **Supabase data**
- [SQLite API prototype](https://github.com/soxshaa/camping/blob/main/www/script.js): `www/script.js`
- **SQLite database**

### Other components

- **Camping staff**

## Connections

- Camping staff → Reservation interface: uses (evidence: `www/app.js`)
- Reservation interface → Hosted API: requests API (evidence: `www/app.js`)
- Dashboard and reports → Hosted API: requests logs (evidence: `www/app.js`)
- Hosted API → Reservation operations: routes reservations (evidence: `api/index.js`)
- Hosted API → Cash and audit: routes cash and logs (evidence: `api/index.js`)
- Reservation operations → Supabase data: reads and writes (evidence: `api/index.js`)
- Cash and audit → Supabase data: reads and writes (evidence: `api/index.js`)
- Local API variant → Supabase data: reads and writes (evidence: `server.js`)
- SQLite API prototype → SQLite database: reads and writes (evidence: `www/script.js`)
