# munchkin112/q-net-backend architecture

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

- Interactive diagram: https://gitdiagram.com/munchkin112/q-net-backend
- Repository: https://github.com/munchkin112/q-net-backend

## Overview

Q-Net-Backend is currently a shared FastAPI foundation, not the full certificate-search product. Its implemented user workflow is checking server health or requesting a read-only database readiness check; the latter queries PostgreSQL for connectivity and required tables. The README describes certificate search, Google integration, recommendations, and Calendar as work in other branches, and says the Agent package has no execution graph on this branch, so those are not shown as runtime components.

Main entry points: [`backend/db/check.py`](https://github.com/munchkin112/q-net-backend/blob/main/backend/db/check.py) (Readiness check), [`backend/db/connection.py`](https://github.com/munchkin112/q-net-backend/blob/main/backend/db/connection.py) (DB connection), [`backend/main.py`](https://github.com/munchkin112/q-net-backend/blob/main/backend/main.py) (Health endpoints), [`backend/settings.py`](https://github.com/munchkin112/q-net-backend/blob/main/backend/settings.py) (Settings loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_api["Health endpoints<br/>[main.py]"]
end

subgraph group_db["Database checks"]
  node_check["Readiness check<br/>[check.py]"]
  node_connection["DB connection<br/>[connection.py]"]
end

subgraph group_config["Configuration"]
  node_settings["Settings loader<br/>[settings.py]"]
end

node_client(("API client"))
node_postgres[("PostgreSQL")]

node_client -->|"requests health"| node_api
node_api -->|"checks database"| node_check
node_check -->|"opens connection"| node_connection
node_connection -->|"loads settings"| node_settings
node_check -->|"queries tables"| node_postgres
node_connection -->|"connects"| node_postgres

click node_api "https://github.com/munchkin112/q-net-backend/blob/main/backend/main.py"
click node_check "https://github.com/munchkin112/q-net-backend/blob/main/backend/db/check.py"
click node_connection "https://github.com/munchkin112/q-net-backend/blob/main/backend/db/connection.py"
click node_settings "https://github.com/munchkin112/q-net-backend/blob/main/backend/settings.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_api,node_client toneBlue
class node_check,node_connection,node_postgres toneAmber
class node_settings toneMint
```

## Components

### HTTP API

- [Health endpoints](https://github.com/munchkin112/q-net-backend/blob/main/backend/main.py): `backend/main.py`

### Database checks

- [Readiness check](https://github.com/munchkin112/q-net-backend/blob/main/backend/db/check.py): `backend/db/check.py`
- [DB connection](https://github.com/munchkin112/q-net-backend/blob/main/backend/db/connection.py): `backend/db/connection.py`

### Configuration

- [Settings loader](https://github.com/munchkin112/q-net-backend/blob/main/backend/settings.py): `backend/settings.py`

### Other components

- **API client**
- **PostgreSQL**

## Connections

- API client → Health endpoints: requests health (evidence: `README.md`)
- Health endpoints → Readiness check: checks database (evidence: `backend/main.py`)
- Readiness check → DB connection: opens connection (evidence: `backend/db/check.py`)
- DB connection → Settings loader: loads settings (evidence: `backend/db/connection.py`)
- Readiness check → PostgreSQL: queries tables (evidence: `backend/db/check.py`)
- DB connection → PostgreSQL: connects (evidence: `backend/db/connection.py`)
