# pratyushdev-codes/intelsy architecture

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

- Interactive diagram: https://gitdiagram.com/pratyushdev-codes/intelsy
- Repository: https://github.com/pratyushdev-codes/intelsy

## Overview

##### Project type and purpose
- This is a full-stack, cloud-based IDE (“Intelsy AI IDE”) with a React front end, a Node/Express back end, real-time collaboration via WebSockets, and serverless code execution using AWS Lambda and Docker.
- Key user flows:
- User loads the React app in the browser.
- Real-time code editing and whiteboarding via WebSockets.
- AI-assisted code suggestions and explanations.
- Serverless compilation/execution of code in containers.

##### File structure
- Top-level directories and files:
- src/  → React source.
- public/ & build/ → static assets and production bundle.
- backend/ → AWS Lambda function + dependencies (lambda_function.py, requirements.txt).
- server.js & socket.js (root) → Express WebSocket server for real-time sync.
- Dockerfile in backend/ → builds the remote code execution container.
- Patterns and configs:
- React single-page-application (SPA) structure under src/.
- Express + socket.io (or custom WebSocket) server in server.js/socket.js.
- AWS infra implied: API Gateway, Lambda, ECR.
- Build scripts in package.json.

##### README insights
- React front end → hosted via S3/CDN.
- WebSocket channel for live collaboration.
- API Gateway triggering Lambda for code execution.
- Docker images stored in ECR.
- Technical stack: React, Node/Express, CodeMirror, AWS (ECR, Lambda, API Gateway, WebSockets).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Device and Frontend
    subgraph "Client Device"
        direction TB
        Index["src/index.js"]:::frontend
        App["src/App.js"]:::frontend
        ComponentsDir["src/Components/"]:::frontend
        PagesDir["src/Pages/"]:::frontend
        Editor["Editor.js"]:::frontend
        aiAPI["aiAPI.js"]:::frontend
    end

    %% Static Hosting Layer
    subgraph "Static Hosting"
        direction TB
        PublicHTML["public/index.html"]:::frontend
        PublicImages["public/images/"]:::frontend
        BuildHTML["build/index.html"]:::frontend
        BuildStatic["build/static/"]:::frontend
    end

    %% Real-time Collaboration Layer
    subgraph "Real-Time Collaboration" 
        direction TB
        SocketServer["server.js"]:::realtime
        SocketLogic["socket.js"]:::realtime
    end

    %% AWS Cloud Services
    subgraph "AWS Cloud"
        direction TB
        APIGW["API Gateway"]:::serverless
        Lambda["lambda_function.py"]:::serverless
        Requirements["requirements.txt"]:::serverless
        Dockerfile["Dockerfile"]:::serverless
        ECR["ECR (Docker Images)"]:::serverless
        AIService["AI Assist Service"]:::ai
        DynamoDB["DynamoDB (Session Store)"]:::datastore
    end

    %% Client-Hosting Connections
    Index -->|"HTTPS"| PublicHTML
    App --> PublicHTML
    ComponentsDir --> PublicImages
    PagesDir --> PublicImages

    %% Build Output
    PublicHTML --> BuildHTML
    PublicImages --> BuildStatic

    %% Frontend to WebSocket Server
    Editor <-->|"WS"| SocketServer
    aiAPI -->|"HTTPS"| SocketLogic

    %% Frontend to API Gateway for REST (save/load, AI calls)
    aiAPI -->|"REST"| APIGW

    %% API Gateway triggers Lambda for code exec
    APIGW -->|"invoke compileRequest"| Lambda
    Lambda -->|"pull image"| ECR
    Lambda -->|"store session"| DynamoDB
    Lambda -->|"return result"| APIGW
    APIGW -->|"response"| aiAPI

    %% AI Service integration
    APIGW -->|"AI request"| AIService
    AIService -->|"AI response"| APIGW

    %% Click Events
    click Index "https://github.com/pratyushdev-codes/intelsy/blob/main/src/index.js"
    click App "https://github.com/pratyushdev-codes/intelsy/blob/main/src/App.js"
    click ComponentsDir "https://github.com/pratyushdev-codes/intelsy/tree/main/src/Components/"
    click PagesDir "https://github.com/pratyushdev-codes/intelsy/tree/main/src/Pages/"
    click Editor "https://github.com/pratyushdev-codes/intelsy/blob/main/src/Components/Editor.js"
    click aiAPI "https://github.com/pratyushdev-codes/intelsy/blob/main/src/Components/aiAPI.js"
    click SocketServer "https://github.com/pratyushdev-codes/intelsy/blob/main/server.js"
    click SocketLogic "https://github.com/pratyushdev-codes/intelsy/blob/main/socket.js"
    click PublicHTML "https://github.com/pratyushdev-codes/intelsy/blob/main/public/index.html"
    click PublicImages "https://github.com/pratyushdev-codes/intelsy/tree/main/public/images/"
    click BuildHTML "https://github.com/pratyushdev-codes/intelsy/blob/main/build/index.html"
    click BuildStatic "https://github.com/pratyushdev-codes/intelsy/tree/main/build/static/"
    click Lambda "https://github.com/pratyushdev-codes/intelsy/blob/main/backend/lambda_function.py"
    click Requirements "https://github.com/pratyushdev-codes/intelsy/blob/main/backend/requirements.txt"
    click Dockerfile "https://github.com/pratyushdev-codes/intelsy/tree/main/backend/Dockerfile"

    %% Styles
    classDef frontend fill:#1E90FF,stroke:#FFFFFF,color:#FFFFFF
    classDef realtime fill:#32CD32,stroke:#FFFFFF,color:#000000
    classDef serverless fill:#FFA500,stroke:#FFFFFF,color:#000000
    classDef ai fill:#9370DB,stroke:#FFFFFF,color:#FFFFFF
    classDef datastore fill:#708090,stroke:#FFFFFF,color:#FFFFFF
    classDef background fill:#000000
    class background background
```
