# unb-mds/2026-02-tambureteiunb architecture

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

- Interactive diagram: https://gitdiagram.com/unb-mds/2026-02-tambureteiunb
- Repository: https://github.com/unb-mds/2026-02-tambureteiunb

## Overview

Tamburetei UnB combines an academic-data portal with a collaborative course hub. Students browse courses and disciplines, authenticate, and contribute pseudonymous difficulty reports or materials; reports and content can be moderated. A separate ETL capability extracts, anonymizes, and loads academic datasets, while student-contributed statistics are consolidated into quorum-backed analytics. The graph preserves these documented branches. Some API, pipeline, and frontend integrations are unsampled; dashed edges mark relationships not confirmed by excerpts.

Main entry points: [`backend/app/main.py`](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/services/denuncia_service.py`](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/services/denuncia_service.py) (Report and moderation rules), [`backend/app/services/doacao_service.py`](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/services/doacao_service.py) (Statistics donations and quorum), [`backend/app/core/database.py`](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/core/database.py) (PostgreSQL database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Student portal"]
  node_portal["Web portal<br/>[page.tsx]"]
  node_authui["Login and signup<br/>[authService.ts]"]
  node_catalogui["Course and discipline browsing<br/>[page.tsx]"]
  node_reportsui["Difficulty reports"]
  node_materialsi["Study materials<br/>[MateriaisApoio.tsx]"]
  node_moderationui["Moderation interface<br/>[page.tsx]"]
  node_http["HTTP client<br/>[httpClient.ts]"]
end

subgraph group_api["API capabilities"]
  node_entry["FastAPI application<br/>[main.py]"]
  node_authapi["Authentication routes<br/>[auth.py]"]
  node_catalogapi["Curriculum routes<br/>[catalogo.py]"]
  node_commentapi["Comments and reports<br/>[comentarios.py]"]
  node_materialapi["Materials routes<br/>[materiais.py]"]
  node_moderationapi["Moderation routes<br/>[moderacao.py]"]
  node_statsapi["Consolidated statistics"]
end

subgraph group_data["Persistence and domain"]
  node_authsvc["Auth service<br/>[auth_service.py]"]
  node_commentsvc["Comment service"]
  node_reportsvc["Report and moderation rules"]
  node_userrepo["User repository<br/>[usuario_repo.py]"]
  node_commentrepo["Comment repository<br/>[comentario_repo.py]"]
  node_reportrepo["Report repository<br/>[denuncia_repo.py]"]
  node_db[("PostgreSQL database<br/>[database.py]")]
end

subgraph group_etl["Academic data pipeline"]
  node_pipeline["ETL pipeline<br/>[runner.py]"]
  node_extract["SIGAA extraction<br/>[sigaa_extractor.py]"]
  node_transform["Sanitize and transform"]
  node_loader["Database and export loaders<br/>[db_loader.py]"]
end

subgraph group_analytics["Community analytics"]
  node_donations["Statistics donations and quorum<br/>[doacao_service.py]"]
  node_statsrepo["Consolidated statistics repository"]
  node_dashboard["Dashboard and metrics<br/>[dashboard.py]"]
end

node_student(("Student"))
node_sources["SIGAA and DPO/UnB data"]

node_student -->|"uses"| node_portal
node_portal -.->|"offers sign-in"| node_authui
node_portal -.->|"browses curriculum"| node_catalogui
node_student -->|"contributes reports"| node_reportsui
node_student -.->|"shares materials"| node_materialsi
node_student -.->|"moderates content"| node_moderationui
node_authui -->|"sends requests"| node_http
node_reportsui -->|"sends requests"| node_http
node_http -.->|"calls API"| node_entry
node_entry -->|"registers routes"| node_authapi
node_entry -->|"registers routes"| node_catalogapi
node_entry -->|"registers routes"| node_commentapi
node_entry -->|"registers routes"| node_materialapi
node_entry -->|"registers routes"| node_moderationapi
node_entry -->|"registers routes"| node_statsapi
node_authapi -->|"calls"| node_authsvc
node_authsvc -->|"reads and writes"| node_userrepo
node_authapi -->|"obtains session"| node_db
node_commentapi -->|"routes comment actions"| node_commentsvc
node_commentapi -->|"routes report actions"| node_reportsvc
node_commentsvc -->|"queries comments"| node_commentrepo
node_reportsvc -->|"persists reports"| node_reportrepo
node_moderationapi -.->|"handles decisions"| node_reportsvc
node_materialapi -.->|"supports reported materials"| node_reportsvc
node_commentrepo -.->|"persists data"| node_db
node_reportrepo -.->|"persists data"| node_db
node_sources -->|"provides academic data"| node_extract
node_pipeline -.->|"runs extraction"| node_extract
node_extract -->|"transforms records"| node_transform
node_pipeline -.->|"loads results"| node_loader
node_loader -.->|"writes records"| node_db
node_student -->|"donates statistics"| node_donations
node_statsapi -->|"serves consolidation"| node_donations
node_donations -->|"saves consensus"| node_statsrepo
node_dashboard -.->|"shows analytical results"| node_donations

click node_portal "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/app/page.tsx"
click node_authui "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/services/authService.ts"
click node_catalogui "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/app/disciplinas/page.tsx"
click node_reportsui "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/services/difficultyService.ts"
click node_materialsi "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/components/MateriaisApoio.tsx"
click node_moderationui "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/app/moderacao/page.tsx"
click node_http "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/services/httpClient.ts"
click node_entry "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/main.py"
click node_authapi "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/auth.py"
click node_catalogapi "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/catalogo.py"
click node_commentapi "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/comentarios.py"
click node_materialapi "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/materiais.py"
click node_moderationapi "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/moderacao.py"
click node_statsapi "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/estatisticas_consolidadas.py"
click node_authsvc "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/services/auth_service.py"
click node_commentsvc "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/services/comentario_service.py"
click node_reportsvc "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/services/denuncia_service.py"
click node_userrepo "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/repositories/usuario_repo.py"
click node_commentrepo "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/repositories/comentario_repo.py"
click node_reportrepo "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/repositories/denuncia_repo.py"
click node_db "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/core/database.py"
click node_pipeline "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/pipeline/runner.py"
click node_extract "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/pipeline/extractors/sigaa_extractor.py"
click node_transform "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/pipeline/transformers/sigaa_transformer.py"
click node_loader "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/pipeline/loaders/db_loader.py"
click node_donations "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/services/doacao_service.py"
click node_statsrepo "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/repositories/estatistica_repo.py"
click node_dashboard "https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/dashboard.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_portal,node_authui,node_catalogui,node_reportsui,node_materialsi,node_moderationui,node_http toneBlue
class node_entry,node_authapi,node_catalogapi,node_commentapi,node_materialapi,node_moderationapi,node_statsapi toneAmber
class node_authsvc,node_commentsvc,node_reportsvc,node_userrepo,node_commentrepo,node_reportrepo,node_db toneMint
class node_pipeline,node_extract,node_transform,node_loader toneRose
class node_donations,node_statsrepo,node_dashboard,node_student,node_sources toneIndigo
```

## Components

### Student portal

- [Web portal](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Login and signup](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/services/authService.ts): `frontend/src/services/authService.ts`
- [Course and discipline browsing](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/app/disciplinas/page.tsx): `frontend/src/app/disciplinas/page.tsx`
- [Difficulty reports](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/services/difficultyService.ts): `frontend/src/services/difficultyService.ts`
- [Study materials](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/components/MateriaisApoio.tsx): `frontend/components/MateriaisApoio.tsx`
- [Moderation interface](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/app/moderacao/page.tsx): `frontend/src/app/moderacao/page.tsx`
- [HTTP client](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/frontend/src/services/httpClient.ts): `frontend/src/services/httpClient.ts`

### API capabilities

- [FastAPI application](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication routes](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/auth.py): `backend/app/api/routers/auth.py`
- [Curriculum routes](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/catalogo.py): `backend/app/api/routers/catalogo.py`
- [Comments and reports](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/comentarios.py): `backend/app/api/routers/comentarios.py`
- [Materials routes](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/materiais.py): `backend/app/api/routers/materiais.py`
- [Moderation routes](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/moderacao.py): `backend/app/api/routers/moderacao.py`
- [Consolidated statistics](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/estatisticas_consolidadas.py): `backend/app/api/routers/estatisticas_consolidadas.py`

### Persistence and domain

- [Auth service](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [Comment service](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/services/comentario_service.py): `backend/app/services/comentario_service.py`
- [Report and moderation rules](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/services/denuncia_service.py): `backend/app/services/denuncia_service.py`
- [User repository](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/repositories/usuario_repo.py): `backend/app/repositories/usuario_repo.py`
- [Comment repository](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/repositories/comentario_repo.py): `backend/app/repositories/comentario_repo.py`
- [Report repository](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/repositories/denuncia_repo.py): `backend/app/repositories/denuncia_repo.py`
- [PostgreSQL database](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Academic data pipeline

- [ETL pipeline](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/pipeline/runner.py): `backend/app/pipeline/runner.py`
- [SIGAA extraction](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/pipeline/extractors/sigaa_extractor.py): `backend/app/pipeline/extractors/sigaa_extractor.py`
- [Sanitize and transform](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/pipeline/transformers/sigaa_transformer.py): `backend/app/pipeline/transformers/sigaa_transformer.py`
- [Database and export loaders](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/pipeline/loaders/db_loader.py): `backend/app/pipeline/loaders/db_loader.py`

### Community analytics

- [Statistics donations and quorum](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/services/doacao_service.py): `backend/app/services/doacao_service.py`
- [Consolidated statistics repository](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/repositories/estatistica_repo.py): `backend/app/repositories/estatistica_repo.py`
- [Dashboard and metrics](https://github.com/unb-mds/2026-02-tambureteiunb/blob/main/backend/app/api/routers/dashboard.py): `backend/app/api/routers/dashboard.py`

### Other components

- **Student**
- **SIGAA and DPO/UnB data**

## Connections

- Student → Web portal: uses (evidence: `README.md`)
- Web portal → Login and signup: offers sign-in
- Web portal → Course and discipline browsing: browses curriculum
- Student → Difficulty reports: contributes reports (evidence: `README.md`)
- Student → Study materials: shares materials (evidence: `README.md`)
- Student → Moderation interface: moderates content (evidence: `README.md`)
- Login and signup → HTTP client: sends requests (evidence: `frontend/src/services/authService.ts`)
- Difficulty reports → HTTP client: sends requests (evidence: `frontend/src/services/difficultyService.ts`)
- HTTP client → FastAPI application: calls API
- FastAPI application → Authentication routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Curriculum routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Comments and reports: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Materials routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Moderation routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Consolidated statistics: registers routes (evidence: `backend/app/main.py`)
- Authentication routes → Auth service: calls (evidence: `backend/app/api/routers/auth.py`)
- Auth service → User repository: reads and writes (evidence: `backend/app/services/auth_service.py`)
- Authentication routes → PostgreSQL database: obtains session (evidence: `backend/app/api/routers/auth.py`)
- Comments and reports → Comment service: routes comment actions (evidence: `backend/app/api/routers/comentarios.py`)
- Comments and reports → Report and moderation rules: routes report actions (evidence: `backend/app/api/routers/comentarios.py`)
- Comment service → Comment repository: queries comments (evidence: `backend/app/services/comentario_service.py`)
- Report and moderation rules → Report repository: persists reports (evidence: `backend/app/services/denuncia_service.py`)
- Moderation routes → Report and moderation rules: handles decisions
- Materials routes → Report and moderation rules: supports reported materials
- Comment repository → PostgreSQL database: persists data
- Report repository → PostgreSQL database: persists data
- SIGAA and DPO/UnB data → SIGAA extraction: provides academic data (evidence: `README.md`)
- ETL pipeline → SIGAA extraction: runs extraction
- SIGAA extraction → Sanitize and transform: transforms records (evidence: `backend/app/pipeline/extractors/sigaa_extractor.py`)
- ETL pipeline → Database and export loaders: loads results
- Database and export loaders → PostgreSQL database: writes records
- Student → Statistics donations and quorum: donates statistics (evidence: `README.md`)
- Consolidated statistics → Statistics donations and quorum: serves consolidation (evidence: `backend/app/api/routers/estatisticas_consolidadas.py`)
- Statistics donations and quorum → Consolidated statistics repository: saves consensus (evidence: `backend/app/services/doacao_service.py`)
- Dashboard and metrics → Statistics donations and quorum: shows analytical results
