# abdallah7afi-dotcom/tadreebi architecture

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

- Interactive diagram: https://gitdiagram.com/abdallah7afi-dotcom/tadreebi
- Repository: https://github.com/abdallah7afi-dotcom/tadreebi

## Overview

Tadreebi is an ASP.NET Core Razor Pages app for cooperative-training students. Students register and maintain a profile, submit weekly evaluations, receive AI task suggestions, complete tasks by uploading work for assessment, and use an AI coach. User data and task progress are stored in JSON; uploaded files are read before task assessment or coach requests. The excerpts show the main page-to-service calls, but not every page implementation; README statements support the broader capability map. The AI backend is configurable to use local or cloud Ollama.

Main entry points: [`Services/UserStore.cs`](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/UserStore.cs) (User store), [`Pages/Tasks/Details.cshtml.cs`](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Tasks/Details.cshtml.cs) (Task submission), [`Pages/Coach.cshtml.cs`](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Coach.cshtml.cs) (AI coach), [`Services/IAiService.cs`](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/IAiService.cs) (AI service contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student["Student workflow"]
  node_welcome["Welcome<br/>[Index.cshtml.cs]"]
  node_home["Dashboard<br/>[Home.cshtml.cs]"]
  node_weekly["Weekly review<br/>[Weekly.cshtml.cs]"]
  node_tasklist["Task suggestions<br/>[Index.cshtml.cs]"]
  node_taskdetails["Task submission<br/>[Details.cshtml.cs]"]
  node_taskresult["Task results<br/>[Result.cshtml.cs]"]
  node_coach["AI coach<br/>[Coach.cshtml.cs]"]
end

subgraph group_accounts["Accounts and profile"]
  node_account["Account pages"]
  node_profile["Profile<br/>[Profile.cshtml.cs]"]
end

subgraph group_services["Application services"]
  node_pagebase["User page context<br/>[AppPageModel.cs]"]
  node_models["User and task models<br/>[Models.cs]"]
  node_store["User store<br/>[UserStore.cs]"]
  node_jsondata[("JSON data file<br/>[UserStore.cs]")]
  node_security["Password and limits<br/>[Security.cs]"]
end

subgraph group_ai["AI and files"]
  node_extractor["File text extractor"]
  node_aicontract["AI service contract<br/>[IAiService.cs]"]
  node_ollama["Ollama adapter<br/>[OllamaAiService.cs]"]
end

node_student(("Student"))
node_ollamaservice{{"Ollama service"}}

node_student -->|"visits"| node_welcome
node_student -->|"registers or signs in"| node_account
node_student -->|"uses"| node_home
node_student -->|"submits review"| node_weekly
node_student -->|"requests tasks"| node_tasklist
node_student -->|"uploads work"| node_taskdetails
node_student -->|"asks for help"| node_coach
node_account -->|"hashes password"| node_security
node_account -->|"creates account"| node_store
node_pagebase -->|"loads user"| node_store
node_home -->|"reads user data"| node_store
node_profile -->|"updates profile"| node_store
node_weekly -->|"saves review"| node_store
node_tasklist -->|"checks request limit"| node_security
node_tasklist -->|"requests suggestions"| node_aicontract
node_tasklist -->|"updates tasks"| node_store
node_taskdetails -->|"reads uploads"| node_extractor
node_taskdetails -->|"checks request limit"| node_security
node_taskdetails -->|"requests assessment"| node_aicontract
node_taskdetails -->|"saves submission"| node_store
node_taskresult -->|"reads task result"| node_store
node_coach -->|"reads attachments"| node_extractor
node_coach -->|"checks request limit"| node_security
node_coach -->|"sends chat"| node_aicontract
node_coach -->|"saves conversation"| node_store
node_store -->|"reads and writes"| node_jsondata
node_store -->|"serializes users"| node_models
node_aicontract -->|"uses domain types"| node_models
node_ollama -->|"implements"| node_aicontract
node_ollama -->|"sends requests"| node_ollamaservice

click node_welcome "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Index.cshtml.cs"
click node_home "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Home.cshtml.cs"
click node_weekly "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Weekly.cshtml.cs"
click node_tasklist "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Tasks/Index.cshtml.cs"
click node_taskdetails "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Tasks/Details.cshtml.cs"
click node_taskresult "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Tasks/Result.cshtml.cs"
click node_coach "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Coach.cshtml.cs"
click node_account "https://github.com/abdallah7afi-dotcom/tadreebi/tree/main/Pages/Account"
click node_profile "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Profile.cshtml.cs"
click node_pagebase "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/AppPageModel.cs"
click node_models "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Models/Models.cs"
click node_store "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/UserStore.cs"
click node_jsondata "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/UserStore.cs"
click node_security "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/Security.cs"
click node_extractor "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/FileTextExtractor.cs"
click node_aicontract "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/IAiService.cs"
click node_ollama "https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/OllamaAiService.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_welcome,node_home,node_weekly,node_tasklist,node_taskdetails,node_taskresult,node_coach toneBlue
class node_account,node_profile toneAmber
class node_pagebase,node_models,node_store,node_jsondata,node_security toneMint
class node_extractor,node_aicontract,node_ollama toneRose
class node_student,node_ollamaservice toneIndigo
```

## Components

### Student workflow

- [Welcome](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Index.cshtml.cs): `Pages/Index.cshtml.cs`
- [Dashboard](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Home.cshtml.cs): `Pages/Home.cshtml.cs`
- [Weekly review](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Weekly.cshtml.cs): `Pages/Weekly.cshtml.cs`
- [Task suggestions](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Tasks/Index.cshtml.cs): `Pages/Tasks/Index.cshtml.cs`
- [Task submission](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Tasks/Details.cshtml.cs): `Pages/Tasks/Details.cshtml.cs`
- [Task results](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Tasks/Result.cshtml.cs): `Pages/Tasks/Result.cshtml.cs`
- [AI coach](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Coach.cshtml.cs): `Pages/Coach.cshtml.cs`

### Accounts and profile

- [Account pages](https://github.com/abdallah7afi-dotcom/tadreebi/tree/main/Pages/Account): `Pages/Account`
- [Profile](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/Profile.cshtml.cs): `Pages/Profile.cshtml.cs`

### Application services

- [User page context](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Pages/AppPageModel.cs): `Pages/AppPageModel.cs`
- [User and task models](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Models/Models.cs): `Models/Models.cs`
- [User store](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/UserStore.cs): `Services/UserStore.cs`
- [JSON data file](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/UserStore.cs): `Services/UserStore.cs`
- [Password and limits](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/Security.cs): `Services/Security.cs`

### AI and files

- [File text extractor](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/FileTextExtractor.cs): `Services/FileTextExtractor.cs`
- [AI service contract](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/IAiService.cs): `Services/IAiService.cs`
- [Ollama adapter](https://github.com/abdallah7afi-dotcom/tadreebi/blob/main/Services/OllamaAiService.cs): `Services/OllamaAiService.cs`

### Other components

- **Student**
- **Ollama service**

## Connections

- Student → Welcome: visits (evidence: `README.md`)
- Student → Account pages: registers or signs in (evidence: `README.md`)
- Student → Dashboard: uses (evidence: `README.md`)
- Student → Weekly review: submits review (evidence: `README.md`)
- Student → Task suggestions: requests tasks (evidence: `README.md`)
- Student → Task submission: uploads work (evidence: `README.md`)
- Student → AI coach: asks for help (evidence: `README.md`)
- Account pages → Password and limits: hashes password (evidence: `Pages/Account/Register.cshtml.cs`)
- Account pages → User store: creates account (evidence: `Pages/Account/Register.cshtml.cs`)
- User page context → User store: loads user (evidence: `Pages/AppPageModel.cs`)
- Dashboard → User store: reads user data (evidence: `Pages/Home.cshtml.cs`)
- Profile → User store: updates profile (evidence: `Pages/Profile.cshtml.cs`)
- Weekly review → User store: saves review (evidence: `Pages/Weekly.cshtml.cs`)
- Task suggestions → Password and limits: checks request limit (evidence: `Pages/Tasks/Index.cshtml.cs`)
- Task suggestions → AI service contract: requests suggestions (evidence: `Pages/Tasks/Index.cshtml.cs`)
- Task suggestions → User store: updates tasks (evidence: `Pages/Tasks/Index.cshtml.cs`)
- Task submission → File text extractor: reads uploads (evidence: `Pages/Tasks/Details.cshtml.cs`)
- Task submission → Password and limits: checks request limit (evidence: `Pages/Tasks/Details.cshtml.cs`)
- Task submission → AI service contract: requests assessment (evidence: `Pages/Tasks/Details.cshtml.cs`)
- Task submission → User store: saves submission (evidence: `Pages/Tasks/Details.cshtml.cs`)
- Task results → User store: reads task result (evidence: `Pages/Tasks/Result.cshtml.cs`)
- AI coach → File text extractor: reads attachments (evidence: `Pages/Coach.cshtml.cs`)
- AI coach → Password and limits: checks request limit (evidence: `Pages/Coach.cshtml.cs`)
- AI coach → AI service contract: sends chat (evidence: `Pages/Coach.cshtml.cs`)
- AI coach → User store: saves conversation (evidence: `Pages/Coach.cshtml.cs`)
- User store → JSON data file: reads and writes (evidence: `Services/UserStore.cs`)
- User store → User and task models: serializes users (evidence: `Services/UserStore.cs`)
- AI service contract → User and task models: uses domain types (evidence: `Services/IAiService.cs`)
- Ollama adapter → AI service contract: implements (evidence: `Services/OllamaAiService.cs`)
- Ollama adapter → Ollama service: sends requests (evidence: `README.md`)
