# maxv-share/personal_financial_management architecture

> Architecture diagram of the GitHub repository maxv-share/personal_financial_management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maxv-share/personal_financial_management
- Repository: https://github.com/maxv-share/personal_financial_management

## Overview

##### Main Components

A. Frontend Layer (React Application)
- User Interface Components
- State Management (Redux with Sagas)
- Feature Modules
- API Integration Layer

B. Backend Services
- API Layer (ASP.NET Core)
- Application Layer
- Domain Layer
- Infrastructure Layer
- Authentication Server
- Database Layer

##### Detailed Component Breakdown

Frontend Architecture:
**┌─ React Frontend**
- Features
- Authentication
- Currency Management
- Payment Accounts
- Transactions
- Transaction Categories
- Redux Store
- Actions/Reducers
- Sagas
- API Integration Layer

Backend Architecture:
**┌─ API Gateway**

- Application Services
- DTOs
- Application Logic
- Mapping Profiles

- Domain Layer
- Entities
- Interfaces
- Domain Services

- Infrastructure
- Data Access (EF Core)
- Migrations
- Repositories

- Auth Server
- Identity Services

##### Key Relationships to Highlight

- Authentication flow between frontend, API, and Auth Server
- Database relationships between key entities
- Demonstrate the layered architecture pattern in the backend

##### Implementation Details

- Technology Stack Labels:
- Frontend: React, Redux, Redux-Saga
- Backend: ASP.NET Core, Entity Framework Core
- Authentication: OpenIddict
- Database: SQL Server/PostgreSQL

##### Additional Elements

- Security boundaries
- Cross-cutting concerns (logging, monitoring, error handling)
- Scalability points
- Asynchronous communication paths

##### Architectural Patterns to Emphasize

- Clean Architecture in backend
- Feature-based organization in frontend
- Repository pattern for data access
- CQRS pattern (if implemented)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef database fill:#f1c40f,stroke:#f39c12,color:black
    classDef auth fill:#e74c3c,stroke:#c0392b,color:white
    classDef api fill:#9b59b6,stroke:#8e44ad,color:white

    %% Frontend Layer
    subgraph Frontend
        UI["UI Components"]:::frontend
        click UI "https://github.com/MaxV-Share/personal_financial_management/tree/master/admin_react/src/components"
        
        State["State Management\n(Redux + Sagas)"]:::frontend
        click State "https://github.com/MaxV-Share/personal_financial_management/tree/master/admin_react/src/app"
        
        Features["Feature Modules"]:::frontend
        click Features "https://github.com/MaxV-Share/personal_financial_management/tree/master/admin_react/src/features"
        
        APIInt["API Integration Layer"]:::frontend
        click APIInt "https://github.com/MaxV-Share/personal_financial_management/tree/master/admin_react/src/apis"
        
        UI --> State
        State --> Features
        Features --> APIInt
    end

    %% Backend Layer
    subgraph Backend
        API["API Layer\n(ASP.NET Core)"]:::api
        click API "https://github.com/MaxV-Share/personal_financial_management/blob/master/PersonalFinancialManagement.ABP/src/PFM.HttpApi"
        
        AppLayer["Application Layer"]:::backend
        click AppLayer "https://github.com/MaxV-Share/personal_financial_management/blob/master/PersonalFinancialManagement.ABP/src/PFM.Application"
        
        DomainLayer["Domain Layer"]:::backend
        click DomainLayer "https://github.com/MaxV-Share/personal_financial_management/blob/master/PersonalFinancialManagement.ABP/src/PFM.Domain"
        
        InfraLayer["Infrastructure Layer"]:::backend
        click InfraLayer "https://github.com/MaxV-Share/personal_financial_management/blob/master/PersonalFinancialManagement.ABP/src/PFM.EntityFrameworkCore"
        
        AuthServer["Authentication Server"]:::auth
        click AuthServer "https://github.com/MaxV-Share/personal_financial_management/blob/master/PersonalFinancialManagement.ABP/src/PFM.AuthServer"
        
        DTOs["Application DTOs"]:::backend
        click DTOs "https://github.com/MaxV-Share/personal_financial_management/blob/master/PersonalFinancialManagement.ABP/src/PFM.Application.Contracts"
        
        DomainModels["Domain Models"]:::backend
        click DomainModels "https://github.com/MaxV-Share/personal_financial_management/blob/master/PersonalFinancialManagement.ABP/src/PFM.Domain.Shared"
        
        DB["Database Layer"]:::database
        click DB "https://github.com/MaxV-Share/personal_financial_management/tree/master/PersonalFinancialManagement.ABP/src/PFM.EntityFrameworkCore/EntityFrameworkCore"
        
        Migrations["Database Migrations"]:::database
        click Migrations "https://github.com/MaxV-Share/personal_financial_management/tree/master/PersonalFinancialManagement.ABP/src/PFM.EntityFrameworkCore/Migrations"
    end

    %% Connections
    APIInt --> API
    API --> AuthServer
    API --> AppLayer
    AppLayer --> DTOs
    AppLayer --> DomainLayer
    DomainLayer --> DomainModels
    DomainLayer --> InfraLayer
    InfraLayer --> DB
    DB --> Migrations

    %% Legend
    subgraph Legend
        FE["Frontend Component"]:::frontend
        BE["Backend Component"]:::backend
        DBL["Database Component"]:::database
        AL["API Component"]:::api
        AUT["Auth Component"]:::auth
    end
```
