# rusa1212/handwriting-code architecture

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

- Interactive diagram: https://gitdiagram.com/rusa1212/handwriting-code
- Repository: https://github.com/rusa1212/handwriting-code

## Overview

This is a Korean route-recommendation app with two user-facing areas: a route recommendation workflow and an algorithm lab. In the main workflow, users choose endpoints by place search, map click, or current location; the backend fetches candidate routes, scores them against user preferences, and the frontend displays route choices and a highlighted recommendation on a Kakao map. The lab exposes graph-search algorithms over the Gumi road network. Several backend/frontend relationships are supported by excerpts or the SOURCE INDEX; links to unsampled integrations are omitted where their invocation is not shown.

Main entry points: [`frontend/src/pages/RecommendPage.jsx`](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/pages/RecommendPage.jsx) (Recommend page), [`be/main.py`](https://github.com/rusa1212/handwriting-code/blob/main/be/main.py) (FastAPI endpoints), [`frontend/src/App.jsx`](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/App.jsx) (App tabs), [`be/lab.py`](https://github.com/rusa1212/handwriting-code/blob/main/be/lab.py) (Lab search runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Frontend experience"]
  node_app["App tabs<br/>[App.jsx]"]
  node_recommend_page["Recommend page<br/>[RecommendPage.jsx]"]
  node_search_panel["Endpoint panel<br/>[SearchPanel.jsx]"]
  node_place_input["Place input"]
  node_preference_panel["Preference controls"]
  node_route_list["Route list<br/>[RouteList.jsx]"]
  node_route_card["Route card<br/>[RouteCard.jsx]"]
  node_recommend_reason["Recommendation reason"]
  node_map_view["Map display<br/>[MapView.jsx]"]
  node_geolocation["Geolocation<br/>[geolocation.js]"]
  node_api_client["API client<br/>[client.js]"]
end

subgraph group_route["Route services"]
  node_backend["FastAPI endpoints<br/>[main.py]"]
  node_map_api["Map and route lookup<br/>[map_api.py]"]
  node_scoring["Route scoring<br/>[scoring.py]"]
end

subgraph group_algorithm["Algorithm lab"]
  node_lab_page["Algorithm lab page"]
  node_lab_runner["Lab search runner<br/>[lab.py]"]
  node_search_algorithms["Search algorithms<br/>[search.py]"]
  node_road_graph["Road graph<br/>[graph.py]"]
  node_osm_fetch["OSM data fetch<br/>[fetch_osm.py]"]
  node_road_data["Gumi road data<br/>[gumi_roads.json]"]
end

subgraph group_contracts["Shared contracts"]
  node_schemas["API schemas<br/>[schemas.py]"]
end

node_user(("Driver"))

node_user -->|"uses"| node_app
node_app -->|"shows"| node_recommend_page
node_app -->|"shows"| node_lab_page
node_recommend_page -->|"renders"| node_search_panel
node_recommend_page -->|"renders"| node_preference_panel
node_recommend_page -->|"renders"| node_route_list
node_recommend_page -->|"renders"| node_recommend_reason
node_recommend_page -->|"renders"| node_map_view
node_search_panel -->|"renders"| node_place_input
node_place_input -->|"searches places"| node_api_client
node_route_list -->|"renders"| node_route_card
node_recommend_page -->|"requests routes and scores"| node_api_client
node_recommend_page -->|"gets position"| node_geolocation
node_api_client -->|"sends API requests"| node_backend
node_backend -->|"calls lookup"| node_map_api
node_backend -->|"calls scoring"| node_scoring
node_backend -->|"calls search runner"| node_lab_runner
node_backend -->|"validates payloads"| node_schemas
node_lab_runner -->|"runs algorithms"| node_search_algorithms
node_lab_runner -->|"loads graph"| node_road_graph
node_search_algorithms -->|"searches graph"| node_road_graph
node_osm_fetch -.->|"writes data"| node_road_data
node_road_graph -.->|"loads data"| node_road_data
node_lab_page -->|"renders map"| node_map_view

click node_app "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/App.jsx"
click node_recommend_page "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/pages/RecommendPage.jsx"
click node_search_panel "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/SearchPanel.jsx"
click node_place_input "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/PlaceSearchInput.jsx"
click node_preference_panel "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/PreferencePanel.jsx"
click node_route_list "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/RouteList.jsx"
click node_route_card "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/RouteCard.jsx"
click node_recommend_reason "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/RecommendReason.jsx"
click node_map_view "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/MapView.jsx"
click node_geolocation "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/lib/geolocation.js"
click node_api_client "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/api/client.js"
click node_backend "https://github.com/rusa1212/handwriting-code/blob/main/be/main.py"
click node_map_api "https://github.com/rusa1212/handwriting-code/blob/main/be/map_api.py"
click node_scoring "https://github.com/rusa1212/handwriting-code/blob/main/be/scoring.py"
click node_schemas "https://github.com/rusa1212/handwriting-code/blob/main/be/schemas.py"
click node_lab_page "https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/pages/AlgorithmLabPage.jsx"
click node_lab_runner "https://github.com/rusa1212/handwriting-code/blob/main/be/lab.py"
click node_search_algorithms "https://github.com/rusa1212/handwriting-code/blob/main/be/search.py"
click node_road_graph "https://github.com/rusa1212/handwriting-code/blob/main/be/graph.py"
click node_osm_fetch "https://github.com/rusa1212/handwriting-code/blob/main/be/fetch_osm.py"
click node_road_data "https://github.com/rusa1212/handwriting-code/blob/main/be/data/gumi_roads.json"

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_recommend_page,node_search_panel,node_place_input,node_preference_panel,node_route_list,node_route_card,node_recommend_reason,node_map_view,node_geolocation,node_api_client toneBlue
class node_backend,node_map_api,node_scoring toneAmber
class node_lab_page,node_lab_runner,node_search_algorithms,node_road_graph,node_osm_fetch,node_road_data toneMint
class node_schemas toneRose
class node_user toneIndigo
```

## Components

### Frontend experience

- [App tabs](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Recommend page](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/pages/RecommendPage.jsx): `frontend/src/pages/RecommendPage.jsx`
- [Endpoint panel](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/SearchPanel.jsx): `frontend/src/components/SearchPanel.jsx`
- [Place input](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/PlaceSearchInput.jsx): `frontend/src/components/PlaceSearchInput.jsx`
- [Preference controls](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/PreferencePanel.jsx): `frontend/src/components/PreferencePanel.jsx`
- [Route list](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/RouteList.jsx): `frontend/src/components/RouteList.jsx`
- [Route card](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/RouteCard.jsx): `frontend/src/components/RouteCard.jsx`
- [Recommendation reason](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/RecommendReason.jsx): `frontend/src/components/RecommendReason.jsx`
- [Map display](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/components/MapView.jsx): `frontend/src/components/MapView.jsx`
- [Geolocation](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/lib/geolocation.js): `frontend/src/lib/geolocation.js`
- [API client](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### Route services

- [FastAPI endpoints](https://github.com/rusa1212/handwriting-code/blob/main/be/main.py): `be/main.py`
- [Map and route lookup](https://github.com/rusa1212/handwriting-code/blob/main/be/map_api.py): `be/map_api.py`
- [Route scoring](https://github.com/rusa1212/handwriting-code/blob/main/be/scoring.py): `be/scoring.py`

### Algorithm lab

- [Algorithm lab page](https://github.com/rusa1212/handwriting-code/blob/main/frontend/src/pages/AlgorithmLabPage.jsx): `frontend/src/pages/AlgorithmLabPage.jsx`
- [Lab search runner](https://github.com/rusa1212/handwriting-code/blob/main/be/lab.py): `be/lab.py`
- [Search algorithms](https://github.com/rusa1212/handwriting-code/blob/main/be/search.py): `be/search.py`
- [Road graph](https://github.com/rusa1212/handwriting-code/blob/main/be/graph.py): `be/graph.py`
- [OSM data fetch](https://github.com/rusa1212/handwriting-code/blob/main/be/fetch_osm.py): `be/fetch_osm.py`
- [Gumi road data](https://github.com/rusa1212/handwriting-code/blob/main/be/data/gumi_roads.json): `be/data/gumi_roads.json`

### Shared contracts

- [API schemas](https://github.com/rusa1212/handwriting-code/blob/main/be/schemas.py): `be/schemas.py`

### Other components

- **Driver**

## Connections

- Driver → App tabs: uses (evidence: `frontend/src/App.jsx`)
- App tabs → Recommend page: shows (evidence: `frontend/src/App.jsx`)
- App tabs → Algorithm lab page: shows (evidence: `frontend/src/App.jsx`)
- Recommend page → Endpoint panel: renders (evidence: `frontend/src/pages/RecommendPage.jsx`)
- Recommend page → Preference controls: renders (evidence: `frontend/src/pages/RecommendPage.jsx`)
- Recommend page → Route list: renders (evidence: `frontend/src/pages/RecommendPage.jsx`)
- Recommend page → Recommendation reason: renders (evidence: `frontend/src/pages/RecommendPage.jsx`)
- Recommend page → Map display: renders (evidence: `frontend/src/pages/RecommendPage.jsx`)
- Endpoint panel → Place input: renders (evidence: `frontend/src/components/SearchPanel.jsx`)
- Place input → API client: searches places (evidence: `frontend/src/components/PlaceSearchInput.jsx`)
- Route list → Route card: renders (evidence: `frontend/src/components/RouteList.jsx`)
- Recommend page → API client: requests routes and scores (evidence: `frontend/src/pages/RecommendPage.jsx`)
- Recommend page → Geolocation: gets position (evidence: `frontend/src/pages/RecommendPage.jsx`)
- API client → FastAPI endpoints: sends API requests (evidence: `be/main.py`)
- FastAPI endpoints → Map and route lookup: calls lookup (evidence: `be/main.py`)
- FastAPI endpoints → Route scoring: calls scoring (evidence: `be/main.py`)
- FastAPI endpoints → Lab search runner: calls search runner (evidence: `be/main.py`)
- FastAPI endpoints → API schemas: validates payloads (evidence: `be/main.py`)
- Lab search runner → Search algorithms: runs algorithms (evidence: `be/lab.py`)
- Lab search runner → Road graph: loads graph (evidence: `be/lab.py`)
- Search algorithms → Road graph: searches graph (evidence: `be/search.py`)
- OSM data fetch → Gumi road data: writes data
- Road graph → Gumi road data: loads data
- Algorithm lab page → Map display: renders map (evidence: `frontend/src/pages/AlgorithmLabPage.jsx`)
