# pinkdragon1000/fin architecture

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

- Interactive diagram: https://gitdiagram.com/pinkdragon1000/fin
- Repository: https://github.com/pinkdragon1000/fin

## Overview

- Angular Frontend:
- Represented by the “angularfrontend” folder.
- Contains UI components (small-components, page-content, page-template) and utility functions, as well as routing and service layers (for API calls).
- Deployed via Firebase Hosting.
- Java Spring Boot Backend (API):
- Represented by the “fin” directory.
- Includes controllers (e.g., AccountController, TransactionController, UserController), services (e.g., AccountService, TransactionService, UserService), and models.
- Consumes data from a MySQL database (as specified in the README and configuration files).
- Database:
- MySQL database that stores financial account transactions and user information.
- CI/CD & Deployment Infrastructure:
- GitHub Actions pipelines for Node.js (Angular) and Java (Spring Boot) builds.
- Docker containerization (Dockerfile and docker-compose.yml) to deploy the backend.
- External hosting platforms: Firebase Hosting for the Angular app, and Heroku for the API.
- External Tools and Services:
- Swagger for API documentation.

##### Relationships and Interactions
- Interactions with production systems:
- Angular “ng build” flows to Firebase deployment.
- Spring Boot API is deployed on Heroku and accessible via its designated URLs.

##### Architectural Patterns or Key Principles
- For the Angular side, note the component-based architecture and use of services for API communication, following common best practices in Angular development.
- For the backend, mention that the application follows a layered architecture (Controllers → Services → Repositories/Database operations) typical of Spring Boot projects.
- The separation of concerns is also evident with clear boundaries between the frontend and backend responsibilities.
- CI/CD pipelines and containerization indicate a modern DevOps approach.

##### Additional Details to Consider
- Build and configuration directories as part of your overall system context (e.g., GitHub Actions workflows, Dockerfile, Maven configuration) to emphasize how the project is managed and deployed.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Angular Frontend Subgraph
    subgraph "Angular Frontend"
        AFront["Angular Frontend"]:::frontend
        AUI["Angular UI Components"]:::frontend
        AServ["Angular Services"]:::frontend
        AMod["Angular Models"]:::frontend
        Firebase["Firebase Hosting"]:::frontend
    end

    %% Java Backend Subgraph
    subgraph "Java Backend"
        API["Java API (Spring Boot Backend)"]:::backend
        Controllers["Spring Boot Controllers"]:::backend
        BServ["Spring Boot Services"]:::backend
        BModels["Java Models"]:::backend
        Swagger["Swagger API Documentation"]:::backend
        Heroku["Heroku Deployment"]:::backend
    end

    %% Infrastructure/Deployments Subgraph
    subgraph "Infrastructure/Deployments"
        CICD["CI/CD Pipelines"]:::cicd
        subgraph "Docker Containerization"
            Dockerfile["Dockerfile"]:::container
            DockerCompose["Docker Compose"]:::container
        end
    end

    %% Database Node
    DB["MySQL Database"]:::database

    %% Internal Angular Frontend Connections
    AFront -->|"contains"| AUI
    AFront -->|"contains"| AServ
    AFront -->|"contains"| AMod
    AUI -->|"callsService"| AServ

    %% Internal Java Backend Connections
    API -->|"handles"| Controllers
    Controllers -->|"usesService"| BServ
    BServ -->|"usesModel"| BModels
    BServ -->|"dbOps"| DB
    API -->|"docs"| Swagger

    %% Cross-component Interactions
    CICD -->|"deploys"| AFront
    CICD -->|"deploys"| API
    AFront -->|"HTTPRequest"| API
    AFront -->|"buildDeploy"| Firebase
    API -->|"release"| Heroku

    %% Docker Chain for API Deployment
    CICD -->|"buildDocker"| Dockerfile
    Dockerfile -->|"compose"| DockerCompose
    DockerCompose -->|"containerDeploy"| Heroku

    %% Styles
    classDef frontend fill:#ade1f9,stroke:#084c61,stroke-width:2px;
    classDef backend fill:#f9e1ad,stroke:#d35400,stroke-width:2px;
    classDef cicd fill:#f8c291,stroke:#e67e22,stroke-width:2px;
    classDef container fill:#f6e58d,stroke:#f9ca24,stroke-width:2px;
    classDef database fill:#d1f9c4,stroke:#2ecc71,stroke-width:2px;

    %% Click Events
    click AFront "https://github.com/pinkdragon1000/fin/tree/master/angularfrontend"
    click AUI "https://github.com/pinkdragon1000/fin/tree/master/angularfrontend/src/app/components"
    click AServ "https://github.com/pinkdragon1000/fin/tree/master/angularfrontend/src/app/service"
    click AMod "https://github.com/pinkdragon1000/fin/tree/master/angularfrontend/src/app/models"
    click Firebase "https://github.com/pinkdragon1000/fin/blob/master/angularfrontend/firebase.json"
    click API "https://github.com/pinkdragon1000/fin/tree/master/fin"
    click Controllers "https://github.com/pinkdragon1000/fin/tree/master/fin/src/main/java/com/javabackend/fin/controller"
    click BServ "https://github.com/pinkdragon1000/fin/tree/master/fin/src/main/java/com/javabackend/fin/service"
    click BModels "https://github.com/pinkdragon1000/fin/tree/master/fin/src/main/java/com/javabackend/fin/models"
    click DB "https://github.com/pinkdragon1000/fin/blob/master/fin/src/main/resources/application.properties"
    click CICD "https://github.com/pinkdragon1000/fin/tree/master/.github/workflows"
    click Dockerfile "https://github.com/pinkdragon1000/fin/tree/master/fin/Dockerfile"
    click DockerCompose "https://github.com/pinkdragon1000/fin/blob/master/fin/docker-compose.yml"
    click Swagger "https://github.com/pinkdragon1000/fin/blob/master/fin/swagger.yaml"
    click Heroku "https://github.com/pinkdragon1000/fin/blob/master/fin/system.properties"
```
