# vyache31/urfucampusflow architecture

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

- Interactive diagram: https://gitdiagram.com/vyache31/urfucampusflow
- Repository: https://github.com/vyache31/urfucampusflow

## Overview

UrFUCampusFlow is an internal web system for curators coordinating university project practicums. The principal workflow is curators using the React interface to manage cases, semesters, teams and student assignments, then track team case history, evaluations, meetings and reports. FastAPI endpoints delegate business operations to services and repositories; repositories persist domain data in PostgreSQL. Separate branches support Microsoft Outlook calendar integration, AI case generation and a Telegram bot for student-facing case discovery and interview booking. Source excerpts are partial, so links for undocumented domain flows are omitted.

Main entry points: [`backend/repositories`](https://github.com/vyache31/urfucampusflow/tree/main/backend/repositories) (Data repositories), [`backend/main.py`](https://github.com/vyache31/urfucampusflow/blob/main/backend/main.py) (FastAPI app), [`backend/api/v1/endpoints/team.py`](https://github.com/vyache31/urfucampusflow/blob/main/backend/api/v1/endpoints/team.py) (Team endpoints), [`frontend/src/pages`](https://github.com/vyache31/urfucampusflow/tree/main/frontend/src/pages) (Workflow pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Curator interface"]
  node_react_app["React app<br/>[App.tsx]"]
  node_web_pages["Workflow pages"]
  node_frontend_api["API clients"]
end

subgraph group_backend["Backend application"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_auth["Authentication<br/>[auth_depends.py]"]
  node_websocket["WebSocket manager"]
end

subgraph group_domain["Practicum domains"]
  node_case_api["Case endpoints<br/>[case.py]"]
  node_case_service["Case management<br/>[case_service.py]"]
  node_team_api["Team endpoints<br/>[team.py]"]
  node_team_service["Team management<br/>[team_service.py]"]
  node_meetings["Meetings and tasks"]
  node_history["Team case history"]
  node_evaluations["Evaluations"]
  node_reports["Reporting<br/>[ReportPage.tsx]"]
end

subgraph group_storage["Persistence"]
  node_repositories["Data repositories"]
  node_postgres[("PostgreSQL<br/>[database.py]")]
end

subgraph group_integrations["External channels"]
  node_oauth_service["Outlook OAuth"]
  node_oauth_client["Microsoft OAuth client"]
  node_graph_client["Microsoft Graph client"]
  node_ai["AI case generation<br/>[ai_service.py]"]
  node_telegram["Telegram bot<br/>[tg_routers.py]"]
  node_bot_api["Bot backend API<br/>[backend_api.py]"]
end

node_curator(("Curator"))
node_microsoft["Microsoft Graph"]
node_ai_provider["Groq API"]
node_students(("Students"))

node_curator -->|"uses"| node_react_app
node_react_app -->|"routes to"| node_web_pages
node_web_pages -.->|"requests data"| node_frontend_api
node_frontend_api -->|"calls API"| node_fastapi
node_fastapi -->|"registers"| node_case_api
node_fastapi -->|"registers"| node_team_api
node_case_api -->|"delegates to"| node_case_service
node_team_api -->|"delegates to"| node_team_service
node_team_api -->|"invokes"| node_meetings
node_team_api -.->|"invokes"| node_history
node_case_service -.->|"uses"| node_repositories
node_team_service -.->|"uses"| node_repositories
node_meetings -->|"uses"| node_repositories
node_history -.->|"uses"| node_repositories
node_evaluations -->|"uses"| node_repositories
node_repositories -->|"persists data"| node_postgres
node_fastapi -.->|"uses dependencies"| node_auth
node_team_api -.->|"delegates to"| node_oauth_service
node_oauth_service -->|"exchanges tokens"| node_oauth_client
node_oauth_service -->|"fetches profile"| node_graph_client
node_oauth_client -->|"requests tokens"| node_microsoft
node_graph_client -->|"calls Graph"| node_microsoft
node_case_api -->|"invokes"| node_ai
node_ai -.->|"generates content"| node_ai_provider
node_telegram -->|"requests bot data"| node_bot_api
node_students -->|"discovers cases"| node_telegram
node_web_pages -->|"includes report view"| node_reports
node_fastapi -->|"registers"| node_websocket

click node_react_app "https://github.com/vyache31/urfucampusflow/blob/main/frontend/src/app/App.tsx"
click node_web_pages "https://github.com/vyache31/urfucampusflow/tree/main/frontend/src/pages"
click node_frontend_api "https://github.com/vyache31/urfucampusflow/tree/main/frontend/src/services"
click node_fastapi "https://github.com/vyache31/urfucampusflow/blob/main/backend/main.py"
click node_auth "https://github.com/vyache31/urfucampusflow/blob/main/backend/dependies/auth_depends.py"
click node_case_api "https://github.com/vyache31/urfucampusflow/blob/main/backend/api/v1/endpoints/case.py"
click node_case_service "https://github.com/vyache31/urfucampusflow/blob/main/backend/services/case_service.py"
click node_team_api "https://github.com/vyache31/urfucampusflow/blob/main/backend/api/v1/endpoints/team.py"
click node_team_service "https://github.com/vyache31/urfucampusflow/blob/main/backend/services/team_service.py"
click node_meetings "https://github.com/vyache31/urfucampusflow/blob/main/backend/services/meetings_service.py"
click node_history "https://github.com/vyache31/urfucampusflow/blob/main/backend/services/team_case_history_service.py"
click node_evaluations "https://github.com/vyache31/urfucampusflow/blob/main/backend/services/evaluation_service.py"
click node_reports "https://github.com/vyache31/urfucampusflow/blob/main/frontend/src/pages/Report/ReportPage.tsx"
click node_repositories "https://github.com/vyache31/urfucampusflow/tree/main/backend/repositories"
click node_postgres "https://github.com/vyache31/urfucampusflow/blob/main/backend/database.py"
click node_oauth_service "https://github.com/vyache31/urfucampusflow/blob/main/backend/services/microsoft_oauth_service.py"
click node_oauth_client "https://github.com/vyache31/urfucampusflow/blob/main/backend/integrations/microsoft_oauth_client.py"
click node_graph_client "https://github.com/vyache31/urfucampusflow/blob/main/backend/integrations/microsoft_graph_client.py"
click node_ai "https://github.com/vyache31/urfucampusflow/blob/main/backend/services/ai_service.py"
click node_telegram "https://github.com/vyache31/urfucampusflow/blob/main/backend/tg_bot/tg_routers.py"
click node_bot_api "https://github.com/vyache31/urfucampusflow/blob/main/backend/tg_bot/backend_api.py"
click node_websocket "https://github.com/vyache31/urfucampusflow/blob/main/backend/infrastructure/websocket/websocket_manager.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_app,node_web_pages,node_frontend_api toneBlue
class node_fastapi,node_auth,node_websocket toneAmber
class node_case_api,node_case_service,node_team_api,node_team_service,node_meetings,node_history,node_evaluations,node_reports,node_ai_provider toneMint
class node_repositories,node_postgres toneRose
class node_oauth_service,node_oauth_client,node_graph_client,node_ai,node_telegram,node_bot_api,node_curator,node_microsoft,node_students toneIndigo
```

## Components

### Curator interface

- [React app](https://github.com/vyache31/urfucampusflow/blob/main/frontend/src/app/App.tsx): `frontend/src/app/App.tsx`
- [Workflow pages](https://github.com/vyache31/urfucampusflow/tree/main/frontend/src/pages): `frontend/src/pages`
- [API clients](https://github.com/vyache31/urfucampusflow/tree/main/frontend/src/services): `frontend/src/services`

### Backend application

- [FastAPI app](https://github.com/vyache31/urfucampusflow/blob/main/backend/main.py): `backend/main.py`
- [Authentication](https://github.com/vyache31/urfucampusflow/blob/main/backend/dependies/auth_depends.py): `backend/dependies/auth_depends.py`
- [WebSocket manager](https://github.com/vyache31/urfucampusflow/blob/main/backend/infrastructure/websocket/websocket_manager.py): `backend/infrastructure/websocket/websocket_manager.py`

### Practicum domains

- [Case endpoints](https://github.com/vyache31/urfucampusflow/blob/main/backend/api/v1/endpoints/case.py): `backend/api/v1/endpoints/case.py`
- [Case management](https://github.com/vyache31/urfucampusflow/blob/main/backend/services/case_service.py): `backend/services/case_service.py`
- [Team endpoints](https://github.com/vyache31/urfucampusflow/blob/main/backend/api/v1/endpoints/team.py): `backend/api/v1/endpoints/team.py`
- [Team management](https://github.com/vyache31/urfucampusflow/blob/main/backend/services/team_service.py): `backend/services/team_service.py`
- [Meetings and tasks](https://github.com/vyache31/urfucampusflow/blob/main/backend/services/meetings_service.py): `backend/services/meetings_service.py`
- [Team case history](https://github.com/vyache31/urfucampusflow/blob/main/backend/services/team_case_history_service.py): `backend/services/team_case_history_service.py`
- [Evaluations](https://github.com/vyache31/urfucampusflow/blob/main/backend/services/evaluation_service.py): `backend/services/evaluation_service.py`
- [Reporting](https://github.com/vyache31/urfucampusflow/blob/main/frontend/src/pages/Report/ReportPage.tsx): `frontend/src/pages/Report/ReportPage.tsx`

### Persistence

- [Data repositories](https://github.com/vyache31/urfucampusflow/tree/main/backend/repositories): `backend/repositories`
- [PostgreSQL](https://github.com/vyache31/urfucampusflow/blob/main/backend/database.py): `backend/database.py`

### External channels

- [Outlook OAuth](https://github.com/vyache31/urfucampusflow/blob/main/backend/services/microsoft_oauth_service.py): `backend/services/microsoft_oauth_service.py`
- [Microsoft OAuth client](https://github.com/vyache31/urfucampusflow/blob/main/backend/integrations/microsoft_oauth_client.py): `backend/integrations/microsoft_oauth_client.py`
- [Microsoft Graph client](https://github.com/vyache31/urfucampusflow/blob/main/backend/integrations/microsoft_graph_client.py): `backend/integrations/microsoft_graph_client.py`
- [AI case generation](https://github.com/vyache31/urfucampusflow/blob/main/backend/services/ai_service.py): `backend/services/ai_service.py`
- [Telegram bot](https://github.com/vyache31/urfucampusflow/blob/main/backend/tg_bot/tg_routers.py): `backend/tg_bot/tg_routers.py`
- [Bot backend API](https://github.com/vyache31/urfucampusflow/blob/main/backend/tg_bot/backend_api.py): `backend/tg_bot/backend_api.py`

### Other components

- **Curator**
- **Microsoft Graph**
- **Groq API**
- **Students**

## Connections

- Curator → React app: uses
- React app → Workflow pages: routes to (evidence: `frontend/src/app/App.tsx`)
- Workflow pages → API clients: requests data
- API clients → FastAPI app: calls API
- FastAPI app → Case endpoints: registers (evidence: `backend/main.py`)
- FastAPI app → Team endpoints: registers (evidence: `backend/main.py`)
- Case endpoints → Case management: delegates to (evidence: `backend/api/v1/endpoints/case.py`)
- Team endpoints → Team management: delegates to (evidence: `backend/api/v1/endpoints/team.py`)
- Team endpoints → Meetings and tasks: invokes (evidence: `backend/api/v1/endpoints/team.py`)
- Team endpoints → Team case history: invokes (evidence: `backend/api/v1/endpoints/team.py`)
- Case management → Data repositories: uses
- Team management → Data repositories: uses
- Meetings and tasks → Data repositories: uses
- Team case history → Data repositories: uses
- Evaluations → Data repositories: uses (evidence: `backend/repositories/evaluation_repository.py`)
- Data repositories → PostgreSQL: persists data
- FastAPI app → Authentication: uses dependencies
- Team endpoints → Outlook OAuth: delegates to
- Outlook OAuth → Microsoft OAuth client: exchanges tokens (evidence: `backend/services/microsoft_oauth_service.py`)
- Outlook OAuth → Microsoft Graph client: fetches profile (evidence: `backend/services/microsoft_oauth_service.py`)
- Microsoft OAuth client → Microsoft Graph: requests tokens (evidence: `backend/integrations/microsoft_oauth_client.py`)
- Microsoft Graph client → Microsoft Graph: calls Graph (evidence: `backend/integrations/microsoft_graph_client.py`)
- Case endpoints → AI case generation: invokes (evidence: `backend/api/v1/endpoints/case.py`)
- AI case generation → Groq API: generates content
- Telegram bot → Bot backend API: requests bot data (evidence: `backend/tg_bot/tg_routers.py`)
- Students → Telegram bot: discovers cases
- Workflow pages → Reporting: includes report view (evidence: `frontend/src/app/App.tsx`)
- FastAPI app → WebSocket manager: registers (evidence: `backend/main.py`)
