# ismia-shin/2311993-petuk architecture

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

- Interactive diagram: https://gitdiagram.com/ismia-shin/2311993-petuk
- Repository: https://github.com/ismia-shin/2311993-petuk

## Overview

Petuk is an early-stage restaurant discovery and management app. The implemented workflow is: a visitor uses the React interface to list, view, create, edit, or delete restaurants; the API client sends requests to FastAPI, whose restaurant routes validate data and read or write the configured database. The README also describes reviews and Beta plans for accounts, menus, and administration, but those capabilities are not represented in the sampled runtime code. The graph distinguishes those documented capabilities from the implemented CRUD flow.

Main entry points: [`backend/app/restaurants.py`](https://github.com/ismia-shin/2311993-petuk/blob/main/backend/app/restaurants.py) (Restaurant CRUD), [`backend/main.py`](https://github.com/ismia-shin/2311993-petuk/blob/main/backend/main.py) (FastAPI app), [`backend/app`](https://github.com/ismia-shin/2311993-petuk/tree/main/backend/app) (Admin controls), [`frontend/src/main.tsx`](https://github.com/ismia-shin/2311993-petuk/blob/main/frontend/src/main.tsx) (React mount)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_react_mount["React mount<br/>[main.tsx]"]
  node_app_shell["App navigation<br/>[App.tsx]"]
  node_restaurant_manager["Restaurant manager"]
  node_restaurant_client["Restaurant API client<br/>[restaurantApi.ts]"]
end

subgraph group_backend["API and persistence"]
  node_fastapi_app["FastAPI app<br/>[main.py]"]
  node_restaurant_routes["Restaurant CRUD<br/>[restaurants.py]"]
  node_restaurant_model["Restaurant model<br/>[restaurants.py]"]
  node_database[("Configured database")]
end

subgraph group_roadmap["Documented product capabilities"]
  node_review_capabilities["Reviews and ratings"]
  node_account_capabilities["Accounts and roles"]
  node_menu_capabilities["Restaurant menus"]
  node_admin_capabilities["Admin controls"]
end

node_visitor(("Visitor"))

node_visitor -->|"uses"| node_react_mount
node_react_mount -->|"renders"| node_app_shell
node_app_shell -->|"renders"| node_restaurant_manager
node_restaurant_manager -->|"calls CRUD"| node_restaurant_client
node_restaurant_client -->|"sends HTTP"| node_fastapi_app
node_fastapi_app -->|"mounts routes"| node_restaurant_routes
node_fastapi_app -->|"initializes database"| node_restaurant_routes
node_restaurant_routes -->|"validates and queries"| node_restaurant_model
node_restaurant_routes -->|"reads and writes"| node_database
node_visitor -.->|"can submit reviews"| node_review_capabilities
node_visitor -.->|"planned sign-in"| node_account_capabilities
node_visitor -.->|"can view menus"| node_menu_capabilities
node_admin_capabilities -.->|"planned management"| node_restaurant_routes
node_admin_capabilities -.->|"planned moderation"| node_review_capabilities

click node_react_mount "https://github.com/ismia-shin/2311993-petuk/blob/main/frontend/src/main.tsx"
click node_app_shell "https://github.com/ismia-shin/2311993-petuk/blob/main/frontend/src/App.tsx"
click node_restaurant_manager "https://github.com/ismia-shin/2311993-petuk/blob/main/frontend/src/components/RestaurantManager.tsx"
click node_restaurant_client "https://github.com/ismia-shin/2311993-petuk/blob/main/frontend/src/services/restaurantApi.ts"
click node_fastapi_app "https://github.com/ismia-shin/2311993-petuk/blob/main/backend/main.py"
click node_restaurant_routes "https://github.com/ismia-shin/2311993-petuk/blob/main/backend/app/restaurants.py"
click node_restaurant_model "https://github.com/ismia-shin/2311993-petuk/blob/main/backend/app/restaurants.py"
click node_review_capabilities "https://github.com/ismia-shin/2311993-petuk/tree/main/backend/app"
click node_account_capabilities "https://github.com/ismia-shin/2311993-petuk/tree/main/backend/app"
click node_menu_capabilities "https://github.com/ismia-shin/2311993-petuk/tree/main/backend/app"
click node_admin_capabilities "https://github.com/ismia-shin/2311993-petuk/tree/main/backend/app"

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_react_mount,node_app_shell,node_restaurant_manager,node_restaurant_client toneBlue
class node_fastapi_app,node_restaurant_routes,node_restaurant_model,node_database toneAmber
class node_review_capabilities,node_account_capabilities,node_menu_capabilities,node_admin_capabilities toneMint
class node_visitor toneIndigo
```

## Components

### Web interface

- [React mount](https://github.com/ismia-shin/2311993-petuk/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [App navigation](https://github.com/ismia-shin/2311993-petuk/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Restaurant manager](https://github.com/ismia-shin/2311993-petuk/blob/main/frontend/src/components/RestaurantManager.tsx): `frontend/src/components/RestaurantManager.tsx`
- [Restaurant API client](https://github.com/ismia-shin/2311993-petuk/blob/main/frontend/src/services/restaurantApi.ts): `frontend/src/services/restaurantApi.ts`

### API and persistence

- [FastAPI app](https://github.com/ismia-shin/2311993-petuk/blob/main/backend/main.py): `backend/main.py`
- [Restaurant CRUD](https://github.com/ismia-shin/2311993-petuk/blob/main/backend/app/restaurants.py): `backend/app/restaurants.py`
- [Restaurant model](https://github.com/ismia-shin/2311993-petuk/blob/main/backend/app/restaurants.py): `backend/app/restaurants.py`
- **Configured database**

### Documented product capabilities

- [Reviews and ratings](https://github.com/ismia-shin/2311993-petuk/tree/main/backend/app): `backend/app`
- [Accounts and roles](https://github.com/ismia-shin/2311993-petuk/tree/main/backend/app): `backend/app`
- [Restaurant menus](https://github.com/ismia-shin/2311993-petuk/tree/main/backend/app): `backend/app`
- [Admin controls](https://github.com/ismia-shin/2311993-petuk/tree/main/backend/app): `backend/app`

### Other components

- **Visitor**

## Connections

- Visitor → React mount: uses (evidence: `README.md`)
- React mount → App navigation: renders (evidence: `frontend/src/main.tsx`)
- App navigation → Restaurant manager: renders (evidence: `frontend/src/App.tsx`)
- Restaurant manager → Restaurant API client: calls CRUD (evidence: `frontend/src/components/RestaurantManager.tsx`)
- Restaurant API client → FastAPI app: sends HTTP (evidence: `README.md`)
- FastAPI app → Restaurant CRUD: mounts routes (evidence: `backend/main.py`)
- FastAPI app → Restaurant CRUD: initializes database (evidence: `backend/main.py`)
- Restaurant CRUD → Restaurant model: validates and queries (evidence: `backend/app/restaurants.py`)
- Restaurant CRUD → Configured database: reads and writes (evidence: `backend/app/restaurants.py`)
- Visitor → Reviews and ratings: can submit reviews (evidence: `README.md`)
- Visitor → Accounts and roles: planned sign-in (evidence: `README.md`)
- Visitor → Restaurant menus: can view menus (evidence: `README.md`)
- Admin controls → Restaurant CRUD: planned management (evidence: `README.md`)
- Admin controls → Reviews and ratings: planned moderation (evidence: `README.md`)
