# buzek69/stredoskolsky_internat architecture

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

- Interactive diagram: https://gitdiagram.com/buzek69/stredoskolsky_internat
- Repository: https://github.com/buzek69/stredoskolsky_internat

## Overview

This repository is a small Express backend for a school-dormitory database project. Its visible workflow is an HTTP request entering the Express app, being routed to the users controller, and the controller querying SQL Server and returning user records. The database connection is implemented separately; the tree also contains SQL schema, query, and seed files. No frontend implementation or broader product workflow is evident from the README and sampled source, so those capabilities are not inferred.

Main entry points: [`backend/index.js`](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/index.js) (Express app), [`backend/routes/userRoutes.js`](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/routes/userRoutes.js) (User routes), [`backend/controllers/userController.js`](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/controllers/userController.js) (User controller), [`backend/database/db.js`](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/database/db.js) (SQL connection pool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_app["Express app<br/>[index.js]"]
  node_routes["User routes<br/>[userRoutes.js]"]
  node_controller["User controller<br/>[userController.js]"]
end

subgraph group_data["Database access"]
  node_pool["SQL connection pool<br/>[db.js]"]
  node_sqlserver[("SQL Server")]
end

subgraph group_sql["SQL resources"]
  node_schema["Table definitions<br/>[create_tables.sql]"]
  node_queries["SQL queries<br/>[queries.sql]"]
  node_seed_example["Example seed data<br/>[seed_example.sql]"]
  node_seed_static["Static seed data"]
end

node_client(("API client"))

node_client -.->|"sends requests"| node_app
node_app -->|"mounts routes"| node_routes
node_routes -->|"dispatches to"| node_controller
node_controller -->|"queries through"| node_pool
node_pool -->|"connects to"| node_sqlserver

click node_app "https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/index.js"
click node_routes "https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/routes/userRoutes.js"
click node_controller "https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/controllers/userController.js"
click node_pool "https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/database/db.js"
click node_schema "https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/database/create_tables.sql"
click node_queries "https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/database/queries.sql"
click node_seed_example "https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/database/seeds/seed_example.sql"
click node_seed_static "https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/database/seeds/seed_static_tables.sql"

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_routes,node_controller,node_client toneBlue
class node_pool,node_sqlserver toneAmber
class node_schema,node_queries,node_seed_example,node_seed_static toneMint
```

## Components

### HTTP API

- [Express app](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/index.js): `backend/index.js`
- [User routes](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/routes/userRoutes.js): `backend/routes/userRoutes.js`
- [User controller](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`

### Database access

- [SQL connection pool](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/database/db.js): `backend/database/db.js`
- **SQL Server**

### SQL resources

- [Table definitions](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/database/create_tables.sql): `backend/database/create_tables.sql`
- [SQL queries](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/database/queries.sql): `backend/database/queries.sql`
- [Example seed data](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/database/seeds/seed_example.sql): `backend/database/seeds/seed_example.sql`
- [Static seed data](https://github.com/buzek69/stredoskolsky_internat/blob/main/backend/database/seeds/seed_static_tables.sql): `backend/database/seeds/seed_static_tables.sql`

### Other components

- **API client**

## Connections

- API client → Express app: sends requests
- Express app → User routes: mounts routes (evidence: `backend/index.js`)
- User routes → User controller: dispatches to (evidence: `backend/routes/userRoutes.js`)
- User controller → SQL connection pool: queries through (evidence: `backend/controllers/userController.js`)
- SQL connection pool → SQL Server: connects to (evidence: `backend/database/db.js`)
