# ayush-that/finveda architecture

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

- Interactive diagram: https://gitdiagram.com/ayush-that/finveda
- Repository: https://github.com/ayush-that/finveda

## Overview

##### Main Components
- Frontend:
- Two distinct front-end sections are visible:
- The modern single-page application (SPA) under Finveda/Finveda – which uses Vite, React components (e.g., App.jsx, main.jsx), and a public folder with assets.
- Numerous static HTML pages (index.html, blog.html, about.html, etc.), assets (CSS, fonts, images), and tools that serve as educational content and interactive financial tools.
- Backend:
- Node.js/Express server (located in the server directory) with controllers, models, and routes that handle operations like blog submissions, contact forms, newsletter subscriptions, and feedback.
- Python-powered microservice for the “news” feature (found in news/backend and Finveda/news/backend); this likely serves a separate news API integrated in the overall ecosystem.
- External Services & Integrations:
- AI-powered consultant (as per the README, “Arth Sathi”) which may interact with external APIs or internal logic.
- Email services (see server/utils/sendMail.js and sendNewsletter.js for handling communication).
- GitHub Actions workflows for CI/CD (under .github/workflows) are used to automate testing, pull request management, etc.
- Tools & Utility Modules:
- Several client-side JavaScript tool files (e.g., calculators, financial tools in the tools directory) exist as independent modules but are integrated into the overall user interface.
- Additional pages for games and quizzes.

##### Relationships and Interactions
- The Frontend interacts with:
- The Node.js server (via RESTful API calls) for operations like posting blog entries or sending contact form submissions.
- The Python “news” microservice for fetching the latest market news and trends.
- Integrated calculators and interactive tools that are executed on the client side.
- The Node.js server uses:
- Controllers (addBlogController, contactController, feedbackController, newsletterController) to manage business logic.
- Models (Newsletter, addBlog, etc.) for data representation and persistence.
- Utility modules (db.js, sendMail.js) to connect to databases or external emailing services.
- CI/CD pipelines automate tests and integrations so that frontend and backend deployments remain in sync.

##### Architectural Patterns and Design Principles
- Separation of Concerns: You have clear separation between presentation (frontend) and processing logic (backend controllers, services) which enhances maintainability.
- Modular Design: Distinct modules for controllers, routes, models, and tools ensure that features are loosely coupled.
- Potential Microservices: The news service appears to be a separate “microservice” (implemented in Python) that might scale or be maintained independently.
- Use of Modern Development Tools: Leveraging Vite/React for the SPA and GitHub Actions for CI/CD reinforces modern development practices.

##### Relevant Technologies
- Frontend: HTML5, CSS3 (and preprocessors like SASS), JavaScript (React/Vite).
- Backend: Node.js with Express, Python (for the news backend), and associated dependency management (npm for Node, requirements.txt for Python).
- Build/Deploy: Vite’s configuration file (vite.config.js) indicates bundling practices for the SPA; GitHub Actions workflows manage CI/CD.
- Communication: RESTful API calls between front-end and backend; potentially AJAX calls for interactive tools.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"]:::external

    subgraph "Frontend Layer"
        SPA["Frontend SPA (React/Vite)"]:::frontend
        STATIC["Static HTML Content & Interactive Tools"]:::frontend
        Tools["Financial Tools"]:::frontend
        Assets["Public Assets"]:::frontend
    end

    subgraph "Backend Services"
        NodeJS["Node.js/Express Server"]:::backend
        Python["Python News Microservice"]:::backend
    end

    subgraph "External Integrations"
        Email["Email Services"]:::external
        AI["AI-powered Consultant (Arth Sathi)"]:::external
    end

    subgraph "CI/CD & Developer Workflows"
        CICD["GitHub Actions Workflows"]:::cicd
    end

    User -->|"access"| SPA
    User -->|"access"| STATIC

    STATIC -->|"provides"| Tools
    STATIC -->|"provides"| Assets

    SPA -->|"APIcalls"| NodeJS
    STATIC -->|"formsSubmit"| NodeJS

    SPA -->|"consult"| AI

    NodeJS -->|"sendEmail"| Email
    NodeJS -->|"fetchNews"| Python
    Python -->|"newsData"| STATIC

    CICD -->|"deploys"| SPA
    CICD -->|"deploys"| NodeJS
    CICD -->|"deploys"| Python

    click SPA "https://github.com/ayush-that/finveda/tree/main/FinVeda/Finveda/"
    click STATIC "https://github.com/ayush-that/finveda/tree/main/FinVeda/"
    click Tools "https://github.com/ayush-that/finveda/tree/main/FinVeda/tools"
    click Assets "https://github.com/ayush-that/finveda/tree/main/FinVeda/assets"
    click NodeJS "https://github.com/ayush-that/finveda/tree/main/server/"
    click Python "https://github.com/ayush-that/finveda/tree/main/FinVeda/news/backend"
    click CICD "https://github.com/ayush-that/finveda/tree/main/.github/workflows"

    classDef frontend fill:#e1f5fe,stroke:#0277bd,stroke-width:2px,color:#01579b;
    classDef backend fill:#fff9c4,stroke:#f9a825,stroke-width:2px,color:#bf360c;
    classDef external fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px,color:#1b5e20;
    classDef cicd fill:#d1c4e9,stroke:#512da8,stroke-width:2px,color:#311b92;
    class User external;
```
