# kmn-orga/walletinsight architecture

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

- Interactive diagram: https://gitdiagram.com/kmn-orga/walletinsight
- Repository: https://github.com/kmn-orga/walletinsight

## Overview

##### Main Components
- Frontend: Developed in Vue.js (as indicated by the presence of a “frontend” directory with Vue files, components, Vite configuration). It handles the dashboard, data visualization, file upload for bank account movements, and general user interactions.
- Backend: Built on Node.js using the NestJS framework (evident from configuration files such as nest-cli.json, the NestJS controller, service, and module files in the “backend/src” directory). It manages business logic, processes requests from the frontend, and handles file uploads.
- Database: PostgreSQL is used for storing transactions and categorization data. Represent it as a distinct data store in the architecture.
- Deployment Infrastructure: Docker Compose is used for deploying the system, which suggests that each service (frontend, backend, microservice, database) might be containerized.

##### Relationships & Interactions
- The Backend processes file uploads (e.g., Excel files) and triggers the logic for inserting transaction data into the database.
- The Backend communicates with PostgreSQL to persist and query transaction data.
- All components are deployed and orchestrated through Docker Compose, so include an overarching deployment container that interacts with all individual containers.

##### Architectural Patterns or Design Principles
- Separation of Concerns: Clearly distinguish between the responsibilities of the frontend (UI and interaction), backend (API and business logic), and microservice (categorization logic).
- Modular Design: The backend is organized into modules (e.g., the “upload” module) following the NestJS structure. Emphasize this modularity.
- Microservices Communication: The integration of a Python-based microservice using gRPC highlights a decoupled approach, favoring scalability and independent deployment.
- Containerization: Detail the use of Docker Compose for deployment, which promotes environment consistency and scalability.

##### Relevant Technologies & Frameworks
- Frontend: Vue.js, Vite, and state management (e.g., Vue stores).
- Backend: Node.js with NestJS (including components like controllers, services, and modules).
- Microservice: Python (with gRPC integration) – note that the microservice is a critical part, even if its file structure isn’t directly shown.
- Database: PostgreSQL along with any plugins or extensions mentioned in the README.
- Deployment: Docker Compose for orchestrating containers during deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    DC["Docker Compose Orchestration"]:::orchestration
    FF["Vue Frontend"]:::frontend

    subgraph "Backend Services"
        NB["NestJS Core API"]:::backend
        UM["Upload Module"]:::backend
    end

    MC["Python Categorization Microservice"]:::microservice
    PG["PostgreSQL Database"]:::database

    DC --> FF
    DC --> NB
    DC --> MC
    DC --> PG

    FF -->|"REST_API"| NB
    FF -->|"File_Upload"| UM
    NB -->|"Delegates_Upload"| UM

    NB -->|"gRPC_call"| MC
    MC -->|"gRPC_response"| NB

    NB -->|"Data_Persistence"| PG

    click FF "https://github.com/kmn-orga/walletinsight/tree/main/frontend/"
    click NB "https://github.com/kmn-orga/walletinsight/tree/main/backend/"
    click UM "https://github.com/kmn-orga/walletinsight/tree/main/backend/src/upload/"

    classDef frontend fill:#a2d5f2,stroke:#333,stroke-width:2px
    classDef backend fill:#a2f2a2,stroke:#333,stroke-width:2px
    classDef microservice fill:#f2d2a2,stroke:#333,stroke-width:2px
    classDef database fill:#f2a2a2,stroke:#333,stroke-width:2px
    classDef orchestration fill:#d3a2f2,stroke:#333,stroke-width:2px
```
