# ab0213ab/myfi architecture

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

- Interactive diagram: https://gitdiagram.com/ab0213ab/myfi
- Repository: https://github.com/ab0213ab/myfi

## Overview

MyFi is an in-progress personal-finance web app. Users enter through the root route, reach the landing page or authenticated dashboard, and can work with budgets; the documented domain includes categories and expenses, with reusable budget templates. Identity provides account and role management, while the EF Core context stores finance and identity data. The graph reflects sampled routing, budget listing, and Identity setup; create/template pages and several advertised capabilities are represented only where the tree or README supports them. AI and gamification are planned, not implemented in the sampled runtime.

Main entry points: [`MyFi/Program.cs`](https://github.com/ab0213ab/myfi/blob/master/MyFi/Program.cs) (App routing), [`MyFi/Data/MyFiDbContext.cs`](https://github.com/ab0213ab/myfi/blob/master/MyFi/Data/MyFiDbContext.cs) (EF data context), [`MyFi/Pages/Budgets/CreateFromTemplate.cshtml.cs`](https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/Budgets/CreateFromTemplate.cshtml.cs) (Create from template), [`MyFi/Models/Budget.cs`](https://github.com/ab0213ab/myfi/blob/master/MyFi/Models/Budget.cs) (Budgets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_routing["App routing<br/>[Program.cs]"]
  node_landing["Landing page"]
  node_dashboard["Dashboard"]
  node_admin["Admin page<br/>[Index.cshtml.cs]"]
end

subgraph group_finance["Budgeting domain"]
  node_budget_list["Budget listing<br/>[Index.cshtml.cs]"]
  node_budget_create["Budget creation<br/>[Create.cshtml.cs]"]
  node_template_create["Create from template"]
  node_budget["Budgets<br/>[Budget.cs]"]
  node_expense["Expenses and categories<br/>[Expense.cs]"]
  node_templates["Budget templates<br/>[BudgetTemplate.cs]"]
  node_template_seed["Template seed data"]
  node_gamification["Gamification &#40;planned&#41;"]
end

subgraph group_identity["Identity and access"]
  node_account_pages["Account management<br/>[Login.cshtml.cs]"]
  node_identity_config["Identity and roles<br/>[Program.cs]"]
  node_role_seed["Role seeding<br/>[RoleSeeder.cs]"]
end

subgraph group_persistence["Persistence"]
  node_context["EF data context<br/>[MyFiDbContext.cs]"]
  node_database[("SQL Server")]
end

node_user(("Visitor / user"))
node_openai(("OpenAI insights &#40;planned&#41;"))

node_user -->|"requests"| node_routing
node_routing -->|"redirects guests"| node_landing
node_routing -->|"redirects signed-in"| node_dashboard
node_user -->|"manages account"| node_account_pages
node_routing -->|"maps Razor Pages"| node_account_pages
node_routing -->|"protects Admin"| node_admin
node_identity_config -->|"configures Identity store"| node_context
node_routing -->|"enables authorization"| node_identity_config
node_routing -->|"seeds roles"| node_role_seed
node_user -->|"views budgets"| node_budget_list
node_user -->|"creates budget"| node_budget_create
node_user -->|"starts from template"| node_template_create
node_budget_list -->|"queries budgets and expenses"| node_context
node_context -->|"reads and writes"| node_database
node_context -->|"seeds templates"| node_template_seed
node_template_create -->|"uses template"| node_templates
node_budget_create -->|"creates"| node_budget
node_template_create -->|"creates budget"| node_budget
node_budget -->|"contains expense data"| node_expense
node_openai -.->|"planned insights"| node_user
node_gamification -.->|"planned progress"| node_user

click node_routing "https://github.com/ab0213ab/myfi/blob/master/MyFi/Program.cs"
click node_landing "https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/LandingIndex.cshtml.cs"
click node_dashboard "https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/Dashboard.cshtml.cs"
click node_admin "https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/Admin/Index.cshtml.cs"
click node_budget_list "https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/Budgets/Index.cshtml.cs"
click node_budget_create "https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/Budgets/Create.cshtml.cs"
click node_template_create "https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/Budgets/CreateFromTemplate.cshtml.cs"
click node_budget "https://github.com/ab0213ab/myfi/blob/master/MyFi/Models/Budget.cs"
click node_expense "https://github.com/ab0213ab/myfi/blob/master/MyFi/Models/Expense.cs"
click node_templates "https://github.com/ab0213ab/myfi/blob/master/MyFi/Models/BudgetTemplate.cs"
click node_template_seed "https://github.com/ab0213ab/myfi/blob/master/MyFi/Data/Infrastructure/DataSeeders/BudgetTemplateSeeder.cs"
click node_account_pages "https://github.com/ab0213ab/myfi/blob/master/MyFi/Areas/Identity/Pages/Account/Login.cshtml.cs"
click node_identity_config "https://github.com/ab0213ab/myfi/blob/master/MyFi/Program.cs"
click node_role_seed "https://github.com/ab0213ab/myfi/blob/master/MyFi/Data/Infrastructure/DataSeeders/RoleSeeder.cs"
click node_context "https://github.com/ab0213ab/myfi/blob/master/MyFi/Data/MyFiDbContext.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_routing,node_landing,node_dashboard,node_admin,node_user toneBlue
class node_budget_list,node_budget_create,node_template_create,node_budget,node_expense,node_templates,node_template_seed,node_gamification toneAmber
class node_account_pages,node_identity_config,node_role_seed toneMint
class node_context,node_database toneRose
class node_openai toneIndigo
```

## Components

### Web experience

- [App routing](https://github.com/ab0213ab/myfi/blob/master/MyFi/Program.cs): `MyFi/Program.cs`
- [Landing page](https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/LandingIndex.cshtml.cs): `MyFi/Pages/LandingIndex.cshtml.cs`
- [Dashboard](https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/Dashboard.cshtml.cs): `MyFi/Pages/Dashboard.cshtml.cs`
- [Admin page](https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/Admin/Index.cshtml.cs): `MyFi/Pages/Admin/Index.cshtml.cs`

### Budgeting domain

- [Budget listing](https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/Budgets/Index.cshtml.cs): `MyFi/Pages/Budgets/Index.cshtml.cs`
- [Budget creation](https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/Budgets/Create.cshtml.cs): `MyFi/Pages/Budgets/Create.cshtml.cs`
- [Create from template](https://github.com/ab0213ab/myfi/blob/master/MyFi/Pages/Budgets/CreateFromTemplate.cshtml.cs): `MyFi/Pages/Budgets/CreateFromTemplate.cshtml.cs`
- [Budgets](https://github.com/ab0213ab/myfi/blob/master/MyFi/Models/Budget.cs): `MyFi/Models/Budget.cs`
- [Expenses and categories](https://github.com/ab0213ab/myfi/blob/master/MyFi/Models/Expense.cs): `MyFi/Models/Expense.cs`
- [Budget templates](https://github.com/ab0213ab/myfi/blob/master/MyFi/Models/BudgetTemplate.cs): `MyFi/Models/BudgetTemplate.cs`
- [Template seed data](https://github.com/ab0213ab/myfi/blob/master/MyFi/Data/Infrastructure/DataSeeders/BudgetTemplateSeeder.cs): `MyFi/Data/Infrastructure/DataSeeders/BudgetTemplateSeeder.cs`
- **Gamification (planned)**

### Identity and access

- [Account management](https://github.com/ab0213ab/myfi/blob/master/MyFi/Areas/Identity/Pages/Account/Login.cshtml.cs): `MyFi/Areas/Identity/Pages/Account/Login.cshtml.cs`
- [Identity and roles](https://github.com/ab0213ab/myfi/blob/master/MyFi/Program.cs): `MyFi/Program.cs`
- [Role seeding](https://github.com/ab0213ab/myfi/blob/master/MyFi/Data/Infrastructure/DataSeeders/RoleSeeder.cs): `MyFi/Data/Infrastructure/DataSeeders/RoleSeeder.cs`

### Persistence

- [EF data context](https://github.com/ab0213ab/myfi/blob/master/MyFi/Data/MyFiDbContext.cs): `MyFi/Data/MyFiDbContext.cs`
- **SQL Server**

### Other components

- **Visitor / user**
- **OpenAI insights (planned)**

## Connections

- Visitor / user → App routing: requests
- App routing → Landing page: redirects guests
- App routing → Dashboard: redirects signed-in
- Visitor / user → Account management: manages account
- App routing → Account management: maps Razor Pages
- App routing → Admin page: protects Admin
- Identity and roles → EF data context: configures Identity store
- App routing → Identity and roles: enables authorization
- App routing → Role seeding: seeds roles
- Visitor / user → Budget listing: views budgets
- Visitor / user → Budget creation: creates budget
- Visitor / user → Create from template: starts from template
- Budget listing → EF data context: queries budgets and expenses
- EF data context → SQL Server: reads and writes
- EF data context → Template seed data: seeds templates
- Create from template → Budget templates: uses template
- Budget creation → Budgets: creates
- Create from template → Budgets: creates budget
- Budgets → Expenses and categories: contains expense data
- OpenAI insights (planned) → Visitor / user: planned insights
- Gamification (planned) → Visitor / user: planned progress
