# prgrms-be-devcourse/nbe11-13-3-team01 architecture

> Architecture diagram of the GitHub repository prgrms-be-devcourse/nbe11-13-3-team01, 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/prgrms-be-devcourse/nbe11-13-3-team01
- Repository: https://github.com/prgrms-be-devcourse/nbe11-13-3-team01

## Overview

Delivery Insight is a delivery-operations product: administrators create delivery plans, drivers discover and claim open work, then track plans and complete stops. The React frontend presents role-specific workflows and calls a Kotlin/Spring API. The README documents atomic claim arbitration, recommendation scoring and an optional n8n-assisted priority window. Backend implementation excerpts were not provided, so backend links below rely on documented API behavior; internal backend call relationships are omitted where they cannot be verified.

Main entry points: [`frontend/src/App.tsx`](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/App.tsx) (Route application), [`frontend/src/api/deliveryPlans.ts`](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/api/deliveryPlans.ts) (Delivery API client), [`src/main/kotlin/com/example/delivery_project/controller`](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/tree/main/src/main/kotlin/com/example/delivery_project/controller) (Delivery API), [`src/main/kotlin/com/example/delivery_project/service/component/recommendation/PriorityWindowAssigner.kt`](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/src/main/kotlin/com/example/delivery_project/service/component/recommendation/PriorityWindowAssigner.kt) (Priority window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Route application<br/>[App.tsx]"]
  node_auth["Session context<br/>[AuthContext.tsx]"]
  node_planlist["Plan dashboard<br/>[PlanListPage.tsx]"]
  node_create["Plan creation<br/>[CreatePlanPage.tsx]"]
  node_market["Open work market<br/>[JobMarketPage.tsx]"]
  node_detail["Plan details<br/>[PlanDetailPage.tsx]"]
  node_webapi["Delivery API client<br/>[deliveryPlans.ts]"]
end

subgraph group_delivery["Delivery operations"]
  node_backend["Delivery API"]
  node_claims["Claim arbitration"]
  node_plans["Plan lifecycle"]
end

subgraph group_recommend["Driver recommendations"]
  node_recommendation["Driver ranking"]
  node_priority["Priority window"]
end

subgraph group_state["Persistence and integrations"]
  node_mysql[("MySQL database")]
  node_n8n["n8n recommender"]
end

node_admin(("Administrator"))
node_driver(("Delivery driver"))

node_app -->|"provides session"| node_auth
node_app -->|"routes to"| node_planlist
node_app -->|"routes to"| node_create
node_app -->|"routes to"| node_market
node_app -->|"routes to"| node_detail
node_admin -->|"creates plans"| node_create
node_driver -->|"finds open work"| node_market
node_planlist -->|"loads plans"| node_webapi
node_create -->|"submits plan"| node_webapi
node_market -->|"claims work"| node_webapi
node_detail -->|"updates plan"| node_webapi
node_webapi -->|"HTTP requests"| node_backend
node_backend -->|"handles claims"| node_claims
node_backend -->|"serves plan operations"| node_plans
node_claims -->|"arbitrates with updates"| node_mysql
node_recommendation -->|"selects priority drivers"| node_priority
node_priority -.->|"requests AI selection"| node_n8n
node_priority -->|"stores priority window"| node_mysql

click node_app "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/App.tsx"
click node_auth "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/auth/AuthContext.tsx"
click node_planlist "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/pages/PlanListPage.tsx"
click node_create "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/pages/CreatePlanPage.tsx"
click node_market "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/pages/JobMarketPage.tsx"
click node_detail "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/pages/PlanDetailPage.tsx"
click node_webapi "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/api/deliveryPlans.ts"
click node_backend "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/tree/main/src/main/kotlin/com/example/delivery_project/controller"
click node_claims "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/src/main/kotlin/com/example/delivery_project/service/DeliveryPlanClaimService.kt"
click node_plans "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/src/main/kotlin/com/example/delivery_project/service/DeliveryPlanService.kt"
click node_recommendation "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/src/main/kotlin/com/example/delivery_project/service/DriverRecommendationService.kt"
click node_priority "https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/src/main/kotlin/com/example/delivery_project/service/component/recommendation/PriorityWindowAssigner.kt"

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_auth,node_planlist,node_create,node_market,node_detail,node_webapi toneBlue
class node_backend,node_claims,node_plans toneAmber
class node_recommendation,node_priority toneMint
class node_mysql,node_n8n toneRose
class node_admin,node_driver toneIndigo
```

## Components

### Web application

- [Route application](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Session context](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/auth/AuthContext.tsx): `frontend/src/auth/AuthContext.tsx`
- [Plan dashboard](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/pages/PlanListPage.tsx): `frontend/src/pages/PlanListPage.tsx`
- [Plan creation](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/pages/CreatePlanPage.tsx): `frontend/src/pages/CreatePlanPage.tsx`
- [Open work market](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/pages/JobMarketPage.tsx): `frontend/src/pages/JobMarketPage.tsx`
- [Plan details](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/pages/PlanDetailPage.tsx): `frontend/src/pages/PlanDetailPage.tsx`
- [Delivery API client](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/frontend/src/api/deliveryPlans.ts): `frontend/src/api/deliveryPlans.ts`

### Delivery operations

- [Delivery API](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/tree/main/src/main/kotlin/com/example/delivery_project/controller): `src/main/kotlin/com/example/delivery_project/controller`
- [Claim arbitration](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/src/main/kotlin/com/example/delivery_project/service/DeliveryPlanClaimService.kt): `src/main/kotlin/com/example/delivery_project/service/DeliveryPlanClaimService.kt`
- [Plan lifecycle](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/src/main/kotlin/com/example/delivery_project/service/DeliveryPlanService.kt): `src/main/kotlin/com/example/delivery_project/service/DeliveryPlanService.kt`

### Driver recommendations

- [Driver ranking](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/src/main/kotlin/com/example/delivery_project/service/DriverRecommendationService.kt): `src/main/kotlin/com/example/delivery_project/service/DriverRecommendationService.kt`
- [Priority window](https://github.com/prgrms-be-devcourse/nbe11-13-3-team01/blob/main/src/main/kotlin/com/example/delivery_project/service/component/recommendation/PriorityWindowAssigner.kt): `src/main/kotlin/com/example/delivery_project/service/component/recommendation/PriorityWindowAssigner.kt`

### Persistence and integrations

- **MySQL database**
- **n8n recommender**

### Other components

- **Administrator**
- **Delivery driver**

## Connections

- Route application → Session context: provides session (evidence: `frontend/src/main.tsx`)
- Route application → Plan dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Plan creation: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Open work market: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Plan details: routes to (evidence: `frontend/src/App.tsx`)
- Administrator → Plan creation: creates plans (evidence: `README.md`)
- Delivery driver → Open work market: finds open work (evidence: `README.md`)
- Plan dashboard → Delivery API client: loads plans (evidence: `frontend/src/pages/PlanListPage.tsx`)
- Plan creation → Delivery API client: submits plan (evidence: `frontend/src/api/deliveryPlans.ts`)
- Open work market → Delivery API client: claims work (evidence: `frontend/src/api/deliveryPlans.ts`)
- Plan details → Delivery API client: updates plan (evidence: `frontend/src/pages/PlanDetailPage.tsx`)
- Delivery API client → Delivery API: HTTP requests (evidence: `frontend/src/api/deliveryPlans.ts`)
- Delivery API → Claim arbitration: handles claims (evidence: `README.md`)
- Delivery API → Plan lifecycle: serves plan operations (evidence: `README.md`)
- Claim arbitration → MySQL database: arbitrates with updates (evidence: `README.md`)
- Driver ranking → Priority window: selects priority drivers (evidence: `README.md`)
- Priority window → n8n recommender: requests AI selection (evidence: `README.md`)
- Priority window → MySQL database: stores priority window (evidence: `README.md`)
