# arslansako1/expense-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/arslansako1/expense-tracker
- Repository: https://github.com/arslansako1/expense-tracker

## Overview

SpendWise is a personal-finance tracker. Users sign up or log in, then manage accounts, transactions and transfers; they can also import bank statements, configure recurring payments and budgets, and view reports and alerts. The React app presents these workflows through an ASP.NET Core API, whose services apply financial rules and persist data through Entity Framework to PostgreSQL. The README documents further capabilities, including audit history and background processing. Some feature services and API calls were not excerpted, so those links are shown only where documented or evidenced by the source index.

Main entry points: [`Backend/Persistence/AppDbContext.cs`](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Persistence/AppDbContext.cs) (EF data context), [`Backend/Program.cs`](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Program.cs) (Web API setup), [`Backend/Services/AuthService.cs`](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/AuthService.cs) (Identity and tokens), [`Fronted/src/App.jsx`](https://github.com/arslansako1/expense-tracker/blob/main/Fronted/src/App.jsx) (Route app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Route app<br/>[App.jsx]"]
  node_dashboard["Dashboard views"]
  node_authui["Login and signup"]
end

subgraph group_api["API and identity"]
  node_backend["Web API setup<br/>[Program.cs]"]
  node_authcontroller["Auth endpoints<br/>[AuthController.cs]"]
  node_authservice["Identity and tokens<br/>[AuthService.cs]"]
  node_token["Token creation<br/>[TokenService.cs]"]
  node_email["Email service<br/>[EmailService.cs]"]
end

subgraph group_finance["Finance features"]
  node_accounts["Account management<br/>[AccountService.cs]"]
  node_transactions["Transaction handling"]
  node_csv["CSV import"]
  node_features["Other finance services"]
  node_background["Recurring and budget jobs"]
end

subgraph group_data["Persistence"]
  node_models["Finance entities"]
  node_context["EF data context<br/>[AppDbContext.cs]"]
  node_postgres[("PostgreSQL")]
end

node_user(("Finance user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_dashboard
node_dashboard -->|"sends API requests"| node_backend
node_backend -->|"connects via EF"| node_postgres
node_backend -->|"configures"| node_context
node_backend -->|"registers"| node_authservice
node_backend -->|"registers"| node_accounts
node_backend -->|"starts jobs"| node_background
node_authcontroller -->|"delegates to"| node_authservice
node_authservice -->|"creates tokens"| node_token
node_authservice -->|"sends email"| node_email
node_authservice -->|"stores refresh tokens"| node_context
node_accounts -->|"reads and writes"| node_context
node_transactions -->|"reads and writes"| node_context
node_csv -->|"imports records"| node_context
node_context -->|"maps entities"| node_models
node_context -->|"persists data"| node_postgres
node_features -.->|"persists feature data"| node_context
node_background -.->|"checks and creates records"| node_context

click node_app "https://github.com/arslansako1/expense-tracker/blob/main/Fronted/src/App.jsx"
click node_dashboard "https://github.com/arslansako1/expense-tracker/tree/main/Fronted/src/Components/Dashboard"
click node_authui "https://github.com/arslansako1/expense-tracker/tree/main/Fronted/src/Components"
click node_backend "https://github.com/arslansako1/expense-tracker/blob/main/Backend/Program.cs"
click node_authcontroller "https://github.com/arslansako1/expense-tracker/blob/main/Backend/Controllers/AuthController.cs"
click node_authservice "https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/AuthService.cs"
click node_token "https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/TokenService.cs"
click node_accounts "https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/AccountService.cs"
click node_transactions "https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/TransactionsService.cs"
click node_csv "https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/CsvFileUploadService.cs"
click node_features "https://github.com/arslansako1/expense-tracker/tree/main/Backend/Services"
click node_background "https://github.com/arslansako1/expense-tracker/tree/main/Backend/Services"
click node_models "https://github.com/arslansako1/expense-tracker/tree/main/Backend/Models"
click node_context "https://github.com/arslansako1/expense-tracker/blob/main/Backend/Persistence/AppDbContext.cs"
click node_email "https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/EmailService.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_app,node_dashboard,node_authui,node_user toneBlue
class node_backend,node_authcontroller,node_authservice,node_token,node_email toneAmber
class node_accounts,node_transactions,node_csv,node_features,node_background toneMint
class node_models,node_context,node_postgres toneRose
```

## Components

### React client

- [Route app](https://github.com/arslansako1/expense-tracker/blob/main/Fronted/src/App.jsx): `Fronted/src/App.jsx`
- [Dashboard views](https://github.com/arslansako1/expense-tracker/tree/main/Fronted/src/Components/Dashboard): `Fronted/src/Components/Dashboard`
- [Login and signup](https://github.com/arslansako1/expense-tracker/tree/main/Fronted/src/Components): `Fronted/src/Components`

### API and identity

- [Web API setup](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Program.cs): `Backend/Program.cs`
- [Auth endpoints](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Controllers/AuthController.cs): `Backend/Controllers/AuthController.cs`
- [Identity and tokens](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/AuthService.cs): `Backend/Services/AuthService.cs`
- [Token creation](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/TokenService.cs): `Backend/Services/TokenService.cs`
- [Email service](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/EmailService.cs): `Backend/Services/EmailService.cs`

### Finance features

- [Account management](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/AccountService.cs): `Backend/Services/AccountService.cs`
- [Transaction handling](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/TransactionsService.cs): `Backend/Services/TransactionsService.cs`
- [CSV import](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Services/CsvFileUploadService.cs): `Backend/Services/CsvFileUploadService.cs`
- [Other finance services](https://github.com/arslansako1/expense-tracker/tree/main/Backend/Services): `Backend/Services`
- [Recurring and budget jobs](https://github.com/arslansako1/expense-tracker/tree/main/Backend/Services): `Backend/Services`

### Persistence

- [Finance entities](https://github.com/arslansako1/expense-tracker/tree/main/Backend/Models): `Backend/Models`
- [EF data context](https://github.com/arslansako1/expense-tracker/blob/main/Backend/Persistence/AppDbContext.cs): `Backend/Persistence/AppDbContext.cs`
- **PostgreSQL**

### Other components

- **Finance user**

## Connections

- Finance user → Route app: uses (evidence: `README.md`)
- Route app → Login and signup: routes to (evidence: `Fronted/src/App.jsx`)
- Route app → Dashboard views: routes to (evidence: `Fronted/src/App.jsx`)
- Dashboard views → Web API setup: sends API requests (evidence: `README.md`)
- Web API setup → PostgreSQL: connects via EF (evidence: `README.md`)
- Web API setup → EF data context: configures (evidence: `Backend/Program.cs`)
- Web API setup → Identity and tokens: registers (evidence: `Backend/Program.cs`)
- Web API setup → Account management: registers (evidence: `Backend/Program.cs`)
- Web API setup → Recurring and budget jobs: starts jobs (evidence: `Backend/Program.cs`)
- Auth endpoints → Identity and tokens: delegates to (evidence: `Backend/Controllers/AuthController.cs`)
- Identity and tokens → Token creation: creates tokens (evidence: `Backend/Services/AuthService.cs`)
- Identity and tokens → Email service: sends email (evidence: `Backend/Services/AuthService.cs`)
- Identity and tokens → EF data context: stores refresh tokens (evidence: `Backend/Services/AuthService.cs`)
- Account management → EF data context: reads and writes (evidence: `Backend/Services/AccountService.cs`)
- Transaction handling → EF data context: reads and writes (evidence: `Backend/Services/TransactionsService.cs`)
- CSV import → EF data context: imports records (evidence: `Backend/Services/CsvFileUploadService.cs`)
- EF data context → Finance entities: maps entities (evidence: `Backend/Persistence/AppDbContext.cs`)
- EF data context → PostgreSQL: persists data (evidence: `README.md`)
- Other finance services → EF data context: persists feature data (evidence: `Backend/Services/AuthService.cs`)
- Recurring and budget jobs → EF data context: checks and creates records (evidence: `Backend/Services/AuthService.cs`)
