# huny4daniel/pedal-point architecture

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

- Interactive diagram: https://gitdiagram.com/huny4daniel/pedal-point
- Repository: https://github.com/huny4daniel/pedal-point

## Overview

Pedal Point is a public-bike rental service that turns ride distance into carbon-savings mileage, usable as a discount on a later payment. The user workflow is login, find a station and rent a bike, return it with a distance entry, then settle the fare and earn mileage; the mypage shows history and accumulated savings. Administrators manage stations, bikes and members, and search operational records and statistics. The Android app is a WebView client for the Streamlit server. The graph follows documented behavior and sampled calls; unsampled screens are included as documented capabilities, with edges limited to supported relationships.

Main entry points: [`app/main.py`](https://github.com/huny4daniel/pedal-point/blob/main/app/main.py) (Streamlit app), [`app/user_ops.py`](https://github.com/huny4daniel/pedal-point/blob/main/app/user_ops.py) (Rider operations), [`app/admin_ops.py`](https://github.com/huny4daniel/pedal-point/blob/main/app/admin_ops.py) (Admin operations), [`app/views/login.py`](https://github.com/huny4daniel/pedal-point/blob/main/app/views/login.py) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Clients and routing"]
  node_android_client["Android WebView<br/>[MainActivity.kt]"]
  node_streamlit_app["Streamlit app<br/>[main.py]"]
  node_shared_ui["Shared UI<br/>[ui.py]"]
end

subgraph group_user["Rider services"]
  node_login["Login<br/>[login.py]"]
  node_rental_screen["Station search and rental<br/>[user_rent.py]"]
  node_return_screen["Return and payment<br/>[user_return.py]"]
  node_mypage["Rider history and stats<br/>[user_mypage.py]"]
  node_rider_ops["Rider operations<br/>[user_ops.py]"]
end

subgraph group_admin["Administration"]
  node_station_bike_admin["Station and bike management<br/>[admin_assets.py]"]
  node_admin_history["Record search<br/>[admin_history.py]"]
  node_member_admin["Member management and stats<br/>[admin_members.py]"]
  node_admin_ops["Admin operations<br/>[admin_ops.py]"]
end

subgraph group_core["Rules and persistence"]
  node_business_rules["Fare and mileage rules<br/>[rules.py]"]
  node_db_access["Database access<br/>[db.py]"]
  node_padal_db[("Padal MySQL database<br/>[schema.sql]")]
end

node_riders(("Riders"))
node_administrators(("Administrators"))

node_riders -->|"use app"| node_android_client
node_riders -->|"use web"| node_streamlit_app
node_administrators -->|"use web"| node_streamlit_app
node_android_client -->|"loads server UI"| node_streamlit_app
node_streamlit_app -->|"detects mode and styles"| node_shared_ui
node_streamlit_app -->|"routes to"| node_login
node_streamlit_app -->|"routes to"| node_rental_screen
node_streamlit_app -->|"routes to"| node_return_screen
node_streamlit_app -->|"routes to"| node_mypage
node_streamlit_app -->|"routes to"| node_station_bike_admin
node_streamlit_app -->|"routes to"| node_admin_history
node_streamlit_app -->|"routes to"| node_member_admin
node_login -->|"loads rider accounts"| node_rider_ops
node_login -->|"loads staff accounts"| node_admin_ops
node_rental_screen -->|"searches and rents"| node_rider_ops
node_return_screen -->|"returns and pays"| node_rider_ops
node_return_screen -->|"previews fare and mileage"| node_business_rules
node_mypage -->|"loads histories and totals"| node_rider_ops
node_mypage -->|"formats rule values"| node_business_rules
node_station_bike_admin -->|"manages assets"| node_admin_ops
node_admin_history -->|"searches records"| node_admin_ops
node_member_admin -->|"manages members"| node_admin_ops
node_rider_ops -->|"calculates charges and points"| node_business_rules
node_rider_ops -->|"queries and transacts"| node_db_access
node_admin_ops -->|"queries and transacts"| node_db_access
node_db_access -->|"connects and persists"| node_padal_db

click node_android_client "https://github.com/huny4daniel/pedal-point/blob/main/android/app/src/main/java/kr/pedalpoint/app/MainActivity.kt"
click node_streamlit_app "https://github.com/huny4daniel/pedal-point/blob/main/app/main.py"
click node_shared_ui "https://github.com/huny4daniel/pedal-point/blob/main/app/ui.py"
click node_login "https://github.com/huny4daniel/pedal-point/blob/main/app/views/login.py"
click node_rental_screen "https://github.com/huny4daniel/pedal-point/blob/main/app/views/user_rent.py"
click node_return_screen "https://github.com/huny4daniel/pedal-point/blob/main/app/views/user_return.py"
click node_mypage "https://github.com/huny4daniel/pedal-point/blob/main/app/views/user_mypage.py"
click node_rider_ops "https://github.com/huny4daniel/pedal-point/blob/main/app/user_ops.py"
click node_station_bike_admin "https://github.com/huny4daniel/pedal-point/blob/main/app/views/admin_assets.py"
click node_admin_history "https://github.com/huny4daniel/pedal-point/blob/main/app/views/admin_history.py"
click node_member_admin "https://github.com/huny4daniel/pedal-point/blob/main/app/views/admin_members.py"
click node_admin_ops "https://github.com/huny4daniel/pedal-point/blob/main/app/admin_ops.py"
click node_business_rules "https://github.com/huny4daniel/pedal-point/blob/main/app/rules.py"
click node_db_access "https://github.com/huny4daniel/pedal-point/blob/main/app/db.py"
click node_padal_db "https://github.com/huny4daniel/pedal-point/blob/main/db/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_android_client,node_streamlit_app,node_shared_ui toneBlue
class node_login,node_rental_screen,node_return_screen,node_mypage,node_rider_ops toneAmber
class node_station_bike_admin,node_admin_history,node_member_admin,node_admin_ops toneMint
class node_business_rules,node_db_access,node_padal_db toneRose
class node_riders,node_administrators toneIndigo
```

## Components

### Clients and routing

- [Android WebView](https://github.com/huny4daniel/pedal-point/blob/main/android/app/src/main/java/kr/pedalpoint/app/MainActivity.kt): `android/app/src/main/java/kr/pedalpoint/app/MainActivity.kt`
- [Streamlit app](https://github.com/huny4daniel/pedal-point/blob/main/app/main.py): `app/main.py`
- [Shared UI](https://github.com/huny4daniel/pedal-point/blob/main/app/ui.py): `app/ui.py`

### Rider services

- [Login](https://github.com/huny4daniel/pedal-point/blob/main/app/views/login.py): `app/views/login.py`
- [Station search and rental](https://github.com/huny4daniel/pedal-point/blob/main/app/views/user_rent.py): `app/views/user_rent.py`
- [Return and payment](https://github.com/huny4daniel/pedal-point/blob/main/app/views/user_return.py): `app/views/user_return.py`
- [Rider history and stats](https://github.com/huny4daniel/pedal-point/blob/main/app/views/user_mypage.py): `app/views/user_mypage.py`
- [Rider operations](https://github.com/huny4daniel/pedal-point/blob/main/app/user_ops.py): `app/user_ops.py`

### Administration

- [Station and bike management](https://github.com/huny4daniel/pedal-point/blob/main/app/views/admin_assets.py): `app/views/admin_assets.py`
- [Record search](https://github.com/huny4daniel/pedal-point/blob/main/app/views/admin_history.py): `app/views/admin_history.py`
- [Member management and stats](https://github.com/huny4daniel/pedal-point/blob/main/app/views/admin_members.py): `app/views/admin_members.py`
- [Admin operations](https://github.com/huny4daniel/pedal-point/blob/main/app/admin_ops.py): `app/admin_ops.py`

### Rules and persistence

- [Fare and mileage rules](https://github.com/huny4daniel/pedal-point/blob/main/app/rules.py): `app/rules.py`
- [Database access](https://github.com/huny4daniel/pedal-point/blob/main/app/db.py): `app/db.py`
- [Padal MySQL database](https://github.com/huny4daniel/pedal-point/blob/main/db/schema.sql): `db/schema.sql`

### Other components

- **Riders**
- **Administrators**

## Connections

- Riders → Android WebView: use app (evidence: `README.md`)
- Riders → Streamlit app: use web (evidence: `README.md`)
- Administrators → Streamlit app: use web (evidence: `README.md`)
- Android WebView → Streamlit app: loads server UI (evidence: `README.md`)
- Streamlit app → Shared UI: detects mode and styles (evidence: `app/main.py`)
- Streamlit app → Login: routes to (evidence: `app/main.py`)
- Streamlit app → Station search and rental: routes to (evidence: `app/main.py`)
- Streamlit app → Return and payment: routes to (evidence: `app/main.py`)
- Streamlit app → Rider history and stats: routes to (evidence: `app/main.py`)
- Streamlit app → Station and bike management: routes to (evidence: `app/main.py`)
- Streamlit app → Record search: routes to (evidence: `app/main.py`)
- Streamlit app → Member management and stats: routes to (evidence: `app/main.py`)
- Login → Rider operations: loads rider accounts (evidence: `app/views/login.py`)
- Login → Admin operations: loads staff accounts (evidence: `app/views/login.py`)
- Station search and rental → Rider operations: searches and rents (evidence: `app/views/user_rent.py`)
- Return and payment → Rider operations: returns and pays (evidence: `app/views/user_return.py`)
- Return and payment → Fare and mileage rules: previews fare and mileage (evidence: `app/views/user_return.py`)
- Rider history and stats → Rider operations: loads histories and totals (evidence: `app/views/user_mypage.py`)
- Rider history and stats → Fare and mileage rules: formats rule values (evidence: `app/views/user_mypage.py`)
- Station and bike management → Admin operations: manages assets (evidence: `app/views/admin_assets.py`)
- Record search → Admin operations: searches records (evidence: `app/views/admin_history.py`)
- Member management and stats → Admin operations: manages members (evidence: `app/views/admin_members.py`)
- Rider operations → Fare and mileage rules: calculates charges and points (evidence: `app/user_ops.py`)
- Rider operations → Database access: queries and transacts (evidence: `app/user_ops.py`)
- Admin operations → Database access: queries and transacts (evidence: `app/admin_ops.py`)
- Database access → Padal MySQL database: connects and persists (evidence: `app/db.py`)
