# haydakiwi/food-delivery architecture

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

- Interactive diagram: https://gitdiagram.com/haydakiwi/food-delivery
- Repository: https://github.com/haydakiwi/food-delivery

## Overview

Food Delivery API is a small FastAPI backend. A client requests the restaurant list; the registered route uses configured data-path settings to construct the repository and service, calls the service, and returns restaurant records validated against the Pydantic schema. The repository reads the JSON data file. The separate health endpoint is served by the application entry point. The README also documents generated API docs; wiring beyond the shown application setup is not modeled.

Main entry points: [`app/api/routes/restaurants.py`](https://github.com/haydakiwi/food-delivery/blob/main/app/api/routes/restaurants.py) (Restaurant route), [`app/services/restaurant_service.py`](https://github.com/haydakiwi/food-delivery/blob/main/app/services/restaurant_service.py) (Restaurant service), [`app/repositories/restaurant_repository.py`](https://github.com/haydakiwi/food-delivery/blob/main/app/repositories/restaurant_repository.py) (Restaurant repository), [`app/schemas/restaurant.py`](https://github.com/haydakiwi/food-delivery/blob/main/app/schemas/restaurant.py) (Restaurant schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_application["FastAPI application<br/>[main.py]"]
  node_restaurant_route["Restaurant route<br/>[restaurants.py]"]
  node_health_check["Health check<br/>[main.py]"]
end

subgraph group_domain["Restaurant Domain"]
  node_restaurant_service["Restaurant service"]
  node_restaurant_schema["Restaurant schema<br/>[restaurant.py]"]
end

subgraph group_storage["Configuration &amp; Data"]
  node_data_config["Data path config<br/>[config.py]"]
  node_restaurant_repository["Restaurant repository"]
  node_restaurant_json[("Restaurant JSON<br/>[restaurants.json]")]
end

node_client(("API client"))

node_client -->|"requests list"| node_restaurant_route
node_client -->|"checks health"| node_health_check
node_application -->|"registers router"| node_restaurant_route
node_restaurant_route -->|"reads path"| node_data_config
node_restaurant_route -->|"constructs"| node_restaurant_repository
node_restaurant_route -->|"calls"| node_restaurant_service
node_restaurant_route -->|"declares response"| node_restaurant_schema
node_restaurant_service -->|"loads records"| node_restaurant_repository
node_restaurant_service -->|"validates records"| node_restaurant_schema
node_restaurant_repository -->|"reads JSON"| node_restaurant_json

click node_application "https://github.com/haydakiwi/food-delivery/blob/main/app/main.py"
click node_restaurant_route "https://github.com/haydakiwi/food-delivery/blob/main/app/api/routes/restaurants.py"
click node_health_check "https://github.com/haydakiwi/food-delivery/blob/main/app/main.py"
click node_restaurant_service "https://github.com/haydakiwi/food-delivery/blob/main/app/services/restaurant_service.py"
click node_restaurant_schema "https://github.com/haydakiwi/food-delivery/blob/main/app/schemas/restaurant.py"
click node_data_config "https://github.com/haydakiwi/food-delivery/blob/main/app/core/config.py"
click node_restaurant_repository "https://github.com/haydakiwi/food-delivery/blob/main/app/repositories/restaurant_repository.py"
click node_restaurant_json "https://github.com/haydakiwi/food-delivery/blob/main/data/restaurants.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_application,node_restaurant_route,node_health_check,node_client toneBlue
class node_restaurant_service,node_restaurant_schema toneAmber
class node_data_config,node_restaurant_repository,node_restaurant_json toneMint
```

## Components

### HTTP API

- [FastAPI application](https://github.com/haydakiwi/food-delivery/blob/main/app/main.py): `app/main.py`
- [Restaurant route](https://github.com/haydakiwi/food-delivery/blob/main/app/api/routes/restaurants.py): `app/api/routes/restaurants.py`
- [Health check](https://github.com/haydakiwi/food-delivery/blob/main/app/main.py): `app/main.py`

### Restaurant Domain

- [Restaurant service](https://github.com/haydakiwi/food-delivery/blob/main/app/services/restaurant_service.py): `app/services/restaurant_service.py`
- [Restaurant schema](https://github.com/haydakiwi/food-delivery/blob/main/app/schemas/restaurant.py): `app/schemas/restaurant.py`

### Configuration & Data

- [Data path config](https://github.com/haydakiwi/food-delivery/blob/main/app/core/config.py): `app/core/config.py`
- [Restaurant repository](https://github.com/haydakiwi/food-delivery/blob/main/app/repositories/restaurant_repository.py): `app/repositories/restaurant_repository.py`
- [Restaurant JSON](https://github.com/haydakiwi/food-delivery/blob/main/data/restaurants.json): `data/restaurants.json`

### Other components

- **API client**

## Connections

- API client → Restaurant route: requests list (evidence: `README.md`)
- API client → Health check: checks health (evidence: `README.md`)
- FastAPI application → Restaurant route: registers router (evidence: `app/main.py`)
- Restaurant route → Data path config: reads path (evidence: `app/api/routes/restaurants.py`)
- Restaurant route → Restaurant repository: constructs (evidence: `app/api/routes/restaurants.py`)
- Restaurant route → Restaurant service: calls (evidence: `app/api/routes/restaurants.py`)
- Restaurant route → Restaurant schema: declares response (evidence: `app/api/routes/restaurants.py`)
- Restaurant service → Restaurant repository: loads records (evidence: `app/services/restaurant_service.py`)
- Restaurant service → Restaurant schema: validates records (evidence: `app/services/restaurant_service.py`)
- Restaurant repository → Restaurant JSON: reads JSON (evidence: `README.md`)
