# sarappandersson/labb3-ai-motesassistent architecture

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

- Interactive diagram: https://gitdiagram.com/sarappandersson/labb3-ai-motesassistent
- Repository: https://github.com/sarappandersson/labb3-ai-motesassistent

## Overview

AI Mötesassistent is a React frontend backed by an ASP.NET Core API that uses Gemini to summarize meeting notes, create agendas, and draft invitations. Users select a tool, enter meeting details or notes, and submit them to the matching API endpoint; the backend prepares task-specific instructions, calls Gemini, and returns generated text for display. The invitation flow additionally formats dates and rejects past dates. The frontend-to-backend HTTP mapping is inferred from the configured URL and API routes; source excerpts do not show that wiring in a single file.

Main entry points: [`Frontend/src/components/ToolPicker/ToolPicker.jsx`](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/components/ToolPicker/ToolPicker.jsx) (Tool selector), [`Backend/Controllers/AssistantController.cs`](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Controllers/AssistantController.cs) (AI endpoints), [`Frontend/src/config/api.js`](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/config/api.js) (API client), [`Backend/Program.cs`](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Program.cs) (API host setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React frontend"]
  node_react_entry["React entry<br/>[main.jsx]"]
  node_app["Application shell<br/>[App.jsx]"]
  node_picker["Tool selector<br/>[ToolPicker.jsx]"]
  node_invitation_ui["Invitation form<br/>[Invitation.jsx]"]
  node_agenda_ui["Agenda form<br/>[Agenda.jsx]"]
  node_summary_ui["Summary form<br/>[Summarize.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["ASP.NET API"]
  node_controller["AI endpoints"]
  node_request_dto["Request models<br/>[RequestDTO.cs]"]
  node_server_setup["API host setup<br/>[Program.cs]"]
end

subgraph group_ai["AI generation"]
  node_prompt_rules["Prompt rules<br/>[SystemPrompts.cs]"]
  node_ai_contract["AI service contract<br/>[IAiService.cs]"]
  node_ai_service["Gemini client<br/>[AiService.cs]"]
end

node_user(("User"))
node_gemini["Google Gemini"]

node_user -->|"uses"| node_react_entry
node_react_entry -->|"renders"| node_app
node_app -->|"renders"| node_picker
node_picker -->|"renders"| node_invitation_ui
node_picker -->|"renders"| node_agenda_ui
node_picker -->|"renders"| node_summary_ui
node_invitation_ui -->|"submits form"| node_api_client
node_agenda_ui -->|"submits prompt"| node_api_client
node_summary_ui -->|"submits notes"| node_api_client
node_api_client -.->|"posts requests"| node_controller
node_controller -->|"binds input"| node_request_dto
node_controller -->|"builds prompts"| node_prompt_rules
node_controller -->|"sends prompts"| node_ai_contract
node_server_setup -->|"registers service"| node_ai_contract
node_server_setup -->|"registers implementation"| node_ai_service
node_ai_service -->|"generates content"| node_gemini

click node_react_entry "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/main.jsx"
click node_app "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/App.jsx"
click node_picker "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/components/ToolPicker/ToolPicker.jsx"
click node_invitation_ui "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/components/Invitation/Invitation.jsx"
click node_agenda_ui "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/components/Agenda/Agenda.jsx"
click node_summary_ui "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/components/Summarize/Summarize.jsx"
click node_api_client "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/config/api.js"
click node_controller "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Controllers/AssistantController.cs"
click node_request_dto "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/DTOs/RequestDTO.cs"
click node_prompt_rules "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Prompts/SystemPrompts.cs"
click node_ai_contract "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Services/IAiService.cs"
click node_ai_service "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Services/AiService.cs"
click node_server_setup "https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Program.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_react_entry,node_app,node_picker,node_invitation_ui,node_agenda_ui,node_summary_ui,node_api_client,node_user toneBlue
class node_controller,node_request_dto,node_server_setup toneAmber
class node_prompt_rules,node_ai_contract,node_ai_service toneMint
class node_gemini toneIndigo
```

## Components

### React frontend

- [React entry](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/main.jsx): `Frontend/src/main.jsx`
- [Application shell](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Tool selector](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/components/ToolPicker/ToolPicker.jsx): `Frontend/src/components/ToolPicker/ToolPicker.jsx`
- [Invitation form](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/components/Invitation/Invitation.jsx): `Frontend/src/components/Invitation/Invitation.jsx`
- [Agenda form](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/components/Agenda/Agenda.jsx): `Frontend/src/components/Agenda/Agenda.jsx`
- [Summary form](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/components/Summarize/Summarize.jsx): `Frontend/src/components/Summarize/Summarize.jsx`
- [API client](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Frontend/src/config/api.js): `Frontend/src/config/api.js`

### ASP.NET API

- [AI endpoints](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Controllers/AssistantController.cs): `Backend/Controllers/AssistantController.cs`
- [Request models](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/DTOs/RequestDTO.cs): `Backend/DTOs/RequestDTO.cs`
- [API host setup](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Program.cs): `Backend/Program.cs`

### AI generation

- [Prompt rules](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Prompts/SystemPrompts.cs): `Backend/Prompts/SystemPrompts.cs`
- [AI service contract](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Services/IAiService.cs): `Backend/Services/IAiService.cs`
- [Gemini client](https://github.com/sarappandersson/labb3-ai-motesassistent/blob/main/Backend/Services/AiService.cs): `Backend/Services/AiService.cs`

### Other components

- **User**
- **Google Gemini**

## Connections

- User → React entry: uses
- React entry → Application shell: renders (evidence: `Frontend/src/main.jsx`)
- Application shell → Tool selector: renders (evidence: `Frontend/src/App.jsx`)
- Tool selector → Invitation form: renders (evidence: `Frontend/src/components/ToolPicker/ToolPicker.jsx`)
- Tool selector → Agenda form: renders (evidence: `Frontend/src/components/ToolPicker/ToolPicker.jsx`)
- Tool selector → Summary form: renders (evidence: `Frontend/src/components/ToolPicker/ToolPicker.jsx`)
- Invitation form → API client: submits form (evidence: `Frontend/src/components/Invitation/Invitation.jsx`)
- Agenda form → API client: submits prompt (evidence: `Frontend/src/components/Agenda/Agenda.jsx`)
- Summary form → API client: submits notes (evidence: `Frontend/src/components/Summarize/Summarize.jsx`)
- API client → AI endpoints: posts requests
- AI endpoints → Request models: binds input (evidence: `Backend/Controllers/AssistantController.cs`)
- AI endpoints → Prompt rules: builds prompts (evidence: `Backend/Controllers/AssistantController.cs`)
- AI endpoints → AI service contract: sends prompts (evidence: `Backend/Controllers/AssistantController.cs`)
- API host setup → AI service contract: registers service (evidence: `Backend/Program.cs`)
- API host setup → Gemini client: registers implementation (evidence: `Backend/Program.cs`)
- Gemini client → Google Gemini: generates content (evidence: `Backend/Services/AiService.cs`)
