# 2026-kw-hackathon/32_wolgye-debugging-backend architecture

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

- Interactive diagram: https://gitdiagram.com/2026-kw-hackathon/32_wolgye-debugging-backend
- Repository: https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend

## Overview

차곡차곡 is a FastAPI backend for villa-alley parking: residents manage vehicles and parking, discover and request shared spaces, and managers administer buildings, offers, and requests. The main flow is an API request through a resource endpoint into domain services that apply rules and persist state in PostgreSQL/PostGIS. The README documents the broader API capabilities; some endpoint and service implementations were not sampled, so those links are marked unverified rather than asserted as observed calls.

Main entry points: [`app/services/auth.py`](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/auth.py) (Authentication), [`app/models`](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/tree/dev/app/models) (Domain Records), [`app/services/garages.py`](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/garages.py) (Space Discovery), [`app/main.py`](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/main.py) (App & Handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_main["App &amp; Handlers<br/>[main.py]"]
  node_router["V1 Router<br/>[router.py]"]
  node_endpoints["Resource Endpoints"]
  node_api_deps["Request Dependencies<br/>[deps.py]"]
  node_api_errors["HTTP Error Mapping<br/>[errors.py]"]
end

subgraph group_identity["Identity &amp; Access"]
  node_auth_api["Auth Endpoints<br/>[auth.py]"]
  node_auth_service["Authentication<br/>[auth.py]"]
  node_security["Token Security<br/>[security.py]"]
  node_user_service["Resident Accounts<br/>[users.py]"]
end

subgraph group_parking["Parking Operations"]
  node_garage_api["Garage Endpoints<br/>[garages.py]"]
  node_garage_service["Space Discovery<br/>[garages.py]"]
  node_parking_services["Parking &amp; Schedules<br/>[parkings.py]"]
  node_vehicle_services["Vehicle Management<br/>[vehicles.py]"]
  node_building_services["Building Views<br/>[building_view.py]"]
  node_blocking["Blockage Logic<br/>[blocking.py]"]
  node_block_job["Nightly Block Alert<br/>[block_alert.py]"]
end

subgraph group_sharing["Sharing &amp; Community"]
  node_sharing_services["Sharing Requests<br/>[share_requests.py]"]
  node_admin_services["Manager Operations<br/>[admin_shares.py]"]
  node_notifications["Notifications<br/>[notifications.py]"]
  node_tokens["Token Transfers<br/>[tokens.py]"]
end

subgraph group_persistence["Domain &amp; Persistence"]
  node_models["Domain Records"]
  node_schemas["Request &amp; Response Types"]
  node_db_session["Async DB Session<br/>[session.py]"]
  node_database[("PostgreSQL / PostGIS")]
end

node_resident(("Resident"))

node_resident -->|"sends requests"| node_main
node_main -->|"registers routes"| node_router
node_router -->|"routes to"| node_endpoints
node_endpoints -.->|"gets dependencies"| node_api_deps
node_main -->|"registers handlers"| node_api_errors
node_auth_api -->|"calls"| node_auth_service
node_auth_service -->|"creates tokens"| node_security
node_auth_service -->|"checks onboarding"| node_user_service
node_auth_service -->|"grants signup tokens"| node_tokens
node_garage_api -->|"calls"| node_garage_service
node_garage_service -->|"reads parking data"| node_models
node_garage_service -->|"builds results"| node_schemas
node_garage_service -->|"queries"| node_database
node_parking_services -.->|"reads and writes"| node_models
node_vehicle_services -.->|"reads and writes"| node_models
node_building_services -.->|"reads"| node_models
node_sharing_services -.->|"reads and writes"| node_models
node_admin_services -->|"transfers tokens"| node_tokens
node_admin_services -->|"creates alerts"| node_notifications
node_sharing_services -.->|"settles accepted requests"| node_tokens
node_block_job -->|"creates alerts"| node_notifications
node_block_job -->|"uses building view"| node_building_services
node_api_deps -->|"authenticates"| node_auth_service
node_api_deps -->|"provides session"| node_db_session
node_db_session -->|"connects"| node_database
node_api_errors -->|"maps exceptions"| node_main

click node_main "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/main.py"
click node_router "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/api/v1/router.py"
click node_endpoints "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/tree/dev/app/api/v1/endpoints"
click node_api_deps "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/api/deps.py"
click node_api_errors "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/api/errors.py"
click node_auth_api "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/api/v1/endpoints/auth.py"
click node_auth_service "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/auth.py"
click node_security "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/core/security.py"
click node_user_service "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/users.py"
click node_garage_api "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/api/v1/endpoints/garages.py"
click node_garage_service "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/garages.py"
click node_parking_services "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/parkings.py"
click node_vehicle_services "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/vehicles.py"
click node_building_services "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/building_view.py"
click node_blocking "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/blocking.py"
click node_sharing_services "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/share_requests.py"
click node_admin_services "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/admin_shares.py"
click node_notifications "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/notifications.py"
click node_tokens "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/tokens.py"
click node_models "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/tree/dev/app/models"
click node_schemas "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/tree/dev/app/schemas"
click node_db_session "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/db/session.py"
click node_block_job "https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/jobs/block_alert.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_main,node_router,node_endpoints,node_api_deps,node_api_errors toneBlue
class node_auth_api,node_auth_service,node_security,node_user_service toneAmber
class node_garage_api,node_garage_service,node_parking_services,node_vehicle_services,node_building_services,node_blocking,node_block_job toneMint
class node_sharing_services,node_admin_services,node_notifications,node_tokens toneRose
class node_models,node_schemas,node_db_session,node_database,node_resident toneIndigo
```

## Components

### HTTP API

- [App & Handlers](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/main.py): `app/main.py`
- [V1 Router](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/api/v1/router.py): `app/api/v1/router.py`
- [Resource Endpoints](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/tree/dev/app/api/v1/endpoints): `app/api/v1/endpoints`
- [Request Dependencies](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/api/deps.py): `app/api/deps.py`
- [HTTP Error Mapping](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/api/errors.py): `app/api/errors.py`

### Identity & Access

- [Auth Endpoints](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/api/v1/endpoints/auth.py): `app/api/v1/endpoints/auth.py`
- [Authentication](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/auth.py): `app/services/auth.py`
- [Token Security](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/core/security.py): `app/core/security.py`
- [Resident Accounts](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/users.py): `app/services/users.py`

### Parking Operations

- [Garage Endpoints](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/api/v1/endpoints/garages.py): `app/api/v1/endpoints/garages.py`
- [Space Discovery](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/garages.py): `app/services/garages.py`
- [Parking & Schedules](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/parkings.py): `app/services/parkings.py`
- [Vehicle Management](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/vehicles.py): `app/services/vehicles.py`
- [Building Views](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/building_view.py): `app/services/building_view.py`
- [Blockage Logic](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/blocking.py): `app/services/blocking.py`
- [Nightly Block Alert](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/jobs/block_alert.py): `app/jobs/block_alert.py`

### Sharing & Community

- [Sharing Requests](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/share_requests.py): `app/services/share_requests.py`
- [Manager Operations](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/admin_shares.py): `app/services/admin_shares.py`
- [Notifications](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/notifications.py): `app/services/notifications.py`
- [Token Transfers](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/services/tokens.py): `app/services/tokens.py`

### Domain & Persistence

- [Domain Records](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/tree/dev/app/models): `app/models`
- [Request & Response Types](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/tree/dev/app/schemas): `app/schemas`
- [Async DB Session](https://github.com/2026-kw-hackathon/32_wolgye-debugging-backend/blob/dev/app/db/session.py): `app/db/session.py`
- **PostgreSQL / PostGIS**

### Other components

- **Resident**

## Connections

- Resident → App & Handlers: sends requests
- App & Handlers → V1 Router: registers routes (evidence: `app/main.py`)
- V1 Router → Resource Endpoints: routes to (evidence: `app/api/v1/router.py`)
- Resource Endpoints → Request Dependencies: gets dependencies (evidence: `app/api/v1/endpoints/garages.py`)
- App & Handlers → HTTP Error Mapping: registers handlers (evidence: `app/main.py`)
- Auth Endpoints → Authentication: calls (evidence: `app/api/v1/endpoints/auth.py`)
- Authentication → Token Security: creates tokens (evidence: `app/services/auth.py`)
- Authentication → Resident Accounts: checks onboarding (evidence: `app/services/auth.py`)
- Authentication → Token Transfers: grants signup tokens (evidence: `app/services/auth.py`)
- Garage Endpoints → Space Discovery: calls (evidence: `app/api/v1/endpoints/garages.py`)
- Space Discovery → Domain Records: reads parking data (evidence: `app/services/garages.py`)
- Space Discovery → Request & Response Types: builds results (evidence: `app/services/garages.py`)
- Space Discovery → PostgreSQL / PostGIS: queries (evidence: `app/services/garages.py`)
- Parking & Schedules → Domain Records: reads and writes
- Vehicle Management → Domain Records: reads and writes
- Building Views → Domain Records: reads
- Sharing Requests → Domain Records: reads and writes
- Manager Operations → Token Transfers: transfers tokens (evidence: `app/services/admin_shares.py`)
- Manager Operations → Notifications: creates alerts (evidence: `app/services/admin_shares.py`)
- Sharing Requests → Token Transfers: settles accepted requests
- Nightly Block Alert → Notifications: creates alerts (evidence: `app/jobs/block_alert.py`)
- Nightly Block Alert → Building Views: uses building view (evidence: `app/jobs/block_alert.py`)
- Request Dependencies → Authentication: authenticates (evidence: `app/api/deps.py`)
- Request Dependencies → Async DB Session: provides session (evidence: `app/api/deps.py`)
- Async DB Session → PostgreSQL / PostGIS: connects (evidence: `app/db/session.py`)
- HTTP Error Mapping → App & Handlers: maps exceptions (evidence: `app/main.py`)
