# hrishikesh-dalal/flowsyncfinal architecture

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

- Interactive diagram: https://gitdiagram.com/hrishikesh-dalal/flowsyncfinal
- Repository: https://github.com/hrishikesh-dalal/flowsyncfinal

## Overview

##### Project Type & Purpose
- FlowSync is a full-stack no-code automation platform. Its core objective is to let users visually design multi-step workflows (like “email trigger → file upload → notification”) for integrating various applications (Google Suite, Slack, Trello, etc.).
- The README emphasizes a drag-and-drop workflow builder on the frontend, a Node.js/Express-based backend, and a MongoDB database (as noted in the tech stack). There is also a separate “streamlit” directory that might be used for prototype dashboards or additional visualization.

##### Analyzing the File Structure
- The project is clearly divided into at least three main sections:
- A “backend” directory containing server-side code (Node.js scripts, models under the models folder for Email, FUser, Notes, Workflow, PDFs, uploads, etc.). This points to the API layer handling business logic, workflows, file management, and communication with external services.
- A “crce_temp” directory which appears to house the React-based frontend. It includes typical React component structure, pages (like Login, Email, Notes, Workflow Builder, etc.), as well as configuration files (tailwind.config.js, vite.config.js) indicating the usage of React and Tailwind CSS for a modern UI.
- A “streamlit” directory which has an “app.py” – suggesting an additional component, perhaps for data visualization or a prototype dashboard.

##### Key Components
a. Frontend (Client):
- Located in the “crce_temp” folder.
- Built using React with pages like Login, Dashboard (Pages such as Email, Notes, WorkflowBuilder, etc.), and various UI components.
- Responsible for delivering the drag-and-drop workflow builder interface.

b. Backend (Server/API Layer):
- Found under the “backend” directory.
- Uses Node.js/Express (explicit from package.json, index.js, and supporting files).
- Contains models for managing different data types (Email, Users, Notes, Workflow) and handles business logic for automation workflows.
- Manages file uploads, PDFs, and calendar integrations (e.g., calendar.js, poll.js) as part of workflow triggers and actions.

c. Database:
- Although not directly visible within the file tree, the README lists MongoDB as the database.
- The backend would interact with MongoDB to persist user data, workflow configurations, and logs.

d. External Integrations:
- As described in the README, FlowSync integrates with external services (Google Suite, Slack, Trello, etc.), REST APIs, and OAuth providers.
- Services as external systems interfacing via API calls from the backend.

e. Additional Component – Streamlit App:
- “streamlit” component as a standalone visualization or monitoring module.
- It might serve as an additional dashboard or prototype interface to showcase workflow analytics.

##### Relationships & Interactions
- Client-to-Server:
- The React frontend sends API requests to the Node.js backend to create, update, or retrieve automation workflows, manage user sessions (login/signup), and trigger workflow execution.

- Server-to-Database:
- The backend communicates with MongoDB to store and retrieve persistent data (workflow definitions, user data, logs).

- Server-to-External Services:

- Optional: Streamlit Interface:
- Streamlit app (if used for analytics or additional UI) connecting to the backend or directly to the database as needed.

##### Architectural Patterns & Design Principles
- Separation of concerns: the frontend deals with user interactions and the drag-and-drop workflow builder, while the backend handles business logic, data storage, and integrations.
- The MVC-like pattern is evident in the backend's “models” structure.
- Modular design: Separate modules for file management (uploads, PDFs) and scheduling/calendar integrations.
- Scalability: Consider the backend’s capability to extend API integrations and add additional workflow modules.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FE["FlowSync Web Client (React & Tailwind CSS)"]
    end

    %% Backend Layer
    subgraph "Backend Layer"
        BE["FlowSync API Server (Node.js/Express)"]
        subgraph "Data Models"
            DM["Models: Email, FUser, Notes, Workflow"]
        end
        subgraph "File Management"
            FM1["Uploads"]
            FM2["PDFs"]
        end
    end

    %% Database Layer
    subgraph "Database"
        DB[(MongoDB)]
    end

    %% External Integrations
    subgraph "External Integrations"
        EX["External Systems (Google Suite, Slack, Trello)"]
    end

    %% Visualization Layer
    subgraph "Visualization Layer"
        ST["Streamlit App (Visualization Dashboard)"]
    end

    %% Connections
    FE -->|"API"| BE
    BE -->|"CRUD"| DB
    BE -->|"Integrations"| EX
    EX -->|"Triggers"| BE
    BE -->|"FileOps"| FM1
    BE -->|"FileOps"| FM2
    BE -->|"ModelOps"| DM
    ST -->|"DataAccess"| DB
    ST -->|"APICalls"| BE

    %% Click Events
    click FE "https://github.com/hrishikesh-dalal/flowsyncfinal/tree/main/crce_temp/"
    click BE "https://github.com/hrishikesh-dalal/flowsyncfinal/tree/main/backend/"
    click DM "https://github.com/hrishikesh-dalal/flowsyncfinal/tree/main/backend/models/"
    click FM1 "https://github.com/hrishikesh-dalal/flowsyncfinal/tree/main/backend/uploads/"
    click FM2 "https://github.com/hrishikesh-dalal/flowsyncfinal/tree/main/backend/pdfs/"
    click ST "https://github.com/hrishikesh-dalal/flowsyncfinal/blob/main/streamlit/app.py"

    %% Styles
    classDef client fill:#a2d9ff,stroke:#1f618d,stroke-width:2px;
    classDef backend fill:#a9dfbf,stroke:#196f3d,stroke-width:2px;
    classDef database fill:#f9e79f,stroke:#b7950b,stroke-width:2px;
    classDef external fill:#fad7a0,stroke:#d35400,stroke-width:2px;
    classDef streamlit fill:#d7bde2,stroke:#8e44ad,stroke-width:2px;
    classDef model fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef fileman fill:#f5cba7,stroke:#af601a,stroke-width:2px;

    %% Assign Classes
    class FE client;
    class BE backend;
    class DB database;
    class EX external;
    class ST streamlit;
    class DM model;
    class FM1 fileman;
    class FM2 fileman;
```
