# zneraul/facicuse-cics-facility-tracker architecture

> Architecture diagram of the GitHub repository zneraul/facicuse-cics-facility-tracker, 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/zneraul/facicuse-cics-facility-tracker
- Repository: https://github.com/zneraul/facicuse-cics-facility-tracker

## Overview

FaCICuSe is a CICS facility discovery, booking coordination, class scheduling, maintenance, and administration application. The main user journey runs from the browser’s routed pages through authenticated API requests to HTTP controllers, application workflows, and persistent repositories; results return through the API to the interface. Separate branches cover public facility/timetable discovery, user reservations and issue reporting, and administrator scheduling, analytics, and management. The README documents PostgreSQL and Firebase integrations; the excerpts show selected wiring and calls, so unsampled feature-level links are omitted where their callers are not evidenced.

Main entry points: [`backend/bootstrap/applicationContainer.js`](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/bootstrap/applicationContainer.js) (Application wiring), [`frontend/App.jsx`](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/App.jsx) (React router), [`frontend/services/api.js`](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/services/api.js) (API client), [`backend/database/postgres/repositories.js`](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/database/postgres/repositories.js) (PostgreSQL repositories)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["React router<br/>[App.jsx]"]
  node_public["Public discovery<br/>[LandingPage.jsx]"]
  node_facilitypages["Facility pages"]
  node_schedulepages["Schedule views<br/>[CalendarPage.jsx]"]
  node_adminpages["Admin workspace"]
  node_authcontext["Auth context<br/>[AuthContext.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_firebaseclient["Firebase client<br/>[firebase.js]"]
end

subgraph group_http["HTTP and identity"]
  node_server["Express server<br/>[index.js]"]
  node_routes["API routes<br/>[apiRoutes.js]"]
  node_controllers["API controllers<br/>[apiControllers.js]"]
  node_authservice["Firebase auth service"]
  node_container["Application wiring"]
end

subgraph group_workflows["Application workflows"]
  node_facilityuse["Facility workflows"]
  node_reservationuse["Reservation workflows"]
  node_scheduleuse["Schedule workflows"]
  node_maintenanceuse["Maintenance workflows"]
  node_adminuse["Admin insights"]
end

subgraph group_domain["Domain rules"]
  node_domainmodels["Domain entities<br/>[entities.js]"]
  node_schedulerules["Schedule rules<br/>[classSchedule.js]"]
  node_businessrules["Reservation rules<br/>[rules.js]"]
end

subgraph group_storage["Persistence"]
  node_postgres["PostgreSQL repositories<br/>[repositories.js]"]
  node_schema[("PostgreSQL schema<br/>[schema.ts]")]
  node_localstore[("Local JSON repositories")]
  node_catalog["Facility catalog sync"]
end

node_visitor(("Visitor or user"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_public
node_app -->|"routes to"| node_facilitypages
node_app -->|"routes to"| node_schedulepages
node_app -->|"routes to"| node_adminpages
node_app -->|"provides"| node_authcontext
node_public -->|"requests data"| node_api
node_facilitypages -.->|"requests data"| node_api
node_schedulepages -->|"requests data"| node_api
node_adminpages -->|"requests data"| node_api
node_authcontext -->|"auth requests"| node_api
node_authcontext -->|"uses"| node_firebaseclient
node_api -->|"fetches API"| node_server
node_server -->|"mounts"| node_routes
node_routes -->|"dispatches"| node_controllers
node_controllers -->|"calls"| node_facilityuse
node_controllers -->|"calls"| node_reservationuse
node_controllers -->|"calls"| node_maintenanceuse
node_container -->|"configures"| node_routes
node_container -->|"wires"| node_facilityuse
node_container -->|"wires"| node_reservationuse
node_container -->|"wires"| node_scheduleuse
node_container -->|"wires"| node_maintenanceuse
node_container -->|"wires"| node_adminuse
node_scheduleuse -->|"uses rules"| node_schedulerules
node_reservationuse -->|"uses schedules"| node_scheduleuse
node_reservationuse -.->|"uses rules"| node_businessrules
node_postgres -->|"uses schema"| node_schema
node_container -->|"wires"| node_postgres
node_container -->|"wires"| node_localstore
node_server -->|"synchronizes catalog"| node_catalog
node_catalog -->|"reads and writes"| node_schema
node_facilityuse -.->|"uses repository"| node_postgres
node_reservationuse -.->|"uses repository"| node_postgres
node_maintenanceuse -.->|"uses repository"| node_postgres
node_adminuse -.->|"uses repository"| node_postgres

click node_app "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/App.jsx"
click node_public "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/pages/LandingPage.jsx"
click node_facilitypages "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/pages/FacilitiesDirectoryPage.jsx"
click node_schedulepages "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/pages/CalendarPage.jsx"
click node_adminpages "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/pages/AdminSchedulesPage.jsx"
click node_authcontext "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/context/AuthContext.jsx"
click node_api "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/services/api.js"
click node_firebaseclient "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/services/firebase.js"
click node_server "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/index.js"
click node_routes "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/routes/apiRoutes.js"
click node_controllers "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/controllers/apiControllers.js"
click node_authservice "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/services/firebaseAuthService.js"
click node_container "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/bootstrap/applicationContainer.js"
click node_facilityuse "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/application/useCases/facilityUseCases.js"
click node_reservationuse "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/application/useCases/reservationUseCases.js"
click node_scheduleuse "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/application/useCases/classScheduleUseCases.js"
click node_maintenanceuse "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/application/useCases/maintenanceUseCases.js"
click node_adminuse "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/application/useCases/analyticsUseCases.js"
click node_domainmodels "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/domain/entities.js"
click node_schedulerules "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/domain/classSchedule.js"
click node_businessrules "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/domain/rules.js"
click node_postgres "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/database/postgres/repositories.js"
click node_schema "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/database/postgres/schema.ts"
click node_localstore "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/database/localJsonRepositories.js"
click node_catalog "https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/database/facilityCatalogService.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_app,node_public,node_facilitypages,node_schedulepages,node_adminpages,node_authcontext,node_api,node_firebaseclient,node_visitor toneBlue
class node_server,node_routes,node_controllers,node_authservice,node_container toneAmber
class node_facilityuse,node_reservationuse,node_scheduleuse,node_maintenanceuse,node_adminuse toneMint
class node_domainmodels,node_schedulerules,node_businessrules toneRose
class node_postgres,node_schema,node_localstore,node_catalog toneIndigo
```

## Components

### Web experience

- [React router](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/App.jsx): `frontend/App.jsx`
- [Public discovery](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/pages/LandingPage.jsx): `frontend/pages/LandingPage.jsx`
- [Facility pages](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/pages/FacilitiesDirectoryPage.jsx): `frontend/pages/FacilitiesDirectoryPage.jsx`
- [Schedule views](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/pages/CalendarPage.jsx): `frontend/pages/CalendarPage.jsx`
- [Admin workspace](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/pages/AdminSchedulesPage.jsx): `frontend/pages/AdminSchedulesPage.jsx`
- [Auth context](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/context/AuthContext.jsx): `frontend/context/AuthContext.jsx`
- [API client](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/services/api.js): `frontend/services/api.js`
- [Firebase client](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/frontend/services/firebase.js): `frontend/services/firebase.js`

### HTTP and identity

- [Express server](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/index.js): `backend/index.js`
- [API routes](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/routes/apiRoutes.js): `backend/routes/apiRoutes.js`
- [API controllers](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/controllers/apiControllers.js): `backend/controllers/apiControllers.js`
- [Firebase auth service](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/services/firebaseAuthService.js): `backend/services/firebaseAuthService.js`
- [Application wiring](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/bootstrap/applicationContainer.js): `backend/bootstrap/applicationContainer.js`

### Application workflows

- [Facility workflows](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/application/useCases/facilityUseCases.js): `backend/application/useCases/facilityUseCases.js`
- [Reservation workflows](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/application/useCases/reservationUseCases.js): `backend/application/useCases/reservationUseCases.js`
- [Schedule workflows](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/application/useCases/classScheduleUseCases.js): `backend/application/useCases/classScheduleUseCases.js`
- [Maintenance workflows](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/application/useCases/maintenanceUseCases.js): `backend/application/useCases/maintenanceUseCases.js`
- [Admin insights](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/application/useCases/analyticsUseCases.js): `backend/application/useCases/analyticsUseCases.js`

### Domain rules

- [Domain entities](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/domain/entities.js): `backend/domain/entities.js`
- [Schedule rules](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/domain/classSchedule.js): `backend/domain/classSchedule.js`
- [Reservation rules](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/domain/rules.js): `backend/domain/rules.js`

### Persistence

- [PostgreSQL repositories](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/database/postgres/repositories.js): `backend/database/postgres/repositories.js`
- [PostgreSQL schema](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/database/postgres/schema.ts): `backend/database/postgres/schema.ts`
- [Local JSON repositories](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/database/localJsonRepositories.js): `backend/database/localJsonRepositories.js`
- [Facility catalog sync](https://github.com/zneraul/facicuse-cics-facility-tracker/blob/main/backend/database/facilityCatalogService.js): `backend/database/facilityCatalogService.js`

### Other components

- **Visitor or user**

## Connections

- Visitor or user → React router: opens (evidence: `frontend/App.jsx`)
- React router → Public discovery: routes to (evidence: `frontend/App.jsx`)
- React router → Facility pages: routes to (evidence: `frontend/App.jsx`)
- React router → Schedule views: routes to (evidence: `frontend/App.jsx`)
- React router → Admin workspace: routes to (evidence: `frontend/App.jsx`)
- React router → Auth context: provides (evidence: `frontend/App.jsx`)
- Public discovery → API client: requests data (evidence: `frontend/pages/LandingPage.jsx`)
- Facility pages → API client: requests data
- Schedule views → API client: requests data (evidence: `frontend/pages/CalendarPage.jsx`)
- Admin workspace → API client: requests data (evidence: `frontend/pages/AdminSchedulesPage.jsx`)
- Auth context → API client: auth requests (evidence: `frontend/context/AuthContext.jsx`)
- Auth context → Firebase client: uses (evidence: `frontend/context/AuthContext.jsx`)
- API client → Express server: fetches API (evidence: `frontend/services/api.js`)
- Express server → API routes: mounts (evidence: `backend/index.js`)
- API routes → API controllers: dispatches (evidence: `backend/routes/apiRoutes.js`)
- API controllers → Facility workflows: calls (evidence: `backend/controllers/apiControllers.js`)
- API controllers → Reservation workflows: calls (evidence: `backend/controllers/apiControllers.js`)
- API controllers → Maintenance workflows: calls (evidence: `backend/controllers/apiControllers.js`)
- Application wiring → API routes: configures (evidence: `backend/bootstrap/applicationContainer.js`)
- Application wiring → Facility workflows: wires (evidence: `backend/bootstrap/applicationContainer.js`)
- Application wiring → Reservation workflows: wires (evidence: `backend/bootstrap/applicationContainer.js`)
- Application wiring → Schedule workflows: wires (evidence: `backend/bootstrap/applicationContainer.js`)
- Application wiring → Maintenance workflows: wires (evidence: `backend/bootstrap/applicationContainer.js`)
- Application wiring → Admin insights: wires (evidence: `backend/bootstrap/applicationContainer.js`)
- Schedule workflows → Schedule rules: uses rules (evidence: `backend/application/useCases/classScheduleUseCases.js`)
- Reservation workflows → Schedule workflows: uses schedules (evidence: `backend/application/useCases/reservationUseCases.js`)
- Reservation workflows → Reservation rules: uses rules (evidence: `backend/application/useCases/reservationUseCases.js`)
- PostgreSQL repositories → PostgreSQL schema: uses schema (evidence: `backend/database/postgres/repositories.js`)
- Application wiring → PostgreSQL repositories: wires (evidence: `backend/bootstrap/applicationContainer.js`)
- Application wiring → Local JSON repositories: wires (evidence: `backend/bootstrap/applicationContainer.js`)
- Express server → Facility catalog sync: synchronizes catalog (evidence: `backend/index.js`)
- Facility catalog sync → PostgreSQL schema: reads and writes (evidence: `backend/database/facilityCatalogService.js`)
- Facility workflows → PostgreSQL repositories: uses repository
- Reservation workflows → PostgreSQL repositories: uses repository
- Maintenance workflows → PostgreSQL repositories: uses repository
- Admin insights → PostgreSQL repositories: uses repository
