# andrew-paes/money-maker architecture

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

- Interactive diagram: https://gitdiagram.com/andrew-paes/money-maker
- Repository: https://github.com/andrew-paes/money-maker

## Overview

##### Project type and purpose
- This is a backend‐focused, layered, C#/.NET Web API (“Money Maker”) used to offer investment products, let users register, purchase, contribute to products and view transactions & returns. There is no SPA or server‐rendered UI in this repo—this lives purely as a RESTful service with a SQL database.

##### File structure
- Top‐level “src/Money.Maker” solution with four projects:
a. Money.Maker.Api – the Web API hosts controllers and middleware (Startup.cs/Program.cs).
b. Money.Maker.Domain – domain/data models and response models.
c. Money.Maker.Repository – EF Core DbContext, migrations, repository interfaces & implementations.
d. Money.Maker.Service – business logic through service interfaces & implementations.
- A Test project (Money.Maker.Test) holds basic unit tests.
- SQL folder with seed script; Postman collection for API testing.
- Configuration files (appsettings.json + Development override) and EF Core Migrations in the Repository project.

##### Key README insights
- Confirms purpose: display investment products, user registration, acquisitions, contributions, and viewing transactions.
- Uses a SQL database (seed.sql) and provides a Postman collection for manual API verification.

##### Essential details to capture
- Startup.cs DI configuration linking interfaces to implementations.
- EF Core migrations generating schema.
- DataModels in Domain project (Address, City, Customer, etc.).
- ResponseModels for shaping API output.
- Utility classes (e.g., ServiceExtensions, DataSettings).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client
    Client["Client (Postman / Future UI)"]:::client
    click Client "https://github.com/andrew-paes/money-maker/blob/master/postman/Money Maker.postman_collection.json"

    %% API Layer
    subgraph "API Layer"
        Controllers["Controllers"]:::api
        click Controllers "https://github.com/andrew-paes/money-maker/tree/master/src/Money.Maker/Money.Maker.Api/Controllers/"
        StartupCS["Startup.cs"]:::api
        click StartupCS "https://github.com/andrew-paes/money-maker/blob/master/src/Money.Maker/Money.Maker.Api/Startup.cs"
        ProgramCS["Program.cs"]:::api
        click ProgramCS "https://github.com/andrew-paes/money-maker/blob/master/src/Money.Maker/Money.Maker.Api/Program.cs"
        ConfigFiles["appsettings.json / appsettings.Development.json"]:::api
        click ConfigFiles "https://github.com/andrew-paes/money-maker/blob/master/src/Money.Maker/Money.Maker.Api/appsettings.json"
    end

    %% Service Layer
    subgraph "Service Layer"
        ServiceIf["Service Interfaces"]:::service
        click ServiceIf "https://github.com/andrew-paes/money-maker/tree/master/src/Money.Maker/Money.Maker.Service/Interfaces/"
        ServiceImpl["Service Implementations"]:::service
        click ServiceImpl "https://github.com/andrew-paes/money-maker/tree/master/src/Money.Maker/Money.Maker.Service/Services/"
        ServiceExt["ServiceExtensions (Util)"]:::service
        click ServiceExt "https://github.com/andrew-paes/money-maker/blob/master/src/Money.Maker/Money.Maker.Service/Util/ServiceExtensions.cs"
    end

    %% Repository Layer
    subgraph "Repository Layer"
        RepoIf["Repository Interfaces"]:::repo
        click RepoIf "https://github.com/andrew-paes/money-maker/tree/master/src/Money.Maker/Money.Maker.Repository/Interfaces/"
        RepoImpl["Repository Implementations"]:::repo
        click RepoImpl "https://github.com/andrew-paes/money-maker/tree/master/src/Money.Maker/Money.Maker.Repository/Repositories/"
        DbContext["DataContext (EF Core DbContext)"]:::repo
        click DbContext "https://github.com/andrew-paes/money-maker/blob/master/src/Money.Maker/Money.Maker.Repository/DataContext.cs"
        Migrations["EF Core Migrations"]:::repo
        click Migrations "https://github.com/andrew-paes/money-maker/tree/master/src/Money.Maker/Money.Maker.Repository/Migrations/"
        RepoUtil["Repository Util"]:::repo
        click RepoUtil "https://github.com/andrew-paes/money-maker/tree/master/src/Money.Maker/Money.Maker.Repository/Util/"
    end

    %% Domain Layer
    subgraph "Domain Layer"
        DataModels["Data Models"]:::domain
        click DataModels "https://github.com/andrew-paes/money-maker/tree/master/src/Money.Maker/Money.Maker.Domain/DataModels/"
        ResponseModels["Response Models"]:::domain
        click ResponseModels "https://github.com/andrew-paes/money-maker/tree/master/src/Money.Maker/Money.Maker.Domain/ResponseModel/"
    end

    %% Database
    Database["SQL Database"]:::db
    click Database "https://github.com/andrew-paes/money-maker/blob/master/sql/seed.sql"

    %% Test Harness
    subgraph "Test Harness" style testStroke: stroke-dasharray: 5 5
        Test["Unit Tests"]:::test
        click Test "https://github.com/andrew-paes/money-maker/blob/master/src/Money.Maker/Money.Maker.Test/UnitTest1.cs"
    end

    %% Solution & Config
    Solution["Solution & Global Config"]:::external
    click Solution "https://github.com/andrew-paes/money-maker/blob/master/src/Money.Maker/Money.Maker.sln"

    %% Connections
    Client -->|"HTTP/JSON"| Controllers
    Controllers -->|"invoke"| ServiceIf
    ServiceIf -->|"implemented by"| ServiceImpl
    ServiceImpl -->|"uses"| RepoIf
    RepoIf -->|"implemented by"| RepoImpl
    RepoImpl -->|"operates via"| DbContext
    DbContext -->|"reads/writes"| Database
    Database -->|"returns data"| DbContext
    DbContext -->|"entities to"| RepoImpl
    RepoImpl -->|"returns entities"| ServiceImpl
    ServiceImpl -->|"business result"| Controllers
    Controllers -->|"HTTP Response"| Client

    %% Peripheral
    ServiceImpl --- DataModels
    RepoImpl --- DataModels
    Controllers --- ResponseModels

    Solution --- Controllers
    Solution --- ServiceImpl
    Solution --- RepoImpl
    Solution --- DataModels

    %% Styles
    classDef api fill:#D0E6FF,stroke:#0366D6,stroke-width:1px
    classDef service fill:#D0E6FF,stroke:#0366D6,stroke-width:1px
    classDef repo fill:#D0E6FF,stroke:#0366D6,stroke-width:1px
    classDef domain fill:#D0E6FF,stroke:#0366D6,stroke-width:1px
    classDef db fill:#DFFFE0,stroke:#228B22,stroke-width:1px
    classDef client fill:#FFE5B4,stroke:#FF8C00,stroke-width:1px
    classDef test fill:#FFFFFF,stroke:#FF6347,stroke-width:1px
    classDef external fill:#F0F0F0,stroke:#A9A9A9,stroke-width:1px
    class TestHarness test
    style TestHarness stroke-dasharray: 5 5,stroke:#FF6347,fill:none,id:TestHarness
```
