# klebermera/finzen architecture

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

- Interactive diagram: https://gitdiagram.com/klebermera/finzen
- Repository: https://github.com/klebermera/finzen

## Overview

##### Project type and purpose
- FinZen is a single‐page Angular 19 finance management front-end application.
- It provides user authentication (via Firebase), dashboards, category and transaction management, debt/goal planning, chat, reporting, and configuration screens.
- It runs entirely in the browser but consumes external services (REST API calls, Firebase, push notifications, service worker).

##### Top-level file structure and architectural cues
- src/app/ is organized by feature modules under “features” (auth, dashboard, transaction, debt, goals, category, chat, grafic, config, strategy, report, admin).
- A Layout folder contains the app’s shell (navbar, sidebar).
- src/services contains generic singleton services (auth state, breakpoints, storage, push‐notification).
- Environments, Tailwind, Angular CLI config, and service worker (ngsw-config.json) for PWA support.

##### Key insights from README
- Standard Angular CLI workflow (ng serve/build/test).
- No backend code here—assume RESTful finance API + Firebase for identity.

##### Detailed but not over-fragmented
- Domain boundaries (e.g., transactions vs debts vs goals).
- Essential cross-cutting elements: interceptors, PWA, Firebase.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client and Angular App container
    subgraph "Client (Angular SPA)"
        UB["User Browser"]:::external
        subgraph "Angular App"
            Router["Angular Router"]:::core
            AppRoutes["App Routing"]:::core
            Shared["Shared Module"]:::ui
            subgraph "Layout & Shell"
                Navbar["Navbar Component"]:::ui
                Sidebar["Sidebar Component"]:::ui
            end
            subgraph "Core Layer"
                AuthGuard["Auth Guard"]:::core
                RoleGuard["HasRole Guard"]:::core
                AuthInterceptor["Auth Interceptor"]:::core
                ErrInterceptor["Error Interceptor"]:::core
                Models["Core Models"]:::core
                PushNotifService["Push Notification Service"]:::core
            end
            SW["Service Worker"]:::sw
            HttpClient["HttpClient"]:::core
            subgraph "Feature Modules"
                AuthModule["Auth Module"]:::feature
                DashboardModule["Dashboard Module"]:::feature
                TransactionModule["Transaction Module"]:::feature
                DebtModule["Debt Module"]:::feature
                GoalsModule["Goals Module"]:::feature
                CategoryModule["Category Module"]:::feature
                ChatModule["Chat Module"]:::feature
                GraficModule["Grafic Module"]:::feature
                ConfigModule["Config Module"]:::feature
                StrategyModule["Strategy Module"]:::feature
                ReportModule["Report Module"]:::feature
                AdminModule["Admin Module"]:::feature
            end
        end
    end

    %% Routing and flows
    UB -->|"navigates"| Router
    Router -->|lazy loads| AuthModule
    Router --> DashboardModule
    Router --> TransactionModule
    Router --> DebtModule
    Router --> GoalsModule
    Router --> CategoryModule
    Router --> ChatModule
    Router --> GraficModule
    Router --> ConfigModule
    Router --> StrategyModule
    Router --> ReportModule
    Router --> AdminModule

    %% Auth flow
    AuthModule -->|"uses Firebase SDK"| FirebaseAuth

    %% HTTP flow through interceptors
    AuthModule --> HttpClient
    DashboardModule --> HttpClient
    TransactionModule --> HttpClient
    DebtModule --> HttpClient
    GoalsModule --> HttpClient
    CategoryModule --> HttpClient
    ChatModule --> HttpClient
    GraficModule --> HttpClient
    ConfigModule --> HttpClient
    StrategyModule --> HttpClient
    ReportModule --> HttpClient
    AdminModule --> HttpClient

    HttpClient --> AuthInterceptor
    HttpClient --> ErrInterceptor
    HttpClient --> SW
    SW --> RestAPI
    SW --> FirebaseMessaging

    PushNotifService --> SW

    %% External systems
    FirebaseAuth["Firebase Authentication"]:::external
    FirebaseMessaging["Firebase Cloud Messaging"]:::external
    RestAPI["Finance REST API"]:::external

    %% Click Events
    click AuthModule "https://github.com/klebermera/finzen/tree/main/src/app/features/auth"
    click DashboardModule "https://github.com/klebermera/finzen/tree/main/src/app/features/dashboard"
    click TransactionModule "https://github.com/klebermera/finzen/tree/main/src/app/features/transaction"
    click DebtModule "https://github.com/klebermera/finzen/tree/main/src/app/features/debt"
    click GoalsModule "https://github.com/klebermera/finzen/tree/main/src/app/features/goals"
    click CategoryModule "https://github.com/klebermera/finzen/tree/main/src/app/features/category"
    click ChatModule "https://github.com/klebermera/finzen/tree/main/src/app/features/chat"
    click GraficModule "https://github.com/klebermera/finzen/tree/main/src/app/features/grafic"
    click ConfigModule "https://github.com/klebermera/finzen/tree/main/src/app/features/config"
    click StrategyModule "https://github.com/klebermera/finzen/tree/main/src/app/features/strategy"
    click ReportModule "https://github.com/klebermera/finzen/tree/main/src/app/features/report"
    click AdminModule "https://github.com/klebermera/finzen/tree/main/src/app/features/admin"
    click AuthGuard "https://github.com/klebermera/finzen/blob/main/src/app/core/guards/auth.guard.ts"
    click RoleGuard "https://github.com/klebermera/finzen/blob/main/src/app/core/guards/has-role.guard.ts"
    click AuthInterceptor "https://github.com/klebermera/finzen/blob/main/src/app/core/interceptors/auth.interceptor.ts"
    click ErrInterceptor "https://github.com/klebermera/finzen/blob/main/src/app/core/interceptors/handle-error.interceptor.ts"
    click Models "https://github.com/klebermera/finzen/tree/main/src/app/core/models"
    click Shared "https://github.com/klebermera/finzen/tree/main/src/app/shared"
    click Navbar "https://github.com/klebermera/finzen/tree/main/src/app/layout/components/navbar"
    click Sidebar "https://github.com/klebermera/finzen/tree/main/src/app/layout/components/sidebar"
    click AppRoutes "https://github.com/klebermera/finzen/blob/main/src/app/app.routes.ts"
    click PushNotifService "https://github.com/klebermera/finzen/blob/main/src/app/services/push-notification.service.ts"
    click SW "https://github.com/klebermera/finzen/blob/main/ngsw-config.json"

    %% Styles
    classDef ui fill:#D6EFFF,stroke:#333,stroke-width:1px
    classDef core fill:#E5FFD6,stroke:#333,stroke-width:1px
    classDef feature fill:#FFE5D6,stroke:#333,stroke-width:1px
    classDef external fill:#F0F0F0,stroke:#333,stroke-width:1px
    classDef sw fill:#FFF0D6,stroke:#333,stroke-width:1px
```
