# kofiboadu11/petemotions_team3 architecture

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

- Interactive diagram: https://gitdiagram.com/kofiboadu11/petemotions_team3
- Repository: https://github.com/kofiboadu11/petemotions_team3

## Overview

PetEmotionsApp is an ASP.NET Razor Pages application for uploading pet-related files with emotion labels, viewing upload history, and managing saved uploads. The main workflow accepts an upload, records its content and metadata through the EF Core context, and stores it in SQLite; history and CRUD pages read or modify those records. The tree also contains trained-model assets, but the sampled code does not show inference or model loading, so their runtime role and connections remain unverified.

Main entry points: [`Program.cs`](https://github.com/kofiboadu11/petemotions_team3/blob/main/Program.cs) (App startup), [`Data/PetEmotionsAppContext.cs`](https://github.com/kofiboadu11/petemotions_team3/blob/main/Data/PetEmotionsAppContext.cs) (EF context), [`Pages/FileUpload.cshtml.cs`](https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/FileUpload.cshtml.cs) (File upload), [`Pages/LiveStream.cshtml.cs`](https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/LiveStream.cshtml.cs) (Live upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_startup["App startup<br/>[Program.cs]"]
  node_home["Home page<br/>[Index.cshtml.cs]"]
  node_login["Login page<br/>[Login.cshtml.cs]"]
  node_error["Error page<br/>[Error.cshtml.cs]"]
  node_privacy["Privacy page<br/>[Privacy.cshtml.cs]"]
end

subgraph group_uploads["Uploads and history"]
  node_upload["File upload"]
  node_live["Live upload"]
  node_history["Upload history<br/>[History.cshtml.cs]"]
  node_crud["Upload management"]
  node_uploadview["Upload views<br/>[FileUpload.cshtml]"]
  node_historyview["History view<br/>[History.cshtml]"]
end

subgraph group_data["Persistence"]
  node_entity["Upload record<br/>[FileUpload.cs]"]
  node_users["User model<br/>[Users.cs]"]
  node_context["EF context"]
  node_sqlite[("SQLite database")]
  node_seed["Seed initialization<br/>[SeedData.cs]"]
end

subgraph group_ml["Model assets"]
  node_model["Trained model"]
  node_tfjs["Browser model assets"]
end

node_user(("User"))

node_user -->|"uses"| node_startup
node_startup -->|"configures"| node_context
node_startup -->|"initializes"| node_seed
node_startup -->|"routes pages"| node_home
node_startup -->|"routes pages"| node_login
node_startup -->|"routes pages"| node_upload
node_startup -->|"routes pages"| node_live
node_startup -->|"routes pages"| node_history
node_startup -->|"routes pages"| node_crud
node_upload -->|"writes records"| node_context
node_live -->|"writes records"| node_context
node_history -->|"reads records"| node_context
node_crud -->|"manages records"| node_context
node_context -->|"maps"| node_entity
node_context -->|"uses SQLite"| node_sqlite
node_seed -->|"checks records"| node_context

click node_startup "https://github.com/kofiboadu11/petemotions_team3/blob/main/Program.cs"
click node_home "https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/Index.cshtml.cs"
click node_login "https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/Login.cshtml.cs"
click node_error "https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/Error.cshtml.cs"
click node_privacy "https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/Privacy.cshtml.cs"
click node_upload "https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/FileUpload.cshtml.cs"
click node_live "https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/LiveStream.cshtml.cs"
click node_history "https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/History.cshtml.cs"
click node_crud "https://github.com/kofiboadu11/petemotions_team3/tree/main/Pages/FileUploader"
click node_uploadview "https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/FileUpload.cshtml"
click node_historyview "https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/History.cshtml"
click node_entity "https://github.com/kofiboadu11/petemotions_team3/blob/main/Models/FileUpload.cs"
click node_users "https://github.com/kofiboadu11/petemotions_team3/blob/main/Models/Users.cs"
click node_context "https://github.com/kofiboadu11/petemotions_team3/blob/main/Data/PetEmotionsAppContext.cs"
click node_sqlite "https://github.com/kofiboadu11/petemotions_team3/blob/main/PetEmotionsAppContext-2c0277ec-65c4-424b-8312-114e80e10231.db"
click node_seed "https://github.com/kofiboadu11/petemotions_team3/blob/main/Models/SeedData.cs"
click node_model "https://github.com/kofiboadu11/petemotions_team3/blob/main/Model/petemo_model2.keras"
click node_tfjs "https://github.com/kofiboadu11/petemotions_team3/tree/main/wwwroot/tfjs_petemo"

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_startup,node_home,node_login,node_error,node_privacy,node_user toneBlue
class node_upload,node_live,node_history,node_crud,node_uploadview,node_historyview toneAmber
class node_entity,node_users,node_context,node_sqlite,node_seed toneMint
class node_model,node_tfjs toneRose
```

## Components

### Web application

- [App startup](https://github.com/kofiboadu11/petemotions_team3/blob/main/Program.cs): `Program.cs`
- [Home page](https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/Index.cshtml.cs): `Pages/Index.cshtml.cs`
- [Login page](https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/Login.cshtml.cs): `Pages/Login.cshtml.cs`
- [Error page](https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/Error.cshtml.cs): `Pages/Error.cshtml.cs`
- [Privacy page](https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/Privacy.cshtml.cs): `Pages/Privacy.cshtml.cs`

### Uploads and history

- [File upload](https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/FileUpload.cshtml.cs): `Pages/FileUpload.cshtml.cs`
- [Live upload](https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/LiveStream.cshtml.cs): `Pages/LiveStream.cshtml.cs`
- [Upload history](https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/History.cshtml.cs): `Pages/History.cshtml.cs`
- [Upload management](https://github.com/kofiboadu11/petemotions_team3/tree/main/Pages/FileUploader): `Pages/FileUploader`
- [Upload views](https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/FileUpload.cshtml): `Pages/FileUpload.cshtml`
- [History view](https://github.com/kofiboadu11/petemotions_team3/blob/main/Pages/History.cshtml): `Pages/History.cshtml`

### Persistence

- [Upload record](https://github.com/kofiboadu11/petemotions_team3/blob/main/Models/FileUpload.cs): `Models/FileUpload.cs`
- [User model](https://github.com/kofiboadu11/petemotions_team3/blob/main/Models/Users.cs): `Models/Users.cs`
- [EF context](https://github.com/kofiboadu11/petemotions_team3/blob/main/Data/PetEmotionsAppContext.cs): `Data/PetEmotionsAppContext.cs`
- [SQLite database](https://github.com/kofiboadu11/petemotions_team3/blob/main/PetEmotionsAppContext-2c0277ec-65c4-424b-8312-114e80e10231.db): `PetEmotionsAppContext-2c0277ec-65c4-424b-8312-114e80e10231.db`
- [Seed initialization](https://github.com/kofiboadu11/petemotions_team3/blob/main/Models/SeedData.cs): `Models/SeedData.cs`

### Model assets

- [Trained model](https://github.com/kofiboadu11/petemotions_team3/blob/main/Model/petemo_model2.keras): `Model/petemo_model2.keras`
- [Browser model assets](https://github.com/kofiboadu11/petemotions_team3/tree/main/wwwroot/tfjs_petemo): `wwwroot/tfjs_petemo`

### Other components

- **User**

## Connections

- User → App startup: uses
- App startup → EF context: configures (evidence: `Program.cs`)
- App startup → Seed initialization: initializes (evidence: `Program.cs`)
- App startup → Home page: routes pages (evidence: `Program.cs`)
- App startup → Login page: routes pages (evidence: `Program.cs`)
- App startup → File upload: routes pages (evidence: `Program.cs`)
- App startup → Live upload: routes pages (evidence: `Program.cs`)
- App startup → Upload history: routes pages (evidence: `Program.cs`)
- App startup → Upload management: routes pages (evidence: `Program.cs`)
- File upload → EF context: writes records (evidence: `Pages/FileUpload.cshtml.cs`)
- Live upload → EF context: writes records (evidence: `Pages/LiveStream.cshtml.cs`)
- Upload history → EF context: reads records (evidence: `Pages/History.cshtml.cs`)
- Upload management → EF context: manages records (evidence: `Pages/FileUploader/Create.cshtml.cs`)
- EF context → Upload record: maps (evidence: `Data/PetEmotionsAppContext.cs`)
- EF context → SQLite database: uses SQLite
- Seed initialization → EF context: checks records (evidence: `Models/SeedData.cs`)
