# feggall/nauchput_api architecture

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

- Interactive diagram: https://gitdiagram.com/feggall/nauchput_api
- Repository: https://github.com/feggall/nauchput_api

## Overview

НаучПуть is a FastAPI backend for student–supervisor profiles, research-interest matching, applications, and supervisor email verification. The principal workflow is clients creating and updating profiles, finding matches, and submitting applications that supervisors can review and accept or reject. The API also exposes health checks and protected routes. Source excerpts show SQL executed by route handlers through database sessions and email verification through SMTP; omitted sections limit certainty about some route details and internal wiring.

Main entry points: [`nauchput_API.py`](https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py) (FastAPI routes), [`database.py`](https://github.com/feggall/nauchput_api/blob/main/database.py) (DB sessions), [`email_service.py`](https://github.com/feggall/nauchput_api/blob/main/email_service.py) (Verification email), [`schemas.py`](https://github.com/feggall/nauchput_api/blob/main/schemas.py) (Request schemas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API layer"]
  node_routes["FastAPI routes<br/>[nauchput_API.py]"]
  node_auth["API-key check<br/>[nauchput_API.py]"]
  node_schemas["Request schemas<br/>[schemas.py]"]
  node_health["Health checks<br/>[nauchput_API.py]"]
end

subgraph group_domain["Product workflows"]
  node_profiles["Student profiles<br/>[nauchput_API.py]"]
  node_interests["Interest updates<br/>[nauchput_API.py]"]
  node_matching["Student matches<br/>[nauchput_API.py]"]
  node_supervisors["Supervisor profiles<br/>[nauchput_API.py]"]
  node_applications["Applications<br/>[nauchput_API.py]"]
  node_emailverify["Email verification<br/>[nauchput_API.py]"]
end

subgraph group_infra["Persistence and email"]
  node_db["DB sessions<br/>[database.py]"]
  node_mysql[("MySQL database")]
  node_emailservice["Verification email<br/>[email_service.py]"]
  node_smtp(("SMTP server"))
end

node_client(("API client"))

node_client -->|"requests"| node_routes
node_routes -->|"checks key"| node_auth
node_routes -->|"validates input"| node_schemas
node_routes -->|"dispatches"| node_health
node_routes -->|"dispatches"| node_profiles
node_routes -->|"dispatches"| node_interests
node_routes -->|"dispatches"| node_matching
node_routes -->|"dispatches"| node_supervisors
node_routes -->|"dispatches"| node_applications
node_routes -->|"dispatches"| node_emailverify
node_health -->|"checks connection"| node_db
node_profiles -->|"queries"| node_db
node_interests -->|"reads/writes"| node_db
node_matching -->|"queries"| node_db
node_supervisors -->|"reads/writes"| node_db
node_applications -->|"reads/writes"| node_db
node_emailverify -->|"reads/writes"| node_db
node_emailverify -->|"sends code"| node_emailservice
node_db -->|"queries"| node_mysql
node_emailservice -->|"sends email"| node_smtp

click node_routes "https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py"
click node_auth "https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py"
click node_schemas "https://github.com/feggall/nauchput_api/blob/main/schemas.py"
click node_health "https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py"
click node_profiles "https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py"
click node_interests "https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py"
click node_matching "https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py"
click node_supervisors "https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py"
click node_applications "https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py"
click node_emailverify "https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py"
click node_db "https://github.com/feggall/nauchput_api/blob/main/database.py"
click node_emailservice "https://github.com/feggall/nauchput_api/blob/main/email_service.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_routes,node_auth,node_schemas,node_health,node_client toneBlue
class node_profiles,node_interests,node_matching,node_supervisors,node_applications,node_emailverify toneAmber
class node_db,node_mysql,node_emailservice,node_smtp toneMint
```

## Components

### API layer

- [FastAPI routes](https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py): `nauchput_API.py`
- [API-key check](https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py): `nauchput_API.py`
- [Request schemas](https://github.com/feggall/nauchput_api/blob/main/schemas.py): `schemas.py`
- [Health checks](https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py): `nauchput_API.py`

### Product workflows

- [Student profiles](https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py): `nauchput_API.py`
- [Interest updates](https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py): `nauchput_API.py`
- [Student matches](https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py): `nauchput_API.py`
- [Supervisor profiles](https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py): `nauchput_API.py`
- [Applications](https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py): `nauchput_API.py`
- [Email verification](https://github.com/feggall/nauchput_api/blob/main/nauchput_API.py): `nauchput_API.py`

### Persistence and email

- [DB sessions](https://github.com/feggall/nauchput_api/blob/main/database.py): `database.py`
- **MySQL database**
- [Verification email](https://github.com/feggall/nauchput_api/blob/main/email_service.py): `email_service.py`
- **SMTP server**

### Other components

- **API client**

## Connections

- API client → FastAPI routes: requests
- FastAPI routes → API-key check: checks key
- FastAPI routes → Request schemas: validates input
- FastAPI routes → Health checks: dispatches
- FastAPI routes → Student profiles: dispatches
- FastAPI routes → Interest updates: dispatches
- FastAPI routes → Student matches: dispatches
- FastAPI routes → Supervisor profiles: dispatches
- FastAPI routes → Applications: dispatches
- FastAPI routes → Email verification: dispatches
- Health checks → DB sessions: checks connection
- Student profiles → DB sessions: queries
- Interest updates → DB sessions: reads/writes
- Student matches → DB sessions: queries
- Supervisor profiles → DB sessions: reads/writes
- Applications → DB sessions: reads/writes
- Email verification → DB sessions: reads/writes
- Email verification → Verification email: sends code
- DB sessions → MySQL database: queries
- Verification email → SMTP server: sends email
