Skip to content

About

A browser-based Cloud IDE with real-time collaboration, isolated Kubernetes containers per project, AWS S3 persistence, Monaco editor, integrated terminal, and an AI code assistant — built with React, Node.js, Socket.io, Docker, and Kubernetes.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

NimbusDev Logo

NimbusDev

A production-grade Cloud IDE — code, collaborate, and ship entirely from your browser.

React Node.js MongoDB Socket.io Docker Kubernetes AWS S3 Monaco


Built by Gaurav Singh


What is NimbusDev?

NimbusDev is a full-stack collaborative Cloud IDE — similar to Replit or CodeSandbox — where every user gets a dedicated, isolated container environment running on Kubernetes. You write code in a Monaco-powered editor (the same engine as VS Code), collaborate with teammates in real time, run code directly in the browser, chat with an AI assistant that reads your current file, and never lose your work thanks to automatic AWS S3 persistence.

No local setup. No environment conflicts. Just open a browser and code.


Feature Breakdown

🖥️ Monaco Code Editor

  • Full VS Code editing experience in the browser via @monaco-editor/react
  • Syntax highlighting, IntelliSense, and multi-language support
  • Auto-saves code with a 1-second debounce — no manual save needed
  • Breadcrumb path display showing the active file location

📁 File System Management

  • Visual file tree with collapsible folder navigation (📁 / 📂 icons)
  • Create new files and folders directly from the IDE sidebar
  • Refresh the file tree on demand
  • Files are stored inside the container and synced to S3 on every save

🗂️ Multi-File Tabs

  • Open multiple files simultaneously with a tab bar
  • Click any tab to switch the active file instantly
  • Close individual tabs with the × button
  • Tab state (open files, active file) is synced across all collaborators in real time

👥 Real-Time Collaboration

  • Multiple users can work on the same project simultaneously
  • Powered by Socket.io WebSockets — changes propagate instantly
  • Synced state includes:
    • Code content (keystroke-level sync)
    • Active file selection
    • Open file tabs
    • File paths
  • Each project gets its own Socket.io room scoped by projID and userID

🤖 AI Code Assistant

  • Floating chat widget embedded inside the editor panel
  • Sends your current file's code as context with every message
  • Powered by OpenRouter API (GPT-3.5-turbo)
  • Streaming response rendering — text appears as it's generated
  • Renders code blocks (```) and inline code (`) with proper formatting
  • Conversation history maintained for the session

▶️ Code Runner

  • One-click Run button executes the active file server-side
  • Output (stdout / stderr) displayed in a dedicated panel
  • Runs files using node inside the container — real execution, not simulation
  • Error output is captured and displayed cleanly

🔧 Integrated Terminal

  • Full xterm.js terminal connected to a real bash shell via node-pty
  • Runs inside the container — execute any shell command
  • Supports color output (xterm-color)
  • Sandboxed — cd commands are restricted to the project workspace directory, preventing escape

💾 Persistent Storage (AWS S3)

  • Every file save triggers an S3 upload (code/{userID}/{projID}/path)
  • When a project starts, files are restored from S3 into the container
  • New projects are bootstrapped by copying a base template from S3
  • Storage is scoped per user and per project — complete isolation

☁️ Kubernetes Pod Lifecycle

  • Each project launch creates a Kubernetes Deployment, Service, and Ingress dynamically
  • Pod readiness is polled (up to 30 retries × 3s) before the IDE opens
  • On disconnect / logout, the Deployment, Service, and Ingress are automatically deleted — no resource leaks
  • Each pod runs a Docker container with a full Node.js coding environment

🔐 Authentication & User Management

  • JWT-based auth with 12-hour token expiry
  • Passwords hashed with bcrypt (salt rounds: 10)
  • Input validation via express-validator on all endpoints
  • Protected routes — unauthenticated users are redirected to /login
  • Google OAuth button (UI ready)
  • Auth token stored in localStorage, decoded client-side for user context

📋 Project Dashboard

  • Lists all projects belonging to the logged-in user
  • Create a new project — triggers S3 template copy + MongoDB record creation
  • Delete a project with confirmation
  • Click any project to provision its pod and open the IDE
  • Empty state UI when no projects exist

