# web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management architecture

> Architecture diagram of the GitHub repository web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management
- Repository: https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management

## Overview

Pitch Point is a football-pitch discovery and booking web application, but the sampled implementation is an early-stage prototype: search and featured listings use in-browser sample data, while the API provides generic item CRUD and account authentication. The visible customer flow is home/search → pitch listings → pitch detail; registration/login provides a token-backed session. README capabilities such as bookings, payments, reviews, operator management, statistics, notifications, and role-based administration are documented future/product scope, but no corresponding runtime modules appear in the supplied tree. Frontend page wiring is based on the tree and excerpts; unsampled routes are represented only where paths are certain.

Main entry points: [`backend/routers/auth.py`](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/routers/auth.py) (Authentication routes), [`frontend/js/api.js`](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/api.js) (API client), [`backend/deps.py`](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/deps.py) (Identity dependency), [`backend/database.py`](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/database.py) (SQL database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Pitch discovery"]
  node_home["Home and featured pitches<br/>[home.js]"]
  node_search["Pitch search<br/>[search.js]"]
  node_pitchdata["Sample pitch data<br/>[pitches.js]"]
  node_pitchdetail["Pitch detail page<br/>[pitch-detail.js]"]
end

subgraph group_accounts["Accounts"]
  node_registerpage["Registration page<br/>[register.js]"]
  node_loginpage["Login page<br/>[login.js]"]
  node_session["Session and header state<br/>[auth.js]"]
end

subgraph group_api["Backend API"]
  node_api_client["API client<br/>[api.js]"]
  node_fastapi["API application<br/>[main.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_item_routes["Item routes<br/>[items.py]"]
end

subgraph group_state["Persistence and security"]
  node_identity["Identity dependency<br/>[deps.py]"]
  node_security["Password and JWT<br/>[security.py]"]
  node_models["User and item models<br/>[models.py]"]
  node_database[("SQL database<br/>[database.py]")]
end

node_customer(("Customer"))
node_api_service(("API service"))

node_customer -->|"opens"| node_home
node_customer -->|"searches"| node_search
node_customer -->|"registers"| node_registerpage
node_customer -->|"signs in"| node_loginpage
node_home -->|"renders samples"| node_pitchdata
node_search -->|"filters samples"| node_pitchdata
node_search -->|"opens pitch"| node_pitchdetail
node_registerpage -->|"registers via"| node_api_client
node_loginpage -->|"authenticates via"| node_api_client
node_api_client -->|"reads token"| node_session
node_api_client -->|"HTTP requests"| node_api_service
node_api_service -->|"serves"| node_fastapi
node_fastapi -->|"dispatches"| node_auth_routes
node_fastapi -->|"dispatches"| node_item_routes
node_auth_routes -->|"reads/writes users"| node_database
node_auth_routes -->|"hashes and issues tokens"| node_security
node_auth_routes -->|"uses identity"| node_identity
node_item_routes -->|"reads/writes items"| node_database
node_item_routes -->|"checks current user"| node_identity
node_identity -->|"decodes token"| node_security
node_identity -->|"loads user"| node_database
node_database -->|"maps records"| node_models

click node_home "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/pages/home.js"
click node_search "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/pages/search.js"
click node_pitchdata "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/data/pitches.js"
click node_pitchdetail "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/pages/pitch-detail.js"
click node_registerpage "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/pages/register.js"
click node_loginpage "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/pages/login.js"
click node_session "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/auth.js"
click node_api_client "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/api.js"
click node_fastapi "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/main.py"
click node_auth_routes "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/routers/auth.py"
click node_item_routes "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/routers/items.py"
click node_identity "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/deps.py"
click node_security "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/security.py"
click node_models "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/models.py"
click node_database "https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/database.py"

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_home,node_search,node_pitchdata,node_pitchdetail toneBlue
class node_registerpage,node_loginpage,node_session toneAmber
class node_api_client,node_fastapi,node_auth_routes,node_item_routes,node_api_service toneMint
class node_identity,node_security,node_models,node_database toneRose
class node_customer toneIndigo
```

## Components

### Pitch discovery

- [Home and featured pitches](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/pages/home.js): `frontend/js/pages/home.js`
- [Pitch search](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/pages/search.js): `frontend/js/pages/search.js`
- [Sample pitch data](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/data/pitches.js): `frontend/js/data/pitches.js`
- [Pitch detail page](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/pages/pitch-detail.js): `frontend/js/pages/pitch-detail.js`

### Accounts

- [Registration page](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/pages/register.js): `frontend/js/pages/register.js`
- [Login page](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/pages/login.js): `frontend/js/pages/login.js`
- [Session and header state](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/auth.js): `frontend/js/auth.js`

### Backend API

- [API client](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/frontend/js/api.js): `frontend/js/api.js`
- [API application](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/main.py): `backend/main.py`
- [Authentication routes](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/routers/auth.py): `backend/routers/auth.py`
- [Item routes](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/routers/items.py): `backend/routers/items.py`

### Persistence and security

- [Identity dependency](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/deps.py): `backend/deps.py`
- [Password and JWT](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/security.py): `backend/security.py`
- [User and item models](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/models.py): `backend/models.py`
- [SQL database](https://github.com/web-fda-neu/ai66b--g6--topic-b2--pitch-reservation-management/blob/main/backend/database.py): `backend/database.py`

### Other components

- **Customer**
- **API service**

## Connections

- Customer → Home and featured pitches: opens
- Customer → Pitch search: searches
- Customer → Registration page: registers
- Customer → Login page: signs in
- Home and featured pitches → Sample pitch data: renders samples
- Pitch search → Sample pitch data: filters samples
- Pitch search → Pitch detail page: opens pitch
- Registration page → API client: registers via
- Login page → API client: authenticates via
- API client → Session and header state: reads token
- API client → API service: HTTP requests
- API service → API application: serves
- API application → Authentication routes: dispatches
- API application → Item routes: dispatches
- Authentication routes → SQL database: reads/writes users
- Authentication routes → Password and JWT: hashes and issues tokens
- Authentication routes → Identity dependency: uses identity
- Item routes → SQL database: reads/writes items
- Item routes → Identity dependency: checks current user
- Identity dependency → Password and JWT: decodes token
- Identity dependency → SQL database: loads user
- SQL database → User and item models: maps records
