# redward42/web103_unit3_project architecture

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

- Interactive diagram: https://gitdiagram.com/redward42/web103_unit3_project
- Repository: https://github.com/redward42/web103_unit3_project

## Overview

UnityGrid Plaza is a React app for browsing locations and event listings, backed by an Express API and PostgreSQL. The main user flow is browser → location list → location detail route; a separate route shows all events. The README also describes per-location event listings and countdowns, while the sampled detail page implements its own countdown display. The excerpts show server route/controller/database wiring, but do not establish how the client event service reaches the API, so that connection is omitted.

Main entry points: [`client/src/App.jsx`](https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/App.jsx) (App routes), [`server/config/database.js`](https://github.com/RedWARd42/web103_unit3_project/blob/main/server/config/database.js) (Connection pool), [`server/server.js`](https://github.com/RedWARd42/web103_unit3_project/blob/main/server/server.js) (HTTP server), [`client/src/main.jsx`](https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/main.jsx) (Client mount)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_client_entry["Client mount<br/>[main.jsx]"]
  node_app_routes["App routes<br/>[App.jsx]"]
  node_locations_page["Locations page<br/>[Locations.jsx]"]
  node_location_events_page["Location events<br/>[LocationEvents.jsx]"]
  node_events_page["Events page<br/>[Events.jsx]"]
  node_event_component["Event component<br/>[Event.jsx]"]
  node_locations_service["Locations service<br/>[LocationsAPI.jsx]"]
  node_events_service["Events service<br/>[EventsAPI.jsx]"]
end

subgraph group_api["Express API"]
  node_server["HTTP server<br/>[server.js]"]
  node_events_routes["Event routes<br/>[events.js]"]
  node_locations_routes["Location routes<br/>[locations.js]"]
  node_events_controller["Event queries<br/>[events.js]"]
  node_locations_controller["Location queries<br/>[locations.js]"]
end

subgraph group_data["PostgreSQL access"]
  node_pool_config["Connection pool<br/>[database.js]"]
end

node_visitor(("Visitor"))
node_browser["Browser"]
node_postgres[("PostgreSQL")]

node_visitor -->|"uses"| node_browser
node_browser -->|"loads"| node_client_entry
node_client_entry -->|"mounts"| node_app_routes
node_app_routes -->|"routes to"| node_locations_page
node_app_routes -->|"routes to"| node_location_events_page
node_app_routes -->|"routes to"| node_events_page
node_locations_page -->|"fetches via"| node_locations_service
node_server -->|"mounts"| node_events_routes
node_server -->|"mounts"| node_locations_routes
node_events_routes -->|"dispatches"| node_events_controller
node_locations_routes -->|"dispatches"| node_locations_controller
node_events_controller -->|"queries through"| node_pool_config
node_locations_controller -->|"queries through"| node_pool_config
node_pool_config -->|"connects to"| node_postgres

click node_client_entry "https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/main.jsx"
click node_app_routes "https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/App.jsx"
click node_locations_page "https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/pages/Locations.jsx"
click node_location_events_page "https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/pages/LocationEvents.jsx"
click node_events_page "https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/pages/Events.jsx"
click node_event_component "https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/components/Event.jsx"
click node_locations_service "https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/services/LocationsAPI.jsx"
click node_events_service "https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/services/EventsAPI.jsx"
click node_server "https://github.com/RedWARd42/web103_unit3_project/blob/main/server/server.js"
click node_events_routes "https://github.com/RedWARd42/web103_unit3_project/blob/main/server/routes/events.js"
click node_locations_routes "https://github.com/RedWARd42/web103_unit3_project/blob/main/server/routes/locations.js"
click node_events_controller "https://github.com/RedWARd42/web103_unit3_project/blob/main/server/controllers/events.js"
click node_locations_controller "https://github.com/RedWARd42/web103_unit3_project/blob/main/server/controllers/locations.js"
click node_pool_config "https://github.com/RedWARd42/web103_unit3_project/blob/main/server/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_client_entry,node_app_routes,node_locations_page,node_location_events_page,node_events_page,node_event_component,node_locations_service,node_events_service,node_browser toneBlue
class node_server,node_events_routes,node_locations_routes,node_events_controller,node_locations_controller,node_postgres toneAmber
class node_pool_config toneMint
class node_visitor toneIndigo
```

## Components

### React client

- [Client mount](https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/main.jsx): `client/src/main.jsx`
- [App routes](https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Locations page](https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/pages/Locations.jsx): `client/src/pages/Locations.jsx`
- [Location events](https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/pages/LocationEvents.jsx): `client/src/pages/LocationEvents.jsx`
- [Events page](https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/pages/Events.jsx): `client/src/pages/Events.jsx`
- [Event component](https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/components/Event.jsx): `client/src/components/Event.jsx`
- [Locations service](https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/services/LocationsAPI.jsx): `client/src/services/LocationsAPI.jsx`
- [Events service](https://github.com/RedWARd42/web103_unit3_project/blob/main/client/src/services/EventsAPI.jsx): `client/src/services/EventsAPI.jsx`

### Express API

- [HTTP server](https://github.com/RedWARd42/web103_unit3_project/blob/main/server/server.js): `server/server.js`
- [Event routes](https://github.com/RedWARd42/web103_unit3_project/blob/main/server/routes/events.js): `server/routes/events.js`
- [Location routes](https://github.com/RedWARd42/web103_unit3_project/blob/main/server/routes/locations.js): `server/routes/locations.js`
- [Event queries](https://github.com/RedWARd42/web103_unit3_project/blob/main/server/controllers/events.js): `server/controllers/events.js`
- [Location queries](https://github.com/RedWARd42/web103_unit3_project/blob/main/server/controllers/locations.js): `server/controllers/locations.js`

### PostgreSQL access

- [Connection pool](https://github.com/RedWARd42/web103_unit3_project/blob/main/server/config/database.js): `server/config/database.js`

### Other components

- **Visitor**
- **Browser**
- **PostgreSQL**

## Connections

- Visitor → Browser: uses
- Browser → Client mount: loads (evidence: `client/src/main.jsx`)
- Client mount → App routes: mounts (evidence: `client/src/main.jsx`)
- App routes → Locations page: routes to (evidence: `client/src/App.jsx`)
- App routes → Location events: routes to (evidence: `client/src/App.jsx`)
- App routes → Events page: routes to (evidence: `client/src/App.jsx`)
- Locations page → Locations service: fetches via (evidence: `client/src/pages/Locations.jsx`)
- HTTP server → Event routes: mounts (evidence: `server/server.js`)
- HTTP server → Location routes: mounts (evidence: `server/server.js`)
- Event routes → Event queries: dispatches (evidence: `server/routes/events.js`)
- Location routes → Location queries: dispatches (evidence: `server/routes/locations.js`)
- Event queries → Connection pool: queries through (evidence: `server/controllers/events.js`)
- Location queries → Connection pool: queries through (evidence: `server/controllers/locations.js`)
- Connection pool → PostgreSQL: connects to (evidence: `server/config/database.js`)