🔗 Invite & Collaborate

  • Invite modal in the navbar generates a shareable project URL
  • One-click copy to clipboard with confirmation feedback
  • Anyone with the link can join the same live session

System Architecture

┌──────────────────────────────────────────────────────────────────┐
│                          Browser (React)                         │
│   Monaco Editor · xterm.js · Socket.io-client · AI Chat Widget  │
└────────────┬──────────────────┬──────────────────┬──────────────┘
             │ REST             │ REST             │ REST
             ▼                  ▼                  ▼
   ┌──────────────────┐  ┌────────────┐  ┌─────────────────────┐
   │  Authentication  │  │   Server   │  │  Resource Provision │
   │  (Express +      │  │ (Express + │  │  (Express +         │
   │   MongoDB)       │  │  Socket.io │  │   Kubernetes API)   │
   │                  │  │  + node-pty│  │                     │
   │  • /user/login   │  │  + AWS S3) │  │  • POST /start      │
   │  • /user/create  │  │            │  │  • POST /disconnect │
   │  • /project CRUD │  │  • /files  │  │                     │
   └──────────────────┘  │  • /compl. │  └──────────┬──────────┘
             │            └─────┬──────┘             │
             ▼                  │                    ▼
       ┌──────────┐             │           ┌────────────────┐
       │ MongoDB  │             │           │  Kubernetes    │
       │(Users +  │             ▼           │  (1 Pod / proj)│
       │ Projects)│       ┌──────────┐      │  Deployment +  │
       └──────────┘       │  AWS S3  │      │  Service +     │
                          │(Per-user │      │  Ingress       │
                          │ storage) │      └────────────────┘
                          └──────────┘

WebSocket Event Map

Event (Client → Server) Event (Server → Client) Purpose
terminal:write terminal:data Shell I/O
code:write code:data Live code sync
active-file:change active-file:change-received Active file sync
active-path:change active-path:change-received Active path sync
open-files:change open-file:change-recieved Open tabs sync
open-paths:change open-paths:change-received Open paths sync
save:code — Persist to S3 + disk

API Reference

Authentication Service

Method Endpoint Auth Description
POST /user/createuser ✗ Register a new user
POST /user/login ✗ Login, returns JWT
GET /user/getuser ✓ Get current user info
GET /project/fetchallprojects ✓ List user's projects
GET /project/fetchprojectname/:projUrl ✗ Get project title
POST /project/createproject ✓ Create project + copy S3 template
DELETE /project/deleteproject/:id ✓ Delete a project

Server (per-pod)

Method Endpoint Description
GET /files/getallfiles Returns full file tree as JSON
POST /files/getdata Read file contents
POST /files/create-file Create a new file
POST /files/create-folder Create a new folder
POST /files/runcode Execute a file with node, return stdout/stderr
POST /files/fetchfroms3 Pull project files from S3 into container
DELETE /files/deleteallthing Wipe container workspace
POST /completion Stream AI response via OpenRouter

Resource Provisioner

Method Endpoint Description
POST /start Create K8s Deployment + Service + Ingress for a project
POST /disconnect Delete K8s Deployment + Service + Ingress

Tech Stack

Layer Technologies
Frontend React 18, Vite, React Router v6, Monaco Editor, xterm.js, Socket.io-client, Axios
UI / Styling Custom CSS (dark IDE theme), FontAwesome, react-icons
Backend Node.js, Express, Socket.io, node-pty
Auth JWT (jsonwebtoken), bcrypt, express-validator
Database MongoDB, Mongoose
AI OpenRouter API (GPT-3.5-turbo), @assistant-ui/react
Storage AWS S3 (aws-sdk)
Infra Docker, Kubernetes (@kubernetes/client-node), Nginx
Terminal node-pty (pseudo-terminal), xterm.js

Project Structure

