# michaell027/employee_review architecture

> Architecture diagram of the GitHub repository michaell027/employee_review, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/michaell027/employee_review
- Repository: https://github.com/michaell027/employee_review

## Overview

##### Main Components

A. API Layer
- FastAPI Application (main.py)
- Route Controllers (routers/)
- Questions Router
- Review Router
- Users Router

B. Service Layer
- Question Service
- Review Service
- Llama Integration Service
- Llama Client
- Llama Handler
- Llama Config

C. Data Layer
- Models
- Employee
- Evaluation
- Generated Questions
- Llama Response
- Review
- CRUD Operations
- Employee Role CRUD

D. External Services
- Ollama (LLM Service)

- [Client Applications]
- ↓
- [API Layer (FastAPI)]
- ↓
- [Service Layer]
- ↓
- [Data Layer]
- ↓
- [External Services]

##### Component Relationships

- API routes → Services
- Services → Models
- Services → Llama Integration
- Llama Integration → Ollama Service

##### Specific Elements

- FastAPI Application
- /questions
- /review
- /users

- Services
- QuestionService
- ReviewService
- LlamaIntegration
- Client
- Handler
- Config

- Models
- Employee
- Evaluation
- GeneratedQuestions
- LlamaResponse
- Review

##### Technical Details to Highlight

- ASGI Server (Uvicorn) handling
- Docker containerization
- Poetry dependency management
- Async operations
- Error handling flow

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        C[Client Applications]
    end

    subgraph API["API Layer"]
        FA["FastAPI App"]:::api
        QR["Questions Router"]:::api
        RR["Review Router"]:::api
        UR["Users Router"]:::api
    end

    subgraph Services["Service Layer"]
        QS["Question Service"]:::service
        RS["Review Service"]:::service
        
        subgraph LI["Llama Integration"]
            LC["Llama Client"]:::service
            LH["Llama Handler"]:::service
            LCF["Llama Config"]:::service
        end
    end

    subgraph Data["Data Layer"]
        EM["Employee Model"]:::data
        EVM["Evaluation Model"]:::data
        GQM["Generated Questions Model"]:::data
        LRM["Llama Response Model"]:::data
        RVM["Review Model"]:::data
        ERC["Employee Role CRUD"]:::data
    end

    subgraph External["External Services"]
        OS["Ollama Service"]:::external
    end

    subgraph Utils["Utilities"]
        EH["Exception Handler"]:::util
    end

    %% Relationships
    C --> FA
    FA --> QR & RR & UR
    QR --> QS
    RR --> RS
    UR --> ERC
    QS --> LC
    RS --> LC
    LC --> LH
    LH --> LCF
    LH --> OS
    QS --> GQM
    RS --> RVM
    ERC --> EM
    
    %% Click Events
    click FA "https://github.com/michaell027/employee_review/blob/main/app/main.py"
    click QR "https://github.com/michaell027/employee_review/blob/main/app/routers/questions.py"
    click RR "https://github.com/michaell027/employee_review/blob/main/app/routers/review.py"
    click UR "https://github.com/michaell027/employee_review/blob/main/app/routers/users.py"
    click QS "https://github.com/michaell027/employee_review/blob/main/app/services/question_service.py"
    click RS "https://github.com/michaell027/employee_review/blob/main/app/services/review_service.py"
    click LC "https://github.com/michaell027/employee_review/blob/main/app/services/llama_integration/llama_client.py"
    click LH "https://github.com/michaell027/employee_review/blob/main/app/services/llama_integration/llama_handler.py"
    click LCF "https://github.com/michaell027/employee_review/blob/main/app/services/llama_integration/llama_config.py"
    click EM "https://github.com/michaell027/employee_review/blob/main/app/models/employee.py"
    click EVM "https://github.com/michaell027/employee_review/blob/main/app/models/evaluation.py"
    click GQM "https://github.com/michaell027/employee_review/blob/main/app/models/generated_questions.py"
    click LRM "https://github.com/michaell027/employee_review/blob/main/app/models/llama_response.py"
    click RVM "https://github.com/michaell027/employee_review/blob/main/app/models/review.py"
    click ERC "https://github.com/michaell027/employee_review/blob/main/app/crud/employee_role.py"
    click OS "https://github.com/michaell027/employee_review/tree/main/ollama/Dockerfile"
    click EH "https://github.com/michaell027/employee_review/blob/main/app/utils/exception_handler.py"

    %% Styling
    classDef api fill:#2374f7,stroke:#000,stroke-width:2px,color:#fff
    classDef service fill:#85d075,stroke:#000,stroke-width:2px
    classDef data fill:#f7d123,stroke:#000,stroke-width:2px
    classDef external fill:#9d4edd,stroke:#000,stroke-width:2px
    classDef util fill:#ff6b6b,stroke:#000,stroke-width:2px

    %% Legend
    subgraph Legend
        L1[API Component]:::api
        L2[Service Component]:::service
        L3[Data Component]:::data
        L4[External Service]:::external
        L5[Utility Component]:::util
    end
```
