# kimdeun/devops-engineer-from-scratch-project-313 architecture

> Architecture diagram of the GitHub repository kimdeun/devops-engineer-from-scratch-project-313, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kimdeun/devops-engineer-from-scratch-project-313
- Repository: https://github.com/kimdeun/devops-engineer-from-scratch-project-313

## Overview

This is a link-shortening service with a bundled web frontend and a FastAPI backend. A user works through the frontend to list, create, edit, or delete links; the backend handles those API requests, uses the repository to access link records, and returns results. A separate redirect route looks up a short name and redirects to the original URL. The backend initializes database tables at startup. The README identifies the deployed project, but does not document frontend-to-API wiring; that connection is therefore shown as unverified.

Main entry points: [`app/main.py`](https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/main.py) (FastAPI app), [`app/routes.py`](https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/routes.py) (Link routes), [`app/repository.py`](https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/repository.py) (Link repository), [`app/database.py`](https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/database.py) (Database setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_frontend["Link frontend<br/>[index-BZ51OKon.js]"]
end

subgraph group_backend["Backend API"]
  node_app["FastAPI app<br/>[main.py]"]
  node_routes["Link routes<br/>[routes.py]"]
end

subgraph group_data["Link data"]
  node_repository["Link repository<br/>[repository.py]"]
  node_models["Link models<br/>[models.py]"]
  node_database["Database setup<br/>[database.py]"]
end

node_user(("User"))
node_db[("SQL database")]

node_user -->|"uses"| node_frontend
node_frontend -.->|"API requests"| node_app
node_app -->|"mounts routes"| node_routes
node_app -->|"creates tables"| node_database
node_routes -->|"calls"| node_repository
node_routes -->|"validates and formats"| node_models
node_repository -->|"reads and writes"| node_models
node_repository -->|"uses engine"| node_database
node_database -->|"connects"| node_db

click node_frontend "https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/frontend-dist/assets/index-BZ51OKon.js"
click node_app "https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/main.py"
click node_routes "https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/routes.py"
click node_repository "https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/repository.py"
click node_models "https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/models.py"
click node_database "https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/database.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_frontend,node_user toneBlue
class node_app,node_routes,node_db toneAmber
class node_repository,node_models,node_database toneMint
```

## Components

### Web client

- [Link frontend](https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/frontend-dist/assets/index-BZ51OKon.js): `frontend-dist/assets/index-BZ51OKon.js`

### Backend API

- [FastAPI app](https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/main.py): `app/main.py`
- [Link routes](https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/routes.py): `app/routes.py`

### Link data

- [Link repository](https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/repository.py): `app/repository.py`
- [Link models](https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/models.py): `app/models.py`
- [Database setup](https://github.com/kimdeun/devops-engineer-from-scratch-project-313/blob/main/app/database.py): `app/database.py`

### Other components

- **User**
- **SQL database**

## Connections

- User → Link frontend: uses (evidence: `README.md`)
- Link frontend → FastAPI app: API requests
- FastAPI app → Link routes: mounts routes (evidence: `app/main.py`)
- FastAPI app → Database setup: creates tables (evidence: `app/main.py`)
- Link routes → Link repository: calls (evidence: `app/routes.py`)
- Link routes → Link models: validates and formats (evidence: `app/routes.py`)
- Link repository → Link models: reads and writes (evidence: `app/repository.py`)
- Link repository → Database setup: uses engine (evidence: `app/repository.py`)
- Database setup → SQL database: connects (evidence: `app/database.py`)
