# ritika0510/board-game_night-planner architecture

> Architecture diagram of the GitHub repository ritika0510/board-game_night-planner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ritika0510/board-game_night-planner
- Repository: https://github.com/ritika0510/board-game_night-planner

## Overview

BoardNight is a board-game collection and game-night coordination application. Users enter through the React client, navigate to account and planning pages, and—where shown—those pages call the Express API; route handlers query PostgreSQL. The graph preserves the documented authentication, borrowing, profile, and audit capabilities, but source excerpts do not show every page’s API calls. The tree also lists `games.route.js` while `src/app.js` imports `games.routes.js`, so that route mount is not mapped as a confirmed connection.

Main entry points: [`frontend/src/App.jsx`](https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/App.jsx) (Page router), [`src/routes/auth.routes.js`](https://github.com/ritika0510/board-game_night-planner/blob/main/src/routes/auth.routes.js) (Authentication & audit), [`src/app.js`](https://github.com/ritika0510/board-game_night-planner/blob/main/src/app.js) (Express app), [`src/db.js`](https://github.com/ritika0510/board-game_night-planner/blob/main/src/db.js) (PostgreSQL pool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Page router<br/>[App.jsx]"]
  node_home["Home<br/>[Home.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_signup["Signup<br/>[Signup.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_collection["Game collection<br/>[MyGames.jsx]"]
  node_borrowed["Borrowed games<br/>[Borrowed.jsx]"]
  node_planner["Game planner<br/>[GamePlanner.jsx]"]
  node_profile["Profile &amp; security<br/>[Profile.jsx]"]
end

subgraph group_api["REST API"]
  node_server["HTTP server<br/>[server.js]"]
  node_express["Express app<br/>[app.js]"]
  node_auth["Authentication &amp; audit<br/>[auth.routes.js]"]
  node_games["Collection routes<br/>[games.route.js]"]
  node_nights["Game-night routes"]
  node_errors["Error handler<br/>[errorHandler.js]"]
end

subgraph group_data["Persistence"]
  node_pool["PostgreSQL pool<br/>[db.js]"]
  node_postgres[("PostgreSQL")]
end

node_user(("BoardNight user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_signup
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_collection
node_app -->|"routes to"| node_planner
node_app -->|"routes to"| node_borrowed
node_app -->|"routes to"| node_profile
node_server -->|"starts"| node_express
node_collection -->|"calls API"| node_games
node_planner -->|"calls API"| node_nights
node_profile -->|"changes password"| node_auth
node_login -.->|"authenticates"| node_auth
node_signup -.->|"registers"| node_auth
node_profile -.->|"requests audit history"| node_auth
node_express -->|"mounts routes"| node_auth
node_express -->|"mounts routes"| node_nights
node_express -->|"handles errors"| node_errors
node_auth -->|"queries"| node_pool
node_nights -->|"queries"| node_pool
node_games -->|"queries"| node_pool
node_pool -->|"accesses"| node_postgres

click node_app "https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Home.jsx"
click node_login "https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Login.jsx"
click node_signup "https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Signup.jsx"
click node_dashboard "https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Dashboard.jsx"
click node_collection "https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/MyGames.jsx"
click node_borrowed "https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Borrowed.jsx"
click node_planner "https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/GamePlanner.jsx"
click node_profile "https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Profile.jsx"
click node_server "https://github.com/ritika0510/board-game_night-planner/blob/main/src/server.js"
click node_express "https://github.com/ritika0510/board-game_night-planner/blob/main/src/app.js"
click node_auth "https://github.com/ritika0510/board-game_night-planner/blob/main/src/routes/auth.routes.js"
click node_games "https://github.com/ritika0510/board-game_night-planner/blob/main/src/routes/games.route.js"
click node_nights "https://github.com/ritika0510/board-game_night-planner/blob/main/src/routes/gameNights.routes.js"
click node_errors "https://github.com/ritika0510/board-game_night-planner/blob/main/src/middleware/errorHandler.js"
click node_pool "https://github.com/ritika0510/board-game_night-planner/blob/main/src/db.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_home,node_login,node_signup,node_dashboard,node_collection,node_borrowed,node_planner,node_profile,node_user toneBlue
class node_server,node_express,node_auth,node_games,node_nights,node_errors toneAmber
class node_pool,node_postgres toneMint
```

## Components

### React client

- [Page router](https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home](https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Login](https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Signup](https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Signup.jsx): `frontend/src/pages/Signup.jsx`
- [Dashboard](https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Game collection](https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/MyGames.jsx): `frontend/src/pages/MyGames.jsx`
- [Borrowed games](https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Borrowed.jsx): `frontend/src/pages/Borrowed.jsx`
- [Game planner](https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/GamePlanner.jsx): `frontend/src/pages/GamePlanner.jsx`
- [Profile & security](https://github.com/ritika0510/board-game_night-planner/blob/main/frontend/src/pages/Profile.jsx): `frontend/src/pages/Profile.jsx`

### REST API

- [HTTP server](https://github.com/ritika0510/board-game_night-planner/blob/main/src/server.js): `src/server.js`
- [Express app](https://github.com/ritika0510/board-game_night-planner/blob/main/src/app.js): `src/app.js`
- [Authentication & audit](https://github.com/ritika0510/board-game_night-planner/blob/main/src/routes/auth.routes.js): `src/routes/auth.routes.js`
- [Collection routes](https://github.com/ritika0510/board-game_night-planner/blob/main/src/routes/games.route.js): `src/routes/games.route.js`
- [Game-night routes](https://github.com/ritika0510/board-game_night-planner/blob/main/src/routes/gameNights.routes.js): `src/routes/gameNights.routes.js`
- [Error handler](https://github.com/ritika0510/board-game_night-planner/blob/main/src/middleware/errorHandler.js): `src/middleware/errorHandler.js`

### Persistence

- [PostgreSQL pool](https://github.com/ritika0510/board-game_night-planner/blob/main/src/db.js): `src/db.js`
- **PostgreSQL**

### Other components

- **BoardNight user**

## Connections

- BoardNight user → Page router: uses (evidence: `frontend/src/App.jsx`)
- Page router → Home: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Login: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Signup: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Game collection: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Game planner: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Borrowed games: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Profile & security: routes to (evidence: `frontend/src/App.jsx`)
- HTTP server → Express app: starts (evidence: `src/server.js`)
- Game collection → Collection routes: calls API (evidence: `frontend/src/pages/MyGames.jsx`)
- Game planner → Game-night routes: calls API (evidence: `frontend/src/pages/GamePlanner.jsx`)
- Profile & security → Authentication & audit: changes password (evidence: `frontend/src/pages/Profile.jsx`)
- Login → Authentication & audit: authenticates (evidence: `README.md`)
- Signup → Authentication & audit: registers (evidence: `README.md`)
- Profile & security → Authentication & audit: requests audit history (evidence: `README.md`)
- Express app → Authentication & audit: mounts routes (evidence: `src/app.js`)
- Express app → Game-night routes: mounts routes (evidence: `src/app.js`)
- Express app → Error handler: handles errors (evidence: `src/app.js`)
- Authentication & audit → PostgreSQL pool: queries (evidence: `src/routes/auth.routes.js`)
- Game-night routes → PostgreSQL pool: queries (evidence: `src/routes/gameNights.routes.js`)
- Collection routes → PostgreSQL pool: queries (evidence: `src/routes/games.route.js`)
- PostgreSQL pool → PostgreSQL: accesses (evidence: `src/db.js`)
