# d3rrickla/fortunelink architecture

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

- Interactive diagram: https://gitdiagram.com/d3rrickla/fortunelink
- Repository: https://github.com/d3rrickla/fortunelink

## Overview

##### Project type and purpose
- This is a monolithic backend service (a Java Spring Boot application) that powers FortuneLink—a social and personal-finance platform.
- Its purpose is to expose RESTful APIs for user management, social “community” features, financial “goals” tracking, and “portfolio” management.

##### File structure
- Top-level “backend/fortunelink” directory contains a standard Maven/Spring Boot layout:
- pom.xml – project dependencies & build
- src/main/java/com/laderrco/fortunelink – application code
- src/main/resources/application.properties – configuration
- src/test/java/… – automated tests

##### README
- Very brief: “A social and personal finance platform for people tired of not knowing.”
- Confirms focus on social (community) + personal finance (goals, portfolio).

##### Main components
a. External clients
- Web UI (SPA)
- Mobile App
b. API layer
- Spring Boot RestControllers
- API Gateway or Load Balancer (optional)
c. Service layer
- Business logic components (CommunityService, GoalsService, PortfolioService)
d. Persistence layer
- Repositories (JPA interfaces)
- Relational Database (PostgreSQL/MySQL/H2)
e. External integrations
- Authentication provider (e.g. OAuth2 / Keycloak / Firebase Auth)
- Financial-data aggregator (e.g. Plaid, Yodlee)
- Email/SMS notification service

##### Relationships and interactions
- Clients → (HTTPS) → API Gateway/Load Balancer → Spring Boot Controllers
- Controllers → Service Layer → Repositories → Database
- Services ↔ External APIs (auth, financial data, notifications)

##### Architectural patterns & design principles
- Layered architecture (Controller → Service → Repository)
- Configuration-as-code (application.properties) and test coverage via src/test.

##### Technologies & frameworks
- Java 17+
- Spring Boot starter-web, starter-data-jpa
- Maven build (mvnw wrapper)
- Relational Database (PostgreSQL/MySQL/H2)
- (Optional) OAuth2 / JWT for security
- External SDKs for financial integration

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Clients
    subgraph "Clients"
        direction TB
        WebUI["Web UI (SPA)"]:::frontend
        MobileApp["Mobile App"]:::frontend
    end

    %% API Layer
    subgraph "API Layer"
        direction TB
        APIGateway["API Gateway / Load Balancer"]:::api
        Controllers["Spring Boot RestControllers"]:::api
    end

    %% Backend Service
    subgraph "Backend Service"
        direction TB
        FortunelinkApp["FortunelinkApplication"]:::api
        Pom["pom.xml"]:::api
        Config["application.properties"]:::api
        Tests["FortunelinkApplicationTests"]:::api
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        CommunityService["CommunityService"]:::service
        GoalsService["GoalsService"]:::service
        PortfolioService["PortfolioService"]:::service
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        direction TB
        CommunityRepo["CommunityRepository"]:::persistence
        GoalsRepo["GoalsRepository"]:::persistence
        PortfolioRepo["PortfolioRepository"]:::persistence
        Database["Relational Database"]:::persistence
    end

    %% External Integrations
    subgraph "External Services"
        direction TB
        AuthProvider["Authentication Provider"]:::external
        FinancialAPI["Financial Data Aggregator"]:::external
        Notification["Email/SMS Notification Service"]:::external
    end

    %% Documentation
    subgraph "Documentation"
        direction TB
        CommunityDoc["community_domain_diagram.mermaid"]:::external
        GoalsDoc["goals_domain_diagram.mermaid"]:::external
        PortfolioDoc["portfolio_domain_diagram.mermaid"]:::external
        ProjectDocs["ProjectDocumentation.md"]:::external
    end

    %% Connections
    WebUI -->|HTTPS| APIGateway
    MobileApp -->|HTTPS| APIGateway
    APIGateway -->|routes| Controllers
    Controllers -->|invokes| CommunityService
    Controllers -->|invokes| GoalsService
    Controllers -->|invokes| PortfolioService
    FortunelinkApp --> Controllers
    CommunityService -->|uses| CommunityRepo
    GoalsService -->|uses| GoalsRepo
    PortfolioService -->|uses| PortfolioRepo
    CommunityRepo --> Database
    GoalsRepo --> Database
    PortfolioRepo --> Database
    CommunityService -->|auth| AuthProvider
    GoalsService -->|data| FinancialAPI
    PortfolioService -->|notify| Notification

    %% Documentation links
    CommunityService --> CommunityDoc
    GoalsService --> GoalsDoc
    PortfolioService --> PortfolioDoc
    FortunelinkApp --> ProjectDocs

    %% Click Events
    click FortunelinkApp "https://github.com/d3rrickla/fortunelink/blob/main/backend/fortunelink/src/main/java/com/laderrco/fortunelink/FortunelinkApplication.java"
    click Pom "https://github.com/d3rrickla/fortunelink/blob/main/backend/fortunelink/pom.xml"
    click Config "https://github.com/d3rrickla/fortunelink/blob/main/backend/fortunelink/src/main/resources/application.properties"
    click Tests "https://github.com/d3rrickla/fortunelink/blob/main/backend/fortunelink/src/test/java/com/laderrco/fortunelink/FortunelinkApplicationTests.java"
    click CommunityDoc "https://github.com/d3rrickla/fortunelink/blob/main/documents/community_domain_diagram.mermaid"
    click GoalsDoc "https://github.com/d3rrickla/fortunelink/blob/main/documents/goals_domain_diagram.mermaid"
    click PortfolioDoc "https://github.com/d3rrickla/fortunelink/blob/main/documents/portfolio_domain_diagram.mermaid"
    click ProjectDocs "https://github.com/d3rrickla/fortunelink/blob/main/documents/ProjectDocumentation.md"

    %% Styles
    classDef frontend fill:#b6e3b6,stroke:#333,stroke-width:1px
    classDef api fill:#9ec1cf,stroke:#333,stroke-width:1px
    classDef service fill:#89c2d9,stroke:#333,stroke-width:1px
    classDef persistence fill:#f6bd60,stroke:#333,stroke-width:1px
    classDef external fill:#cbaacb,stroke:#333,stroke-width:1px
```
