# belal123-hub/moneymateapi architecture

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

- Interactive diagram: https://gitdiagram.com/belal123-hub/moneymateapi
- Repository: https://github.com/belal123-hub/moneymateapi

## Overview

MoneyMate is a personal-finance API for managing accounts, money movement, budgets, goals, and spending insight. Its main workflow accepts authenticated requests, delegates domain operations to business services, updates relational finance records, and returns JSON responses. The sampled code confirms transaction processing, wallet and budget persistence, and API configuration; other controller capabilities are represented from the repository tree, with uncertain internal links omitted. The README is empty, so capability names and boundaries come from the file tree and sampled source.

Main entry points: [`MoneyMateApi/Program.cs`](https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Program.cs) (API host), [`MoneyMateApi/Controllers`](https://github.com/belal123-hub/moneymateapi/tree/main/MoneyMateApi/Controllers) (Finance endpoints), [`BLL/Services/TransactionService.cs`](https://github.com/belal123-hub/moneymateapi/blob/main/BLL/Services/TransactionService.cs) (Transaction service), [`DAL/Data/ApplicationDbContext.cs`](https://github.com/belal123-hub/moneymateapi/blob/main/DAL/Data/ApplicationDbContext.cs) (Finance database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and identity"]
  node_host["API host<br/>[Program.cs]"]
  node_auth["Authentication<br/>[AuthController.cs]"]
  node_transactions_api["Transactions API"]
  node_wallets_api["Wallets API"]
  node_users_api["Users API<br/>[UsersController.cs]"]
  node_categories_api["Categories API"]
  node_finance_routes["Finance endpoints"]
end

subgraph group_domain["Finance operations"]
  node_transaction_service["Transaction service"]
  node_wallet_service["Wallet service<br/>[WalletService.cs]"]
  node_budget_service["Budget service<br/>[BudgetService.cs]"]
  node_other_services["Finance services"]
end

subgraph group_storage["Persistence model"]
  node_database[("Finance database")]
  node_finance_entities["Finance records"]
end

subgraph group_contracts["API contracts"]
  node_transaction_dto["Transaction DTOs"]
  node_wallet_dto["Wallet DTOs"]
  node_user_dto["User DTOs"]
  node_analytics_dto["Analytics DTOs"]
  node_other_dto["Finance DTOs"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_host
node_host -.->|"routes requests"| node_auth
node_host -->|"routes requests"| node_transactions_api
node_host -->|"routes requests"| node_wallets_api
node_host -->|"routes requests"| node_users_api
node_host -->|"routes requests"| node_categories_api
node_host -->|"routes requests"| node_finance_routes
node_transactions_api -->|"invokes"| node_transaction_service
node_wallets_api -->|"invokes"| node_wallet_service
node_users_api -->|"invokes"| node_other_services
node_categories_api -->|"invokes"| node_other_services
node_finance_routes -.->|"invokes"| node_other_services
node_transaction_service -->|"reads and writes"| node_database
node_transaction_service -->|"records expenses"| node_budget_service
node_wallet_service -->|"reads and writes"| node_database
node_budget_service -->|"reads and writes"| node_database
node_database -->|"maps records"| node_finance_entities
node_transaction_service -->|"returns data"| node_transaction_dto
node_wallet_service -->|"returns data"| node_wallet_dto
node_users_api -->|"uses contracts"| node_user_dto
node_finance_routes -.->|"uses contracts"| node_analytics_dto
node_finance_routes -.->|"uses contracts"| node_other_dto

click node_host "https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Program.cs"
click node_auth "https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Controllers/AuthController.cs"
click node_transactions_api "https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Controllers/TransactionsController.cs"
click node_wallets_api "https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Controllers/WalletsController.cs"
click node_users_api "https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Controllers/UsersController.cs"
click node_categories_api "https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Controllers/CategoriesController.cs"
click node_finance_routes "https://github.com/belal123-hub/moneymateapi/tree/main/MoneyMateApi/Controllers"
click node_transaction_service "https://github.com/belal123-hub/moneymateapi/blob/main/BLL/Services/TransactionService.cs"
click node_wallet_service "https://github.com/belal123-hub/moneymateapi/blob/main/BLL/Services/WalletService.cs"
click node_budget_service "https://github.com/belal123-hub/moneymateapi/blob/main/BLL/Services/BudgetService.cs"
click node_other_services "https://github.com/belal123-hub/moneymateapi/tree/main/BLL/Services"
click node_database "https://github.com/belal123-hub/moneymateapi/blob/main/DAL/Data/ApplicationDbContext.cs"
click node_finance_entities "https://github.com/belal123-hub/moneymateapi/tree/main/DAL/Data"
click node_transaction_dto "https://github.com/belal123-hub/moneymateapi/tree/main/DTO/Transaction"
click node_wallet_dto "https://github.com/belal123-hub/moneymateapi/tree/main/DTO/Wallet"
click node_user_dto "https://github.com/belal123-hub/moneymateapi/tree/main/DTO/User"
click node_analytics_dto "https://github.com/belal123-hub/moneymateapi/tree/main/DTO/Analytics"
click node_other_dto "https://github.com/belal123-hub/moneymateapi/tree/main/DTO"

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_host,node_auth,node_transactions_api,node_wallets_api,node_users_api,node_categories_api,node_finance_routes,node_client toneBlue
class node_transaction_service,node_wallet_service,node_budget_service,node_other_services toneAmber
class node_database,node_finance_entities toneMint
class node_transaction_dto,node_wallet_dto,node_user_dto,node_analytics_dto,node_other_dto toneRose
```

## Components

### API and identity

- [API host](https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Program.cs): `MoneyMateApi/Program.cs`
- [Authentication](https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Controllers/AuthController.cs): `MoneyMateApi/Controllers/AuthController.cs`
- [Transactions API](https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Controllers/TransactionsController.cs): `MoneyMateApi/Controllers/TransactionsController.cs`
- [Wallets API](https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Controllers/WalletsController.cs): `MoneyMateApi/Controllers/WalletsController.cs`
- [Users API](https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Controllers/UsersController.cs): `MoneyMateApi/Controllers/UsersController.cs`
- [Categories API](https://github.com/belal123-hub/moneymateapi/blob/main/MoneyMateApi/Controllers/CategoriesController.cs): `MoneyMateApi/Controllers/CategoriesController.cs`
- [Finance endpoints](https://github.com/belal123-hub/moneymateapi/tree/main/MoneyMateApi/Controllers): `MoneyMateApi/Controllers`

### Finance operations

- [Transaction service](https://github.com/belal123-hub/moneymateapi/blob/main/BLL/Services/TransactionService.cs): `BLL/Services/TransactionService.cs`
- [Wallet service](https://github.com/belal123-hub/moneymateapi/blob/main/BLL/Services/WalletService.cs): `BLL/Services/WalletService.cs`
- [Budget service](https://github.com/belal123-hub/moneymateapi/blob/main/BLL/Services/BudgetService.cs): `BLL/Services/BudgetService.cs`
- [Finance services](https://github.com/belal123-hub/moneymateapi/tree/main/BLL/Services): `BLL/Services`

### Persistence model

- [Finance database](https://github.com/belal123-hub/moneymateapi/blob/main/DAL/Data/ApplicationDbContext.cs): `DAL/Data/ApplicationDbContext.cs`
- [Finance records](https://github.com/belal123-hub/moneymateapi/tree/main/DAL/Data): `DAL/Data`

### API contracts

- [Transaction DTOs](https://github.com/belal123-hub/moneymateapi/tree/main/DTO/Transaction): `DTO/Transaction`
- [Wallet DTOs](https://github.com/belal123-hub/moneymateapi/tree/main/DTO/Wallet): `DTO/Wallet`
- [User DTOs](https://github.com/belal123-hub/moneymateapi/tree/main/DTO/User): `DTO/User`
- [Analytics DTOs](https://github.com/belal123-hub/moneymateapi/tree/main/DTO/Analytics): `DTO/Analytics`
- [Finance DTOs](https://github.com/belal123-hub/moneymateapi/tree/main/DTO): `DTO`

### Other components

- **API client**

## Connections

- API client → API host: sends requests (evidence: `MoneyMateApi/Program.cs`)
- API host → Authentication: routes requests
- API host → Transactions API: routes requests (evidence: `MoneyMateApi/Program.cs`)
- API host → Wallets API: routes requests (evidence: `MoneyMateApi/Program.cs`)
- API host → Users API: routes requests (evidence: `MoneyMateApi/Program.cs`)
- API host → Categories API: routes requests (evidence: `MoneyMateApi/Program.cs`)
- API host → Finance endpoints: routes requests (evidence: `MoneyMateApi/Program.cs`)
- Transactions API → Transaction service: invokes (evidence: `MoneyMateApi/Controllers/TransactionsController.cs`)
- Wallets API → Wallet service: invokes (evidence: `MoneyMateApi/Controllers/WalletsController.cs`)
- Users API → Finance services: invokes (evidence: `MoneyMateApi/Controllers/UsersController.cs`)
- Categories API → Finance services: invokes (evidence: `MoneyMateApi/Controllers/CategoriesController.cs`)
- Finance endpoints → Finance services: invokes (evidence: `MoneyMateApi/Controllers/CategoriesController.cs`)
- Transaction service → Finance database: reads and writes (evidence: `BLL/Services/TransactionService.cs`)
- Transaction service → Budget service: records expenses (evidence: `BLL/Services/TransactionService.cs`)
- Wallet service → Finance database: reads and writes (evidence: `BLL/Services/WalletService.cs`)
- Budget service → Finance database: reads and writes (evidence: `BLL/Services/BudgetService.cs`)
- Finance database → Finance records: maps records (evidence: `DAL/Data/ApplicationDbContext.cs`)
- Transaction service → Transaction DTOs: returns data (evidence: `BLL/Services/TransactionService.cs`)
- Wallet service → Wallet DTOs: returns data (evidence: `BLL/Services/WalletService.cs`)
- Users API → User DTOs: uses contracts (evidence: `MoneyMateApi/Controllers/UsersController.cs`)
- Finance endpoints → Analytics DTOs: uses contracts
- Finance endpoints → Finance DTOs: uses contracts (evidence: `MoneyMateApi/Controllers/CategoriesController.cs`)
