# viniciusmendes21/api-tcc architecture

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

- Interactive diagram: https://gitdiagram.com/viniciusmendes21/api-tcc
- Repository: https://github.com/viniciusmendes21/api-tcc

## Overview

This is an ASP.NET Core API for correcting Portuguese essays. The principal workflow accepts an essay PDF and theme, prepares a prompt with few-shot examples, sends a request to Gemini, and returns criterion scores and comments. The controller is the central runtime component; the models define its request and response shapes. The excerpts do not show the full PDF-extraction or response-parsing implementation, so those stages are represented within the controller rather than as inferred components. The README provides no further capability details.

Main entry points: [`ProjetocCorrecaoIA/Controllers/CorrecaoController.cs`](https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Controllers/CorrecaoController.cs) (Correction controller), [`ProjetocCorrecaoIA/Program.cs`](https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Program.cs) (ASP.NET host), [`ProjetocCorrecaoIA/Models/RedacaoRequest.cs`](https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Models/RedacaoRequest.cs) (Essay request models), [`ProjetocCorrecaoIA/Models/CorrecaoResponse.cs`](https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Models/CorrecaoResponse.cs) (Scored response models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API runtime"]
  node_host["ASP.NET host<br/>[Program.cs]"]
end

subgraph group_grading["Essay grading"]
  node_controller["Correction controller"]
end

subgraph group_contracts["API contracts"]
  node_input["Essay request models<br/>[RedacaoRequest.cs]"]
  node_result["Scored response models"]
end

subgraph group_integrations["External services"]
  node_gemini["Gemini API"]
  node_openai["OpenAI service"]
end

node_client(("API caller"))

node_client -.->|"sends request"| node_host
node_host -->|"maps controllers"| node_controller
node_controller -->|"uses models"| node_input
node_controller -->|"posts grading request"| node_gemini
node_controller -->|"returns scores"| node_result
node_host -->|"configures service"| node_openai
node_controller -.->|"returns response"| node_client

click node_host "https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Program.cs"
click node_controller "https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Controllers/CorrecaoController.cs"
click node_input "https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Models/RedacaoRequest.cs"
click node_result "https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Models/CorrecaoResponse.cs"

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_host toneBlue
class node_controller toneAmber
class node_input,node_result,node_client toneMint
class node_gemini,node_openai toneRose
```

## Components

### API runtime

- [ASP.NET host](https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Program.cs): `ProjetocCorrecaoIA/Program.cs`

### Essay grading

- [Correction controller](https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Controllers/CorrecaoController.cs): `ProjetocCorrecaoIA/Controllers/CorrecaoController.cs`

### API contracts

- [Essay request models](https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Models/RedacaoRequest.cs): `ProjetocCorrecaoIA/Models/RedacaoRequest.cs`
- [Scored response models](https://github.com/viniciusmendes21/api-tcc/blob/master/ProjetocCorrecaoIA/Models/CorrecaoResponse.cs): `ProjetocCorrecaoIA/Models/CorrecaoResponse.cs`

### External services

- **Gemini API**
- **OpenAI service**

### Other components

- **API caller**

## Connections

- API caller → ASP.NET host: sends request
- ASP.NET host → Correction controller: maps controllers (evidence: `ProjetocCorrecaoIA/Program.cs`)
- Correction controller → Essay request models: uses models (evidence: `ProjetocCorrecaoIA/Controllers/CorrecaoController.cs`)
- Correction controller → Gemini API: posts grading request (evidence: `ProjetocCorrecaoIA/Controllers/CorrecaoController.cs`)
- Correction controller → Scored response models: returns scores (evidence: `ProjetocCorrecaoIA/Controllers/CorrecaoController.cs`)
- ASP.NET host → OpenAI service: configures service (evidence: `ProjetocCorrecaoIA/Program.cs`)
- Correction controller → API caller: returns response
