# brownie1100/finance_dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/brownie1100/finance_dashboard
- Repository: https://github.com/brownie1100/finance_dashboard

## Overview

##### Project type and purpose
- This is a full-stack Finance Dashboard application.
- Frontend: a React/Next.js (TypeScript) UI with Tailwind CSS for building interactive financial views (expenses, income, goals, savings).
- Backend: a Spring Boot (Java) REST API with layered architecture (controllers, services, repositories) persisting to a relational database.
- Database: SQL scripts live in the `Database` folder.

##### File structure
- Top level:
- `Dashboard-backend/financedashboard` – Java/Spring Boot monolith.
- `Dashboard-frontend/financedashboard` – Next.js app directory structure with pages in `app/(dashboard)` and reusable UI components.
- `Database/Scripts.sql` – DDL/DML for schema and sample data.
- Backend layering:
- `controller/` – REST endpoints (ExpenseController, IncomeController, etc.).
- `service/` + `service/impl/` – business logic interfaces and implementations.
- `DBBean/` – Spring Data JPA repositories.
- `entities/` – JPA entity classes (User, Expense, Income, Goal).
- Frontend conventions:
- `app/` – Next.js 13 nested routes for dashboard, expenses, goals, income, savings.
- `components/` – UI primitives and domain components (tables, charts, forms).
- `hooks/` + `lib/` – custom React hooks and utility functions.
- `styles/`, `public/`, `package.json`, `next.config.mjs` – styling, static assets, build config.

##### README for additional insights
- The README is generic CRA boilerplate and doesn’t reflect the actual Next.js setup; ignore or update it.

##### Packing the details
- Frontend’s folder decomposition: App Router (pages), components, hooks, lib.
- Build tools: Maven and NPM/PNPM as side annotations.

## Diagram (Mermaid)

```mermaid
flowchart TD
  classDef frontend fill:#cce5ff,stroke:#004085,color:#004085;
  classDef backend fill:#d4edda,stroke:#155724,color:#155724;
  classDef database fill:#fff3cd,stroke:#856404,color:#856404;

  subgraph "User & Browser"
    subgraph "Frontend UI"
      UIApp["Next.js App Router"]:::frontend
      subgraph "App Router Pages"
        PgDashboard["Dashboard Page"]:::frontend
        PgExpenses["Expenses Page"]:::frontend
        PgIncome["Income Page"]:::frontend
        PgGoals["Goals Page"]:::frontend
        PgSavings["Savings Page"]:::frontend
      end
      subgraph "Components & Hooks"
        Components["UI Components"]:::frontend
        Hooks["Custom Hooks & Lib"]:::frontend
      end
      subgraph "Config & Assets"
        LayoutRoot["Root Layout"]:::frontend
        LayoutDash["Dashboard Layout"]:::frontend
        GlobalCSS["Global CSS"]:::frontend
        TailwindCfg["Tailwind Config"]:::frontend
        NextCfg["Next.js Config"]:::frontend
      end
    end
  end

  subgraph "Server & Infrastructure"
    subgraph "Backend API"
      Controllers["Controllers"]:::backend
      Services["Service Layer"]:::backend
      Repos["Repository Layer"]:::backend
    end
    DB["Relational Database"]:::database
  end

  UIApp -->|HTTP/REST| Controllers
  PgDashboard -->|renders| UIApp
  PgExpenses -->|renders| UIApp
  PgIncome -->|renders| UIApp
  PgGoals -->|renders| UIApp
  PgSavings -->|renders| UIApp
  Controllers -->|invokes| Services
  Services -->|calls| Repos
  Repos -->|JPA/JDBC| DB

  click UIApp "https://github.com/brownie1100/finance_dashboard/tree/main/Dashboard-frontend/financedashboard/app"
  click PgDashboard "https://github.com/brownie1100/finance_dashboard/blob/main/Dashboard-frontend/financedashboard/app/(dashboard)/dashboard/page.tsx"
  click PgExpenses "https://github.com/brownie1100/finance_dashboard/blob/main/Dashboard-frontend/financedashboard/app/(dashboard)/expenses/page.tsx"
  click PgIncome "https://github.com/brownie1100/finance_dashboard/blob/main/Dashboard-frontend/financedashboard/app/(dashboard)/income/page.tsx"
  click PgGoals "https://github.com/brownie1100/finance_dashboard/blob/main/Dashboard-frontend/financedashboard/app/(dashboard)/goals/page.tsx"
  click PgSavings "https://github.com/brownie1100/finance_dashboard/blob/main/Dashboard-frontend/financedashboard/app/(dashboard)/savings/page.tsx"
  click LayoutRoot "https://github.com/brownie1100/finance_dashboard/blob/main/Dashboard-frontend/financedashboard/app/layout.tsx"
  click LayoutDash "https://github.com/brownie1100/finance_dashboard/blob/main/Dashboard-frontend/financedashboard/app/(dashboard)/layout.tsx"
  click GlobalCSS "https://github.com/brownie1100/finance_dashboard/blob/main/Dashboard-frontend/financedashboard/app/globals.css"
  click Components "https://github.com/brownie1100/finance_dashboard/tree/main/Dashboard-frontend/financedashboard/components"
  click Hooks "https://github.com/brownie1100/finance_dashboard/tree/main/Dashboard-frontend/financedashboard/hooks"
  click TailwindCfg "https://github.com/brownie1100/finance_dashboard/blob/main/Dashboard-frontend/financedashboard/tailwind.config.ts"
  click NextCfg "https://github.com/brownie1100/finance_dashboard/blob/main/Dashboard-frontend/financedashboard/next.config.mjs"
  click Services "https://github.com/brownie1100/finance_dashboard/tree/main/Dashboard-backend/financedashboard/src/main/java/com/financedashboard/service"
  click Repos "https://github.com/brownie1100/finance_dashboard/tree/main/Dashboard-backend/financedashboard/src/main/java/com/financedashboard/DBBean"
  click Controllers "https://github.com/brownie1100/finance_dashboard/tree/main/Dashboard-backend/financedashboard/src/main/java/com/financedashboard/controller"
  click DB "https://github.com/brownie1100/finance_dashboard/blob/main/Database/Scripts.sql"
```
