# robintty/personalfinancedashboard architecture

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

- Interactive diagram: https://gitdiagram.com/robintty/personalfinancedashboard
- Repository: https://github.com/robintty/personalfinancedashboard

## Overview

##### Project type and purpose
- This is a full-stack personal finance dashboard application
- Frontend: React + TypeScript single-page app communicating via GraphQL
- Backend: .NET Core GraphQL API with layered architecture (Core, Infrastructure, DataImport, ThirdPartyDataProviders)
- Database: relational store managed via Entity Framework Core migrations
- External services: banking and payment providers (e.g., GoCardless)

##### File-structure analysis
- Top level
– deployment/docker-compose.yml orchestrates API, database, possibly mock servers
– docs/docusaurus holds documentation site built with Docusaurus
- src/client
– React/TypeScript code, GraphQL code-gen, Storybook config, mockServiceWorker for local testing
– Components, modals, routes, utility functions, theme definitions
- src/server
– RobinTTY.PersonalFinanceDashboard.API: ASP.NET Core GraphQL endpoint with resolvers for queries/mutations
– Core: domain models (Account, Transaction, etc.)
– Infrastructure: ApplicationDbContext, EF Core entities, repositories, migrations
– DataImport: ETL-like modules to import spreadsheets (e.g., Etoro importer)
– ThirdPartyDataProviders: connectors to external APIs (GoCardless, etc.)

##### README insights
- Early-stage proof-of-concept for consolidating bank accounts, credit cards, investments
- UX emphasis, budgeting tools, spending analytics
- Architecture section in docs indicates intent to document layers

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Client["React SPA"]:::frontend
        MSW["Mock Service Worker"]:::frontend
        Storybook["Storybook"]:::frontend
        CodeGen["GraphQL Codegen"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        API["API Server (GraphQL)"]:::api
        subgraph "Resolvers"
            direction TB
            Resolvers["GraphQL Resolvers"]:::api
        end
        Core["Core Domain & Business Logic"]:::core
        subgraph "Infrastructure Layer"
            direction TB
            DbContext["ApplicationDbContext"]:::infra
            Entities["Entities & Type Configurations"]:::infra
            Repositories["Repositories"]:::infra
            Migrations["Migrations"]:::infra
        end
    end

    %% Data Import & Providers
    subgraph "Data Import & External Providers"
        direction TB
        Etoro["Etoro Importer"]:::external
        Extensions["DataImport Extensions"]:::external
        Providers["Third-Party Providers"]:::external
    end

    %% Database
    Database["Relational Database"]:::infra

    %% Documentation
    subgraph "Documentation"
        direction TB
        DocsSite["Docusaurus Site"]:::docs
        ArchDiagrams["Architecture Diagrams"]:::docs
    end

    %% Orchestration
    DockerCompose["Docker Compose"]:::infra

    %% Connections
    Client -->|"GraphQL HTTP"| API
    MSW -->|Mocks GraphQL| Client
    Storybook --- Client
    CodeGen --- Client

    API -->|calls| Resolvers
    Resolvers -->|uses| Core
    Core -->|calls| Repositories
    Repositories -->|uses| DbContext
    DbContext -->|manages| Entities
    Migrations -->|update schema| DbContext
    DbContext -->|reads/writes| Database

    Etoro -->|persist data| Repositories
    Extensions -->|assist| Etoro
    Providers -->|external calls| Etoro
    Providers -->|used by| Resolvers

    DockerCompose ---|orchestrates| API
    DockerCompose ---|orchestrates| Database
    DockerCompose ---|orchestrates| MSW

    DocsSite ---|hosts| ArchDiagrams

    %% Click Events
    click Client "https://github.com/robintty/personalfinancedashboard/tree/master/src/client"
    click MSW "https://github.com/robintty/personalfinancedashboard/blob/master/src/client/src/graphql/mock-data/mockServiceWorker.js"
    click MSW "https://github.com/robintty/personalfinancedashboard/blob/master/src/client/mockServiceWorker.js"
    click Storybook "https://github.com/robintty/personalfinancedashboard/blob/master/src/client/.storybook"
    click CodeGen "https://github.com/robintty/personalfinancedashboard/blob/master/src/client/codegen.ts"
    click API "https://github.com/robintty/personalfinancedashboard/blob/master/src/server/RobinTTY.PersonalFinanceDashboard.API"
    click Resolvers "https://github.com/robintty/personalfinancedashboard/tree/master/src/server/RobinTTY.PersonalFinanceDashboard.API/Resolvers"
    click Core "https://github.com/robintty/personalfinancedashboard/blob/master/src/server/RobinTTY.PersonalFinanceDashboard.Core"
    click DbContext "https://github.com/robintty/personalfinancedashboard/blob/master/src/server/RobinTTY.PersonalFinanceDashboard.Infrastructure/ApplicationDbContext.cs"
    click Entities "https://github.com/robintty/personalfinancedashboard/tree/master/src/server/RobinTTY.PersonalFinanceDashboard.Infrastructure/Entities"
    click Repositories "https://github.com/robintty/personalfinancedashboard/tree/master/src/server/RobinTTY.PersonalFinanceDashboard.Infrastructure/Repositories"
    click Migrations "https://github.com/robintty/personalfinancedashboard/tree/master/src/server/RobinTTY.PersonalFinanceDashboard.Infrastructure/Migrations"
    click Etoro "https://github.com/robintty/personalfinancedashboard/tree/master/src/server/RobinTTY.PersonalFinanceDashboard.DataImport/Etoro"
    click Extensions "https://github.com/robintty/personalfinancedashboard/tree/master/src/server/RobinTTY.PersonalFinanceDashboard.DataImport/Extensions"
    click Providers "https://github.com/robintty/personalfinancedashboard/blob/master/src/server/RobinTTY.PersonalFinanceDashboard.ThirdPartyDataProviders"
    click DockerCompose "https://github.com/robintty/personalfinancedashboard/blob/master/deployment/docker-compose.yml"
    click ArchDiagrams "https://github.com/robintty/personalfinancedashboard/blob/master/docs/architecture-diagrams/application_overview.drawio"
    click DocsSite "https://github.com/robintty/personalfinancedashboard/tree/master/docs/docusaurus"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#017BFE,color:#024B8B
    classDef api fill:#DDEFEF,stroke:#22A39F,color:#095250
    classDef core fill:#E6F4EA,stroke:#34A853,color:#137333
    classDef infra fill:#F0F0F0,stroke:#A0A0A0,color:#505050
    classDef external fill:#FFE5CC,stroke:#FB8C00,color:#A85A00
    classDef docs fill:#FFF5BA,stroke:#FBBC04,color:#805500
```