nimbusdev/
│
├── Client/                        # React + Vite frontend
│   ├── public/
│   │   └── logo.svg               # NimbusDev logo
│   └── src/
│       ├── components/
│       │   ├── CodeEditor.jsx     # Monaco editor + socket sync
│       │   ├── Terminal.jsx       # xterm.js terminal
│       │   ├── FileTree.jsx       # Recursive file tree
│       │   ├── FileOps.jsx        # Create file/folder, refresh
│       │   ├── FileTabs.jsx       # Multi-file tab bar
│       │   ├── CodeRunner.jsx     # Run button + output panel
│       │   ├── ChatWindow.jsx     # AI assistant chat widget
│       │   ├── Dashboard.jsx      # Project list + create/delete
│       │   ├── NavBar.jsx         # Top nav + invite modal
│       │   ├── LoginPage.jsx      # Auth forms (login + signup)
│       │   └── ProtectedRoute.jsx # Route guard
│       ├── context/
│       │   ├── AuthContext.jsx    # JWT auth state
│       │   └── ProjectContext.jsx # Project list state
│       ├── CloudIDE.jsx           # Main IDE layout + resize logic
│       └── MainApp.jsx            # Router + providers
│
├── Authentication/                # Auth microservice (port 5001)
│   ├── models/
│   │   ├── User.js                # User schema
│   │   └── project.js             # Project schema
│   ├── routes/
│   │   ├── user.js                # Login, register, getuser
│   │   ├── project.js             # Project CRUD + S3 bootstrap
│   │   └── aws.js                 # S3 folder copy utility
│   └── middleware/
│       └── fetchuser.js           # JWT verification middleware
│
├── Server/                        # WebSocket + file ops (port 3000)
│   ├── router/
│   │   ├── files.js               # File CRUD, code runner, S3 sync
│   │   └── completion.js          # AI completion proxy
│   └── AWS/
│       └── aws.js                 # S3 save/fetch helpers
│
├── resource_provision/            # K8s pod manager (port 3002)
│   ├── index.js                   # /start and /disconnect endpoints
│   └── service.yaml               # K8s Deployment + Service + Ingress template
│
└── readme.md

Running Locally

Prerequisites: Node.js 18+, MongoDB, Docker, kubectl configured

1. Clone

git clone https://github.com/your-username/nimbusdev.git
cd nimbusdev

2. Environment variables — create .env in each service:

# Authentication/.env
MONGO_URI=mongodb://localhost:27017/nimbusdev
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
S3_BUCKET=your_bucket
S3_ENDPOINT=https://s3.amazonaws.com

# Server/.env
OPENROUTER_API_KEY=your_openrouter_key
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
S3_BUCKET=your_bucket

# resource_provision/.env
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret

3. Start each service

# Frontend (http://localhost:5173)
cd Client && npm install && npm run dev

# Auth service (http://localhost:5001)
cd Authentication && npm install && node index.js

# Server / WebSocket (http://localhost:3000)
cd Server && npm install && node index.js

# Resource provisioner (http://localhost:3002)
cd resource_provision && npm install && node index.js

How It Works — End to End

1. User signs up / logs in  →  JWT issued, stored in localStorage

2. Dashboard loads  →  fetches all projects from Auth service

3. User clicks a project  →  Resource Provision creates a K8s pod
                           →  Pod pulls files from AWS S3
                           →  IDE opens when pod is Running

4. Inside the IDE:
   ├── File tree fetched from pod via REST
   ├── Socket.io connection established (projID + userID scoped)
   ├── User edits code  →  socket broadcasts to all collaborators
   ├── 1s debounce  →  code saved to S3 + container disk
   ├── Run button  →  node executes file, stdout returned
   ├── Terminal  →  node-pty bash shell, fully interactive
   └── AI chat  →  current file code sent as context to GPT-3.5

5. User leaves  →  K8s Deployment + Service + Ingress deleted
                →  Files already persisted in S3

License

MIT © Gaurav Singh

About

A browser-based Cloud IDE with real-time collaboration, isolated Kubernetes containers per project, AWS S3 persistence, Monaco editor, integrated terminal, and an AI code assistant — built with React, Node.js, Socket.io, Docker, and Kubernetes.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages