# batistedecat/test-app-project architecture

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

- Interactive diagram: https://gitdiagram.com/batistedecat/test-app-project
- Repository: https://github.com/batistedecat/test-app-project

## Overview

A small Flask cycling-route shop: visitors browse and inspect routes, sign in, add routes to a session cart, complete simulated checkout, then view and download purchased GPX files; admins inspect orders and sales. The graph also preserves route seeding and GPX difficulty calculation. Calls between the app, route handlers, database layer, and GPX utilities are shown from excerpts; the templates and schema are documented capabilities, but their individual wiring is not fully sampled.

Main entry points: [`routes.py`](https://github.com/batistedecat/test-app-project/blob/main/routes.py) (Page handlers), [`seed.py`](https://github.com/batistedecat/test-app-project/blob/main/seed.py) (Demo data seeding), [`app.py`](https://github.com/batistedecat/test-app-project/blob/main/app.py) (Flask app), [`gpx_utils.py`](https://github.com/batistedecat/test-app-project/blob/main/gpx_utils.py) (GPX processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask app<br/>[app.py]"]
  node_handlers["Page handlers<br/>[routes.py]"]
  node_page_views["Page templates"]
end

subgraph group_commerce["Route commerce"]
  node_route_browse["Route browsing<br/>[routes.py]"]
  node_account["Username login<br/>[routes.py]"]
  node_cart_checkout["Cart and checkout<br/>[routes.py]"]
  node_owned_routes["Owned routes<br/>[routes.py]"]
  node_gpx_download["GPX downloads<br/>[routes.py]"]
  node_admin_sales["Admin sales<br/>[routes.py]"]
end

subgraph group_route_data["Route data"]
  node_gpx_files["GPX route files"]
  node_gpx_processing["GPX processing<br/>[gpx_utils.py]"]
  node_route_metrics["Route metrics<br/>[gpx_utils.py]"]
  node_seed_data["Demo data seeding<br/>[seed.py]"]
end

subgraph group_persistence["Persistence"]
  node_database[("Shop database<br/>[db.py]")]
  node_schema["Shop schema<br/>[schema.sql]"]
end

node_browser(("Cycling customer"))
node_admin_actor(("Shop admin"))

node_browser -->|"sends requests"| node_app
node_admin_actor -->|"sends requests"| node_app
node_app -->|"registers routes"| node_handlers
node_handlers -->|"queries"| node_database
node_handlers -->|"calls"| node_gpx_processing
node_handlers -->|"reads and serves"| node_gpx_files
node_handlers -->|"renders"| node_page_views
node_handlers -->|"dispatches"| node_route_browse
node_handlers -->|"dispatches"| node_account
node_handlers -->|"dispatches"| node_cart_checkout
node_handlers -->|"dispatches"| node_owned_routes
node_handlers -->|"dispatches"| node_gpx_download
node_handlers -->|"dispatches"| node_admin_sales
node_gpx_processing -->|"computes"| node_route_metrics
node_seed_data -->|"writes"| node_gpx_files
node_seed_data -->|"calls"| node_gpx_processing
node_seed_data -->|"executes"| node_schema
node_seed_data -.->|"populates"| node_database

click node_app "https://github.com/batistedecat/test-app-project/blob/main/app.py"
click node_handlers "https://github.com/batistedecat/test-app-project/blob/main/routes.py"
click node_page_views "https://github.com/batistedecat/test-app-project/tree/main/templates"
click node_route_browse "https://github.com/batistedecat/test-app-project/blob/main/routes.py"
click node_account "https://github.com/batistedecat/test-app-project/blob/main/routes.py"
click node_cart_checkout "https://github.com/batistedecat/test-app-project/blob/main/routes.py"
click node_owned_routes "https://github.com/batistedecat/test-app-project/blob/main/routes.py"
click node_gpx_download "https://github.com/batistedecat/test-app-project/blob/main/routes.py"
click node_admin_sales "https://github.com/batistedecat/test-app-project/blob/main/routes.py"
click node_gpx_files "https://github.com/batistedecat/test-app-project/tree/main/gpx"
click node_gpx_processing "https://github.com/batistedecat/test-app-project/blob/main/gpx_utils.py"
click node_route_metrics "https://github.com/batistedecat/test-app-project/blob/main/gpx_utils.py"
click node_seed_data "https://github.com/batistedecat/test-app-project/blob/main/seed.py"
click node_database "https://github.com/batistedecat/test-app-project/blob/main/db.py"
click node_schema "https://github.com/batistedecat/test-app-project/blob/main/schema.sql"

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_handlers,node_page_views toneBlue
class node_route_browse,node_account,node_cart_checkout,node_owned_routes,node_gpx_download,node_admin_sales toneAmber
class node_gpx_files,node_gpx_processing,node_route_metrics,node_seed_data toneMint
class node_database,node_schema toneRose
class node_browser,node_admin_actor toneIndigo
```

## Components

### Web application

- [Flask app](https://github.com/batistedecat/test-app-project/blob/main/app.py): `app.py`
- [Page handlers](https://github.com/batistedecat/test-app-project/blob/main/routes.py): `routes.py`
- [Page templates](https://github.com/batistedecat/test-app-project/tree/main/templates): `templates`

### Route commerce

- [Route browsing](https://github.com/batistedecat/test-app-project/blob/main/routes.py): `routes.py`
- [Username login](https://github.com/batistedecat/test-app-project/blob/main/routes.py): `routes.py`
- [Cart and checkout](https://github.com/batistedecat/test-app-project/blob/main/routes.py): `routes.py`
- [Owned routes](https://github.com/batistedecat/test-app-project/blob/main/routes.py): `routes.py`
- [GPX downloads](https://github.com/batistedecat/test-app-project/blob/main/routes.py): `routes.py`
- [Admin sales](https://github.com/batistedecat/test-app-project/blob/main/routes.py): `routes.py`

### Route data

- [GPX route files](https://github.com/batistedecat/test-app-project/tree/main/gpx): `gpx`
- [GPX processing](https://github.com/batistedecat/test-app-project/blob/main/gpx_utils.py): `gpx_utils.py`
- [Route metrics](https://github.com/batistedecat/test-app-project/blob/main/gpx_utils.py): `gpx_utils.py`
- [Demo data seeding](https://github.com/batistedecat/test-app-project/blob/main/seed.py): `seed.py`

### Persistence

- [Shop database](https://github.com/batistedecat/test-app-project/blob/main/db.py): `db.py`
- [Shop schema](https://github.com/batistedecat/test-app-project/blob/main/schema.sql): `schema.sql`

### Other components

- **Cycling customer**
- **Shop admin**

## Connections

- Cycling customer → Flask app: sends requests (evidence: `README.md`)
- Shop admin → Flask app: sends requests (evidence: `README.md`)
- Flask app → Page handlers: registers routes (evidence: `app.py`)
- Page handlers → Shop database: queries (evidence: `routes.py`)
- Page handlers → GPX processing: calls (evidence: `routes.py`)
- Page handlers → GPX route files: reads and serves (evidence: `routes.py`)
- Page handlers → Page templates: renders (evidence: `README.md`)
- Page handlers → Route browsing: dispatches (evidence: `routes.py`)
- Page handlers → Username login: dispatches (evidence: `routes.py`)
- Page handlers → Cart and checkout: dispatches (evidence: `routes.py`)
- Page handlers → Owned routes: dispatches (evidence: `routes.py`)
- Page handlers → GPX downloads: dispatches (evidence: `routes.py`)
- Page handlers → Admin sales: dispatches (evidence: `routes.py`)
- GPX processing → Route metrics: computes (evidence: `gpx_utils.py`)
- Demo data seeding → GPX route files: writes (evidence: `seed.py`)
- Demo data seeding → GPX processing: calls (evidence: `seed.py`)
- Demo data seeding → Shop schema: executes (evidence: `seed.py`)
- Demo data seeding → Shop database: populates
