# huy2451220013/cnpm_24ct2 architecture

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

- Interactive diagram: https://gitdiagram.com/huy2451220013/cnpm_24ct2
- Repository: https://github.com/huy2451220013/cnpm_24ct2

## Overview

PicklePro is a Django system for managing pickleball courts and online bookings. Customers can register or sign in, find and inspect courts, check schedules, submit bookings, view booking details and VietQR payment instructions, and look up or cancel bookings. Staff manage bookings and court status. The graph includes account, court, booking, and operations stages; templates are shown as the presentation layer. Relationships are limited to the excerpts and README; unsampled routing and runtime database configuration are not inferred.

Main entry points: [`PicklePro/bookings/models.py`](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/models.py) (Booking Records), [`PicklePro/courts/views.py`](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/courts/views.py) (Court Discovery), [`PicklePro/bookings/views.py`](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/views.py) (Booking Actions), [`PicklePro/courts/models.py`](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/courts/models.py) (Court Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts"]
  node_account_views["Account Access<br/>[views.py]"]
  node_profile["Member Profile<br/>[models.py]"]
end

subgraph group_courts["Court Discovery"]
  node_court_views["Court Discovery<br/>[views.py]"]
  node_court_model["Court Catalog<br/>[models.py]"]
  node_schedule["Court Schedules<br/>[views.py]"]
end

subgraph group_bookings["Booking Lifecycle"]
  node_booking_views["Booking Actions<br/>[views.py]"]
  node_booking_model["Booking Records<br/>[models.py]"]
  node_booking_ticket["Booking Ticket<br/>[views.py]"]
  node_booking_lookup["Booking Lookup<br/>[views.py]"]
  node_vietqr{{"VietQR Image Service"}}
end

subgraph group_operations["Venue Operations"]
  node_admin_ops["Booking Operations<br/>[views.py]"]
  node_seed_data["Sample Data Seeder<br/>[seed_data.py]"]
end

subgraph group_presentation["Presentation"]
  node_account_templates["Account Pages"]
  node_court_templates["Court Pages"]
  node_booking_templates["Booking Pages"]
  node_dashboard_template["Dashboard Page<br/>[dashboard.html]"]
end

node_customer(("Customer"))
node_staff(("Staff"))

node_customer -.->|"uses accounts"| node_account_views
node_account_views -->|"reads and updates"| node_profile
node_account_views -->|"reads bookings"| node_booking_model
node_account_views -->|"renders pages"| node_account_templates
node_customer -.->|"browses courts"| node_court_views
node_court_views -->|"queries courts"| node_court_model
node_court_views -->|"queries bookings"| node_booking_model
node_court_views -->|"renders court pages"| node_court_templates
node_court_views -->|"renders dashboard"| node_dashboard_template
node_customer -.->|"checks availability"| node_schedule
node_schedule -->|"queries courts"| node_court_model
node_schedule -->|"queries bookings"| node_booking_model
node_schedule -->|"renders schedule"| node_court_templates
node_customer -.->|"submits booking"| node_booking_views
node_booking_views -->|"loads court"| node_court_model
node_booking_views -->|"checks and saves"| node_booking_model
node_booking_views -->|"renders booking pages"| node_booking_templates
node_booking_views -->|"redirects to ticket"| node_booking_ticket
node_booking_ticket -->|"loads booking"| node_booking_model
node_booking_ticket -->|"builds QR image URL"| node_vietqr
node_booking_lookup -->|"queries bookings"| node_booking_model
node_booking_lookup -->|"renders booking list"| node_booking_templates
node_staff -.->|"manages bookings"| node_admin_ops
node_admin_ops -->|"updates bookings"| node_booking_model
node_admin_ops -->|"queries courts"| node_court_model
node_admin_ops -->|"renders operations page"| node_booking_templates
node_seed_data -->|"creates sample courts"| node_court_model
node_seed_data -->|"creates sample bookings"| node_booking_model
node_seed_data -->|"creates sample profiles"| node_profile

click node_account_views "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/accounts/views.py"
click node_profile "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/accounts/models.py"
click node_court_views "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/courts/views.py"
click node_court_model "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/courts/models.py"
click node_schedule "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/courts/views.py"
click node_booking_views "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/views.py"
click node_booking_model "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/models.py"
click node_booking_ticket "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/views.py"
click node_booking_lookup "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/views.py"
click node_admin_ops "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/views.py"
click node_seed_data "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/courts/management/commands/seed_data.py"
click node_account_templates "https://github.com/huy2451220013/cnpm_24ct2/tree/main/PicklePro/templates/accounts"
click node_court_templates "https://github.com/huy2451220013/cnpm_24ct2/tree/main/PicklePro/templates/courts"
click node_booking_templates "https://github.com/huy2451220013/cnpm_24ct2/tree/main/PicklePro/templates/bookings"
click node_dashboard_template "https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/templates/dashboard.html"

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_account_views,node_profile toneBlue
class node_court_views,node_court_model,node_schedule toneAmber
class node_booking_views,node_booking_model,node_booking_ticket,node_booking_lookup,node_vietqr toneMint
class node_admin_ops,node_seed_data toneRose
class node_account_templates,node_court_templates,node_booking_templates,node_dashboard_template,node_customer,node_staff toneIndigo
```

## Components

### Accounts

- [Account Access](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/accounts/views.py): `PicklePro/accounts/views.py`
- [Member Profile](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/accounts/models.py): `PicklePro/accounts/models.py`

### Court Discovery

- [Court Discovery](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/courts/views.py): `PicklePro/courts/views.py`
- [Court Catalog](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/courts/models.py): `PicklePro/courts/models.py`
- [Court Schedules](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/courts/views.py): `PicklePro/courts/views.py`

### Booking Lifecycle

- [Booking Actions](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/views.py): `PicklePro/bookings/views.py`
- [Booking Records](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/models.py): `PicklePro/bookings/models.py`
- [Booking Ticket](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/views.py): `PicklePro/bookings/views.py`
- [Booking Lookup](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/views.py): `PicklePro/bookings/views.py`
- **VietQR Image Service**

### Venue Operations

- [Booking Operations](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/bookings/views.py): `PicklePro/bookings/views.py`
- [Sample Data Seeder](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/courts/management/commands/seed_data.py): `PicklePro/courts/management/commands/seed_data.py`

### Presentation

- [Account Pages](https://github.com/huy2451220013/cnpm_24ct2/tree/main/PicklePro/templates/accounts): `PicklePro/templates/accounts`
- [Court Pages](https://github.com/huy2451220013/cnpm_24ct2/tree/main/PicklePro/templates/courts): `PicklePro/templates/courts`
- [Booking Pages](https://github.com/huy2451220013/cnpm_24ct2/tree/main/PicklePro/templates/bookings): `PicklePro/templates/bookings`
- [Dashboard Page](https://github.com/huy2451220013/cnpm_24ct2/blob/main/PicklePro/templates/dashboard.html): `PicklePro/templates/dashboard.html`

### Other components

- **Customer**
- **Staff**

## Connections

- Customer → Account Access: uses accounts
- Account Access → Member Profile: reads and updates (evidence: `PicklePro/accounts/views.py`)
- Account Access → Booking Records: reads bookings (evidence: `PicklePro/accounts/views.py`)
- Account Access → Account Pages: renders pages (evidence: `PicklePro/accounts/views.py`)
- Customer → Court Discovery: browses courts
- Court Discovery → Court Catalog: queries courts (evidence: `PicklePro/courts/views.py`)
- Court Discovery → Booking Records: queries bookings (evidence: `PicklePro/courts/views.py`)
- Court Discovery → Court Pages: renders court pages (evidence: `PicklePro/courts/views.py`)
- Court Discovery → Dashboard Page: renders dashboard (evidence: `PicklePro/courts/views.py`)
- Customer → Court Schedules: checks availability
- Court Schedules → Court Catalog: queries courts (evidence: `PicklePro/courts/views.py`)
- Court Schedules → Booking Records: queries bookings (evidence: `PicklePro/courts/views.py`)
- Court Schedules → Court Pages: renders schedule (evidence: `PicklePro/courts/views.py`)
- Customer → Booking Actions: submits booking
- Booking Actions → Court Catalog: loads court (evidence: `PicklePro/bookings/views.py`)
- Booking Actions → Booking Records: checks and saves (evidence: `PicklePro/bookings/views.py`)
- Booking Actions → Booking Pages: renders booking pages (evidence: `PicklePro/bookings/views.py`)
- Booking Actions → Booking Ticket: redirects to ticket (evidence: `PicklePro/bookings/views.py`)
- Booking Ticket → Booking Records: loads booking (evidence: `PicklePro/bookings/views.py`)
- Booking Ticket → VietQR Image Service: builds QR image URL (evidence: `PicklePro/bookings/views.py`)
- Booking Lookup → Booking Records: queries bookings (evidence: `PicklePro/bookings/views.py`)
- Booking Lookup → Booking Pages: renders booking list (evidence: `PicklePro/bookings/views.py`)
- Staff → Booking Operations: manages bookings
- Booking Operations → Booking Records: updates bookings (evidence: `PicklePro/bookings/views.py`)
- Booking Operations → Court Catalog: queries courts (evidence: `PicklePro/bookings/views.py`)
- Booking Operations → Booking Pages: renders operations page (evidence: `PicklePro/bookings/views.py`)
- Sample Data Seeder → Court Catalog: creates sample courts (evidence: `PicklePro/courts/management/commands/seed_data.py`)
- Sample Data Seeder → Booking Records: creates sample bookings (evidence: `PicklePro/courts/management/commands/seed_data.py`)
- Sample Data Seeder → Member Profile: creates sample profiles (evidence: `PicklePro/courts/management/commands/seed_data.py`)
