# meretonga/ev-kutuphanem architecture

> Architecture diagram of the GitHub repository meretonga/ev-kutuphanem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/meretonga/ev-kutuphanem
- Repository: https://github.com/meretonga/ev-kutuphanem

## Overview

Kütüphanem is a Turkish-language home-library app for managing a book collection. A user works through the React interface to add, edit, delete, search, filter, sort, select, and count books; the interface sends collection operations to the FastAPI API, which validates and persists them in PostgreSQL. JSON import follows the API’s bulk-validation and duplicate-skipping behavior, while exports are initiated by the frontend. The frontend excerpt is partial, so uncertain handler-to-endpoint details are left at the API boundary; backend routes and persistence wiring are sampled.

Main entry points: [`frontend/src/App.jsx`](https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/App.jsx) (Library interface), [`backend/main.py`](https://github.com/meretonga/ev-kutuphanem/blob/main/backend/main.py) (FastAPI routes), [`frontend/src/main.jsx`](https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/main.jsx) (React entry), [`backend/database.py`](https://github.com/meretonga/ev-kutuphanem/blob/main/backend/database.py) (Database sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React interface"]
  node_react_entry["React entry<br/>[main.jsx]"]
  node_app["Library interface<br/>[App.jsx]"]
  node_book_operations["Book operations<br/>[App.jsx]"]
  node_collection_tools["Search and selection<br/>[App.jsx]"]
  node_collection_counts["Collection counts<br/>[App.jsx]"]
  node_json_transfer["JSON transfer<br/>[App.jsx]"]
end

subgraph group_backend["API and domain"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_input_validation["Input validation<br/>[schemas.py]"]
end

subgraph group_persistence["Persistence"]
  node_book_model["Book model<br/>[models.py]"]
  node_db_session["Database sessions<br/>[database.py]"]
end

subgraph group_external["External services"]
  node_postgres[("PostgreSQL")]
end

node_user(("Library user"))
node_browser(("Browser runtime"))

node_user -->|"uses"| node_browser
node_browser -->|"loads app"| node_react_entry
node_react_entry -->|"renders"| node_app
node_user -->|"interacts"| node_app
node_app -->|"handles edits"| node_book_operations
node_app -->|"filters and selects"| node_collection_tools
node_app -->|"shows totals"| node_collection_counts
node_app -->|"imports and exports"| node_json_transfer
node_book_operations -->|"sends book requests"| node_api
node_collection_tools -->|"updates view"| node_app
node_collection_counts -->|"reads collection"| node_app
node_json_transfer -->|"uploads JSON"| node_api
node_json_transfer -->|"downloads JSON"| node_browser
node_api -->|"returns records"| node_book_operations
node_api -->|"returns import result"| node_json_transfer
node_api -->|"validates inputs"| node_input_validation
node_api -->|"queries and persists"| node_book_model
node_api -->|"opens sessions"| node_db_session
node_db_session -->|"connects"| node_postgres

click node_react_entry "https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/main.jsx"
click node_app "https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/App.jsx"
click node_book_operations "https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/App.jsx"
click node_collection_tools "https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/App.jsx"
click node_collection_counts "https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/App.jsx"
click node_json_transfer "https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/App.jsx"
click node_api "https://github.com/meretonga/ev-kutuphanem/blob/main/backend/main.py"
click node_input_validation "https://github.com/meretonga/ev-kutuphanem/blob/main/backend/schemas.py"
click node_book_model "https://github.com/meretonga/ev-kutuphanem/blob/main/backend/models.py"
click node_db_session "https://github.com/meretonga/ev-kutuphanem/blob/main/backend/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_react_entry,node_app,node_book_operations,node_collection_tools,node_collection_counts,node_json_transfer,node_user,node_browser toneBlue
class node_api,node_input_validation toneAmber
class node_book_model,node_db_session toneMint
class node_postgres toneRose
```

## Components

### React interface

- [React entry](https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Library interface](https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Book operations](https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Search and selection](https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Collection counts](https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [JSON transfer](https://github.com/meretonga/ev-kutuphanem/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### API and domain

- [FastAPI routes](https://github.com/meretonga/ev-kutuphanem/blob/main/backend/main.py): `backend/main.py`
- [Input validation](https://github.com/meretonga/ev-kutuphanem/blob/main/backend/schemas.py): `backend/schemas.py`

### Persistence

- [Book model](https://github.com/meretonga/ev-kutuphanem/blob/main/backend/models.py): `backend/models.py`
- [Database sessions](https://github.com/meretonga/ev-kutuphanem/blob/main/backend/database.py): `backend/database.py`

### External services

- **PostgreSQL**

### Other components

- **Library user**
- **Browser runtime**

## Connections

- Library user → Browser runtime: uses
- Browser runtime → React entry: loads app
- React entry → Library interface: renders
- Library user → Library interface: interacts
- Library interface → Book operations: handles edits
- Library interface → Search and selection: filters and selects
- Library interface → Collection counts: shows totals
- Library interface → JSON transfer: imports and exports
- Book operations → FastAPI routes: sends book requests
- Search and selection → Library interface: updates view
- Collection counts → Library interface: reads collection
- JSON transfer → FastAPI routes: uploads JSON
- JSON transfer → Browser runtime: downloads JSON
- FastAPI routes → Book operations: returns records
- FastAPI routes → JSON transfer: returns import result
- FastAPI routes → Input validation: validates inputs
- FastAPI routes → Book model: queries and persists
- FastAPI routes → Database sessions: opens sessions
- Database sessions → PostgreSQL: connects
