# polito-thesismanagement/api-spec architecture

> Architecture diagram of the GitHub repository polito-thesismanagement/api-spec, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/polito-thesismanagement/api-spec
- Repository: https://github.com/polito-thesismanagement/api-spec

## Overview

##### Project Type Analysis
This is an API specification project that serves as a contract for a REST API service. The project primarily consists of an OpenAPI (OAS3) specification file that defines the endpoints, data models, and interactions for thesis management at Politecnico di Torino.

##### Key Components

a. Core Components:
- API Gateway/Interface Layer
- Authentication/Authorization Service
- Thesis Management Core Services
- Data Storage Layer

b. Supporting Components:
- Documentation Generation (Swagger UI)
- Mock Server (Prism)
- Client Applications (potential consumers)

##### API Gateway Layer
- Authentication/authorization components
- OpenAPI specification as a governing document

##### Service Layer
- Thesis Proposal Management
- Student Application Handling
- Professor Management
- Department/Course Management

##### Data Layer
- Database representations
- Data storage components

##### Supporting Systems
- Swagger UI component for documentation
- Prism mock server component
- CI/CD elements (based on the GitHub workflow)

Use these visual elements:

Specific Instructions:

##### Validation workflows from GitHub Actions

Key Relationships to Highlight:

##### OpenAPI Spec → Prism Mock Server (showing testing capabilities)

Additional Considerations:

##### Extension points for future development

Level of Detail:

- Keep main components at a high level
- Detailed subcomponents only for critical paths
- Integration points with external systems
- Security boundaries and authentication flows

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef client fill:#FFE5CC,stroke:#FF9933
    classDef gateway fill:#CCE5FF,stroke:#3399FF
    classDef service fill:#E5F2FF,stroke:#3399FF
    classDef data fill:#F2F2F2,stroke:#666666
    classDef security fill:#FFD6D6,stroke:#FF9999
    classDef devtools fill:#D6FFD6,stroke:#99FF99
    classDef documentation fill:#E5CCFF,stroke:#9933FF

    %% Client Layer
    WebClient["Web Application"]:::client
    MobileClient["Mobile Application"]:::client
    ExternalSys["External Systems"]:::client

    %% API Gateway Layer
    APIGateway["API Gateway"]:::gateway
    click APIGateway "https://github.com/polito-ThesisManagement/api-spec/blob/main/openapi.yaml"
    AuthService["Authentication Service"]:::security

    %% Service Layer
    subgraph Services
        ThesisProposals["Thesis Proposal Management"]:::service
        StudentApps["Student Application Handling"]:::service
        ProfessorMgmt["Professor Management"]:::service
        DepartmentMgmt["Department/Course Management"]:::service
    end

    %% Data Layer
    Database[("Main Database")]:::data

    %% Development Tools
    SwaggerUI["Swagger UI Documentation"]:::documentation
    PrismMock["Prism Mock Server"]:::devtools
    click PrismMock "https://github.com/polito-ThesisManagement/api-spec/blob/main/docker-compose.yml"
    
    %% CI/CD Components
    CICD["CI/CD Pipeline"]:::devtools
    click CICD "https://github.com/polito-ThesisManagement/api-spec/blob/main/.github/workflows/validate-openapi.yml"

    %% Issue Templates
    BugTracker["Bug Tracking"]:::devtools
    click BugTracker "https://github.com/polito-ThesisManagement/api-spec/blob/main/.github/ISSUE_TEMPLATE/bug_report.md"
    TaskMgmt["Task Management"]:::devtools
    click TaskMgmt "https://github.com/polito-ThesisManagement/api-spec/blob/main/.github/ISSUE_TEMPLATE/task.md"
    UserStories["User Stories"]:::devtools
    click UserStories "https://github.com/polito-ThesisManagement/api-spec/blob/main/.github/ISSUE_TEMPLATE/user-story.md"

    %% Relationships
    WebClient --> APIGateway
    MobileClient --> APIGateway
    ExternalSys --> APIGateway
    APIGateway --> AuthService
    AuthService --> Services
    
    ThesisProposals --> Database
    StudentApps --> Database
    ProfessorMgmt --> Database
    DepartmentMgmt --> Database
    
    APIGateway --> SwaggerUI
    APIGateway --> PrismMock
    APIGateway --> CICD

    CICD --> BugTracker
    CICD --> TaskMgmt
    CICD --> UserStories

    %% Legend
    subgraph Legend
        Client["Client Applications"]:::client
        Gateway["API Components"]:::gateway
        SecurityComp["Security Components"]:::security
        ServiceComp["Service Components"]:::service
        DataComp["Data Storage"]:::data
        DevTools["Development Tools"]:::devtools
        DocTools["Documentation"]:::documentation
    end
```
