# marathe-suraj/expensetracker architecture

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

- Interactive diagram: https://gitdiagram.com/marathe-suraj/expensetracker
- Repository: https://github.com/marathe-suraj/expensetracker

## Overview

ExpenseTracker is an ASP.NET MVC expense-tracking application. A user authenticates, manages categories and expenses, and views dashboard summaries; expense searches can also be exported as PDF or Excel. The sampled controllers and services show the request-to-domain flow, while repositories call SQL stored procedures. The README only names the product, so dashboard and export capabilities are based on sampled source and the tree; unsampled implementation details are not inferred.

Main entry points: [`Services/AuthService.cs`](https://github.com/marathe-suraj/expensetracker/blob/master/Services/AuthService.cs) (Authentication), [`Program.cs`](https://github.com/marathe-suraj/expensetracker/blob/master/Program.cs) (MVC application), [`Controllers/ExpensesController.cs`](https://github.com/marathe-suraj/expensetracker/blob/master/Controllers/ExpensesController.cs) (Expense actions), [`Controllers/DashboardController.cs`](https://github.com/marathe-suraj/expensetracker/blob/master/Controllers/DashboardController.cs) (Dashboard actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_app["MVC application<br/>[Program.cs]"]
  node_dashboard["Dashboard actions"]
  node_expenses["Expense actions"]
  node_categories["Category actions"]
  node_expense_views["Expense views"]
  node_category_views["Category views"]
  node_dashboard_view["Dashboard view<br/>[Index.cshtml]"]
end

subgraph group_domain["Application services"]
  node_dashboard_service["Dashboard summaries"]
  node_expense_service["Expense operations<br/>[ExpenseService.cs]"]
  node_category_service["Category operations<br/>[CategoryService.cs]"]
end

subgraph group_data["Persistence"]
  node_expense_repo["Expense repository"]
  node_category_repo["Category repository"]
  node_user_repo["User repository<br/>[UserRepository.cs]"]
  node_connection["Connection factory"]
  node_sql[("SQL database<br/>[ExpenseTracker.sql]")]
end

subgraph group_identity["Identity"]
  node_account["Account actions"]
  node_auth["Authentication<br/>[AuthService.cs]"]
  node_cookie["Cookie auth<br/>[Program.cs]"]
end

node_user(("User"))

node_user -->|"sends requests"| node_app
node_app -->|"routes requests"| node_account
node_app -->|"routes requests"| node_dashboard
node_app -->|"routes requests"| node_expenses
node_app -->|"routes requests"| node_categories
node_account -->|"invokes"| node_auth
node_auth -->|"looks up or creates"| node_user_repo
node_auth -->|"signs in or out"| node_cookie
node_dashboard -->|"gets user id"| node_auth
node_dashboard -->|"requests summary"| node_dashboard_service
node_dashboard -->|"renders"| node_dashboard_view
node_expenses -->|"gets user id"| node_auth
node_expenses -->|"searches and changes"| node_expense_service
node_expenses -->|"loads categories"| node_category_service
node_expenses -->|"renders"| node_expense_views
node_expense_service -->|"queries and changes"| node_expense_repo
node_expense_service -->|"generates PDF or Excel"| node_expense_service
node_categories -->|"gets user id"| node_auth
node_categories -->|"queries and changes"| node_category_service
node_categories -->|"renders"| node_category_views
node_category_service -->|"queries and changes"| node_category_repo
node_dashboard_service -->|"gets expense totals"| node_expense_repo
node_expense_repo -->|"creates connections"| node_connection
node_category_repo -->|"creates connections"| node_connection
node_user_repo -->|"creates connections"| node_connection
node_connection -->|"connects to"| node_sql
node_expense_repo -->|"executes procedures"| node_sql
node_category_repo -->|"executes procedures"| node_sql
node_user_repo -->|"executes procedures"| node_sql

click node_app "https://github.com/marathe-suraj/expensetracker/blob/master/Program.cs"
click node_account "https://github.com/marathe-suraj/expensetracker/blob/master/Controllers/AccountController.cs"
click node_auth "https://github.com/marathe-suraj/expensetracker/blob/master/Services/AuthService.cs"
click node_cookie "https://github.com/marathe-suraj/expensetracker/blob/master/Program.cs"
click node_dashboard "https://github.com/marathe-suraj/expensetracker/blob/master/Controllers/DashboardController.cs"
click node_dashboard_service "https://github.com/marathe-suraj/expensetracker/blob/master/Services/DashboardService.cs"
click node_expenses "https://github.com/marathe-suraj/expensetracker/blob/master/Controllers/ExpensesController.cs"
click node_expense_service "https://github.com/marathe-suraj/expensetracker/blob/master/Services/ExpenseService.cs"
click node_categories "https://github.com/marathe-suraj/expensetracker/blob/master/Controllers/CategoriesController.cs"
click node_category_service "https://github.com/marathe-suraj/expensetracker/blob/master/Services/CategoryService.cs"
click node_expense_repo "https://github.com/marathe-suraj/expensetracker/blob/master/Data/Repositories/ExpenseRepository.cs"
click node_category_repo "https://github.com/marathe-suraj/expensetracker/blob/master/Data/Repositories/CategoryRepository.cs"
click node_user_repo "https://github.com/marathe-suraj/expensetracker/blob/master/Data/Repositories/UserRepository.cs"
click node_connection "https://github.com/marathe-suraj/expensetracker/blob/master/Data/DbConnectionFactory.cs"
click node_sql "https://github.com/marathe-suraj/expensetracker/blob/master/Database/ExpenseTracker.sql"
click node_expense_views "https://github.com/marathe-suraj/expensetracker/tree/master/Views/Expenses"
click node_category_views "https://github.com/marathe-suraj/expensetracker/tree/master/Views/Categories"
click node_dashboard_view "https://github.com/marathe-suraj/expensetracker/blob/master/Views/Dashboard/Index.cshtml"

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_app,node_dashboard,node_expenses,node_categories,node_expense_views,node_category_views,node_dashboard_view,node_user toneBlue
class node_dashboard_service,node_expense_service,node_category_service toneAmber
class node_expense_repo,node_category_repo,node_user_repo,node_connection,node_sql toneMint
class node_account,node_auth,node_cookie toneRose
```

## Components

### Web interface

- [MVC application](https://github.com/marathe-suraj/expensetracker/blob/master/Program.cs): `Program.cs`
- [Dashboard actions](https://github.com/marathe-suraj/expensetracker/blob/master/Controllers/DashboardController.cs): `Controllers/DashboardController.cs`
- [Expense actions](https://github.com/marathe-suraj/expensetracker/blob/master/Controllers/ExpensesController.cs): `Controllers/ExpensesController.cs`
- [Category actions](https://github.com/marathe-suraj/expensetracker/blob/master/Controllers/CategoriesController.cs): `Controllers/CategoriesController.cs`
- [Expense views](https://github.com/marathe-suraj/expensetracker/tree/master/Views/Expenses): `Views/Expenses`
- [Category views](https://github.com/marathe-suraj/expensetracker/tree/master/Views/Categories): `Views/Categories`
- [Dashboard view](https://github.com/marathe-suraj/expensetracker/blob/master/Views/Dashboard/Index.cshtml): `Views/Dashboard/Index.cshtml`

### Application services

- [Dashboard summaries](https://github.com/marathe-suraj/expensetracker/blob/master/Services/DashboardService.cs): `Services/DashboardService.cs`
- [Expense operations](https://github.com/marathe-suraj/expensetracker/blob/master/Services/ExpenseService.cs): `Services/ExpenseService.cs`
- [Category operations](https://github.com/marathe-suraj/expensetracker/blob/master/Services/CategoryService.cs): `Services/CategoryService.cs`

### Persistence

- [Expense repository](https://github.com/marathe-suraj/expensetracker/blob/master/Data/Repositories/ExpenseRepository.cs): `Data/Repositories/ExpenseRepository.cs`
- [Category repository](https://github.com/marathe-suraj/expensetracker/blob/master/Data/Repositories/CategoryRepository.cs): `Data/Repositories/CategoryRepository.cs`
- [User repository](https://github.com/marathe-suraj/expensetracker/blob/master/Data/Repositories/UserRepository.cs): `Data/Repositories/UserRepository.cs`
- [Connection factory](https://github.com/marathe-suraj/expensetracker/blob/master/Data/DbConnectionFactory.cs): `Data/DbConnectionFactory.cs`
- [SQL database](https://github.com/marathe-suraj/expensetracker/blob/master/Database/ExpenseTracker.sql): `Database/ExpenseTracker.sql`

### Identity

- [Account actions](https://github.com/marathe-suraj/expensetracker/blob/master/Controllers/AccountController.cs): `Controllers/AccountController.cs`
- [Authentication](https://github.com/marathe-suraj/expensetracker/blob/master/Services/AuthService.cs): `Services/AuthService.cs`
- [Cookie auth](https://github.com/marathe-suraj/expensetracker/blob/master/Program.cs): `Program.cs`

### Other components

- **User**

## Connections

- User → MVC application: sends requests
- MVC application → Account actions: routes requests
- MVC application → Dashboard actions: routes requests
- MVC application → Expense actions: routes requests
- MVC application → Category actions: routes requests
- Account actions → Authentication: invokes
- Authentication → User repository: looks up or creates
- Authentication → Cookie auth: signs in or out
- Dashboard actions → Authentication: gets user id
- Dashboard actions → Dashboard summaries: requests summary
- Dashboard actions → Dashboard view: renders
- Expense actions → Authentication: gets user id
- Expense actions → Expense operations: searches and changes
- Expense actions → Category operations: loads categories
- Expense actions → Expense views: renders
- Expense operations → Expense repository: queries and changes
- Expense operations → Expense operations: generates PDF or Excel
- Category actions → Authentication: gets user id
- Category actions → Category operations: queries and changes
- Category actions → Category views: renders
- Category operations → Category repository: queries and changes
- Dashboard summaries → Expense repository: gets expense totals
- Expense repository → Connection factory: creates connections
- Category repository → Connection factory: creates connections
- User repository → Connection factory: creates connections
- Connection factory → SQL database: connects to
- Expense repository → SQL database: executes procedures
- Category repository → SQL database: executes procedures
- User repository → SQL database: executes procedures
