# rafsanoo1/billbuddy architecture

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

- Interactive diagram: https://gitdiagram.com/rafsanoo1/billbuddy
- Repository: https://github.com/rafsanoo1/billbuddy

## Overview

BillBuddy is an ASP.NET MVC bill-tracking application. Users enter through account registration or login, then manage their bills and view dashboard summaries; account features also include password changes and account deletion. Controllers delegate to business services, which use a generic repository over Entity Framework entities and SQL Server. The source index supports the main controller/service and persistence relationships; view rendering links are not directly shown in the excerpts, so they are omitted.

Main entry points: [`BIllBuddy/Program.cs`](https://github.com/rafsanoo1/billbuddy/blob/main/BIllBuddy/Program.cs) (Web startup), [`BillBuddy.BLL/Services/BillService.cs`](https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.BLL/Services/BillService.cs) (Bill service), [`BillBuddy.BLL/Services/AuthService.cs`](https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.BLL/Services/AuthService.cs) (Authentication service), [`BillBuddy.DAL/Repositories/BillBuddyRepo.cs`](https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.DAL/Repositories/BillBuddyRepo.cs) (Generic repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["MVC web"]
  node_startup["Web startup<br/>[Program.cs]"]
  node_account["Account controller"]
  node_billctrl["Bill controller<br/>[BillController.cs]"]
  node_dashboard["Dashboard controller"]
end

subgraph group_business["Business services"]
  node_authsvc["Authentication service<br/>[AuthService.cs]"]
  node_billsvc["Bill service<br/>[BillService.cs]"]
  node_usersvc["User service<br/>[UserService.cs]"]
  node_mapper["DTO mapper<br/>[MapperConfig.cs]"]
end

subgraph group_contracts["Domain contracts"]
  node_interfaces["Service interfaces<br/>[Interfaces]"]
  node_dtos["Request and result DTOs<br/>[DTOs]"]
  node_status["Bill status<br/>[BillStatus.cs]"]
end

subgraph group_persistence["Persistence"]
  node_repo["Generic repository<br/>[BillBuddyRepo.cs]"]
  node_dbcontext["EF database context"]
  node_entities["User and bill entities<br/>[Tables]"]
  node_database[("SQL Server database")]
end

node_user(("BillBuddy user"))

node_user -.->|"opens application"| node_startup
node_startup -->|"routes default"| node_account
node_startup -->|"configures"| node_dbcontext
node_startup -->|"registers"| node_repo
node_startup -->|"registers"| node_authsvc
node_startup -->|"registers"| node_billsvc
node_startup -->|"registers"| node_usersvc
node_account -->|"authenticates"| node_authsvc
node_account -->|"manages account"| node_usersvc
node_billctrl -->|"manages bills"| node_billsvc
node_dashboard -->|"requests summary"| node_billsvc
node_authsvc -->|"reads and writes"| node_repo
node_billsvc -->|"reads and writes"| node_repo
node_usersvc -->|"uses repository"| node_repo
node_billsvc -->|"maps entities"| node_mapper
node_dbcontext -->|"uses SQL Server"| node_database
node_repo -->|"queries context"| node_dbcontext
node_dbcontext -->|"defines sets"| node_entities
node_authsvc -->|"implements contract"| node_interfaces
node_billsvc -->|"implements contract"| node_interfaces
node_authsvc -->|"accepts and returns"| node_dtos
node_billsvc -->|"accepts and returns"| node_dtos
node_mapper -->|"maps DTOs"| node_dtos
node_mapper -->|"maps entities"| node_entities

click node_startup "https://github.com/rafsanoo1/billbuddy/blob/main/BIllBuddy/Program.cs"
click node_account "https://github.com/rafsanoo1/billbuddy/blob/main/BIllBuddy/Controllers/AccountController.cs"
click node_billctrl "https://github.com/rafsanoo1/billbuddy/blob/main/BIllBuddy/Controllers/BillController.cs"
click node_dashboard "https://github.com/rafsanoo1/billbuddy/blob/main/BIllBuddy/Controllers/DashboardController.cs"
click node_authsvc "https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.BLL/Services/AuthService.cs"
click node_billsvc "https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.BLL/Services/BillService.cs"
click node_usersvc "https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.BLL/Services/UserService.cs"
click node_mapper "https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.BLL/Services/MapperConfig.cs"
click node_interfaces "https://github.com/rafsanoo1/billbuddy/tree/main/BillBuddy.BLL/Interfaces"
click node_dtos "https://github.com/rafsanoo1/billbuddy/tree/main/BillBuddy.Common/DTOs"
click node_status "https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.Common/Enums/BillStatus.cs"
click node_repo "https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.DAL/Repositories/BillBuddyRepo.cs"
click node_dbcontext "https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.DAL/EF/BillBuddyDbContext.cs"
click node_entities "https://github.com/rafsanoo1/billbuddy/tree/main/BillBuddy.DAL/EF/Tables"

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_account,node_billctrl,node_dashboard,node_user toneBlue
class node_authsvc,node_billsvc,node_usersvc,node_mapper toneAmber
class node_interfaces,node_dtos,node_status toneMint
class node_repo,node_dbcontext,node_entities,node_database toneRose
```

## Components

### MVC web

- [Web startup](https://github.com/rafsanoo1/billbuddy/blob/main/BIllBuddy/Program.cs): `BIllBuddy/Program.cs`
- [Account controller](https://github.com/rafsanoo1/billbuddy/blob/main/BIllBuddy/Controllers/AccountController.cs): `BIllBuddy/Controllers/AccountController.cs`
- [Bill controller](https://github.com/rafsanoo1/billbuddy/blob/main/BIllBuddy/Controllers/BillController.cs): `BIllBuddy/Controllers/BillController.cs`
- [Dashboard controller](https://github.com/rafsanoo1/billbuddy/blob/main/BIllBuddy/Controllers/DashboardController.cs): `BIllBuddy/Controllers/DashboardController.cs`

### Business services

- [Authentication service](https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.BLL/Services/AuthService.cs): `BillBuddy.BLL/Services/AuthService.cs`
- [Bill service](https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.BLL/Services/BillService.cs): `BillBuddy.BLL/Services/BillService.cs`
- [User service](https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.BLL/Services/UserService.cs): `BillBuddy.BLL/Services/UserService.cs`
- [DTO mapper](https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.BLL/Services/MapperConfig.cs): `BillBuddy.BLL/Services/MapperConfig.cs`

### Domain contracts

- [Service interfaces](https://github.com/rafsanoo1/billbuddy/tree/main/BillBuddy.BLL/Interfaces): `BillBuddy.BLL/Interfaces`
- [Request and result DTOs](https://github.com/rafsanoo1/billbuddy/tree/main/BillBuddy.Common/DTOs): `BillBuddy.Common/DTOs`
- [Bill status](https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.Common/Enums/BillStatus.cs): `BillBuddy.Common/Enums/BillStatus.cs`

### Persistence

- [Generic repository](https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.DAL/Repositories/BillBuddyRepo.cs): `BillBuddy.DAL/Repositories/BillBuddyRepo.cs`
- [EF database context](https://github.com/rafsanoo1/billbuddy/blob/main/BillBuddy.DAL/EF/BillBuddyDbContext.cs): `BillBuddy.DAL/EF/BillBuddyDbContext.cs`
- [User and bill entities](https://github.com/rafsanoo1/billbuddy/tree/main/BillBuddy.DAL/EF/Tables): `BillBuddy.DAL/EF/Tables`
- **SQL Server database**

### Other components

- **BillBuddy user**

## Connections

- BillBuddy user → Web startup: opens application
- Web startup → Account controller: routes default (evidence: `BIllBuddy/Program.cs`)
- Web startup → EF database context: configures (evidence: `BIllBuddy/Program.cs`)
- Web startup → Generic repository: registers (evidence: `BIllBuddy/Program.cs`)
- Web startup → Authentication service: registers (evidence: `BIllBuddy/Program.cs`)
- Web startup → Bill service: registers (evidence: `BIllBuddy/Program.cs`)
- Web startup → User service: registers (evidence: `BIllBuddy/Program.cs`)
- Account controller → Authentication service: authenticates (evidence: `BIllBuddy/Controllers/AccountController.cs`)
- Account controller → User service: manages account (evidence: `BIllBuddy/Controllers/AccountController.cs`)
- Bill controller → Bill service: manages bills (evidence: `BIllBuddy/Controllers/BillController.cs`)
- Dashboard controller → Bill service: requests summary (evidence: `BIllBuddy/Controllers/DashboardController.cs`)
- Authentication service → Generic repository: reads and writes (evidence: `BillBuddy.BLL/Services/AuthService.cs`)
- Bill service → Generic repository: reads and writes (evidence: `BillBuddy.BLL/Services/BillService.cs`)
- User service → Generic repository: uses repository (evidence: `BillBuddy.BLL/Services/UserService.cs`)
- Bill service → DTO mapper: maps entities (evidence: `BillBuddy.BLL/Services/BillService.cs`)
- EF database context → SQL Server database: uses SQL Server (evidence: `BillBuddy.DAL/EF/BillBuddyDbContext.cs`)
- Generic repository → EF database context: queries context (evidence: `BillBuddy.DAL/Repositories/BillBuddyRepo.cs`)
- EF database context → User and bill entities: defines sets (evidence: `BillBuddy.DAL/EF/BillBuddyDbContext.cs`)
- Authentication service → Service interfaces: implements contract (evidence: `BillBuddy.BLL/Services/AuthService.cs`)
- Bill service → Service interfaces: implements contract (evidence: `BillBuddy.BLL/Services/BillService.cs`)
- Authentication service → Request and result DTOs: accepts and returns (evidence: `BillBuddy.BLL/Services/AuthService.cs`)
- Bill service → Request and result DTOs: accepts and returns (evidence: `BillBuddy.BLL/Services/BillService.cs`)
- DTO mapper → Request and result DTOs: maps DTOs (evidence: `BillBuddy.BLL/Services/MapperConfig.cs`)
- DTO mapper → User and bill entities: maps entities (evidence: `BillBuddy.BLL/Services/MapperConfig.cs`)
