Cloud IDE with GitHub-backed workspaces, Docker-based language runtimes, real-time collaboration, and an OpenRouter-powered assistant.
- Collaborator file access now resolves to the project owner's workspace path.
- Terminal sessions for collaborators now reuse/spawn container context using owner-mounted workspace.
- Added
POST /api/projects/:id/closeso owner can close a project and stop language container. - Save and exit flow now triggers backend close call from IDE.
- AI error handling now returns upstream status/details (including 429) instead of a generic env-key message.
- Backend startup reconnects existing managed containers to reduce container churn.
graph LR
Browser[Browser IDE UI]
subgraph Frontend
FE[Next.js 16 app :4000]
Monaco[Monaco Editor]
Xterm[XTerm Terminal Panel]
YMonaco[y-monaco client]
end
subgraph Backend
API[Express API :4001]
Auth[Supabase JWT auth middleware]
Term[Socket.IO terminal service]
CollabWS[y-websocket upgrade path]
Files[File service]
Git[Git service]
Cntr[Container service]
AI[AI service]
end
subgraph DataRuntime
DB[(Supabase Postgres)]
WS[(Workspace files on disk)]
Dk[(Docker containers)]
end
subgraph External
GH[(GitHub API)]
OR[(OpenRouter API)]
SMTP[(SMTP)]
end
Browser --> FE
FE --> Monaco
FE --> Xterm
FE --> YMonaco
FE -->|REST /api/*| API
FE -->|Socket.IO| Term
FE -->|WS /socket/collaboration| CollabWS
API --> Auth
Auth --> DB
API --> Files
API --> Git
API --> AI
API --> DB
Files --> WS
Git --> WS
Term --> Cntr
Cntr --> Dk
Cntr --> WS
Git --> GH
AI --> OR
API --> SMTP
sequenceDiagram
participant A as Owner
participant B as Collaborator
participant FE as Frontend
participant API as Backend API
participant TS as Terminal Service
participant CS as Container Service
participant FS as Workspace Files
A->>FE: Open /ide/:projectId
FE->>API: GET /api/projects/:id/open
API->>FS: Resolve owner clone path
API-->>FE: Project opened
B->>FE: Open shared /ide/:projectId
FE->>API: GET /api/projects/:id/open
API->>FS: Resolve owner path for collaborator
API-->>FE: Shared owner path access
B->>TS: socket terminal:create(projectId)
TS->>API: Read project owner + environment
TS->>CS: Reuse/spawn owner language container
CS-->>TS: containerId + ports
TS-->>B: terminal:ready + stream
stateDiagram-v2
[*] --> NoContainer
NoContainer --> Running: open terminal/create session
Running --> Running: new session reuse (same user+language)
Running --> Running: backend restart reconnectExistingContainers()
Running --> Stopping: owner calls POST /api/projects/:id/close
Stopping --> NoContainer: stopContainer(user, language)
- Browser IDE with Monaco editor, XTerm terminal, and Yjs collaboration.
- GitHub repo import and local-folder import (creates repo + initial push).
- Workspace file operations through authenticated API.
- Docker language environments: python, node, java, go, rust, cpp, php, ruby, base.
- AI chat and autocomplete via OpenRouter.
- Project sharing by invite email and real-time collaborative editing.
- Frontend: Next.js 16.1.6, React 19.2.3, Zustand, Framer Motion, Monaco, XTerm.
- Backend: Express, Socket.IO, Dockerode, Simple-Git, Multer, Nodemailer.
- Data/Auth: Supabase (JWT verification + project/collaborator tables).
- Collaboration: yjs, y-websocket, y-monaco.
- AI: OpenRouter chat-completions API.
backend/ Express API + Socket.IO + Docker orchestration
frontend/ Main IDE app (Next.js, port 4000)
landing-page/ Marketing site (Next.js, port 3000)
docker/ Dockerfiles and image build scripts
- Node.js 20+
- Docker Desktop (or Docker Engine)
- Supabase project (URL + service role key)
- GitHub OAuth setup and provider token flow
- OpenRouter API key
- SMTP credentials (for invite emails)
git clone <your-repo-url>
cd CodeForge-IDE
cd backend && npm install
cd ../frontend && npm install
cd ../landing-page && npm install# terminal 1
cd backend
npm run dev
# terminal 2
cd frontend
npm run dev
# terminal 3
cd landing-page
npm run devPorts:
- Backend API:
http://localhost:4001 - Frontend IDE:
http://localhost:4000 - Landing page:
http://localhost:3000
Required keys used by current code:
SUPABASE_URLSUPABASE_SERVICE_KEYOPENROUTER_API_KEYFRONTEND_URL(optional, defaulthttp://localhost:4000)PORT(optional, default4001)WORKSPACE_DIR(optional, defaults under user home)SMTP_USERandSMTP_PASS(for invite email)
NEXT_PUBLIC_API_URL(typicallyhttp://localhost:4001)- Supabase public env vars used by your frontend auth client.
Health:
GET /health
GitHub:
GET /api/github/repos
Projects:
GET /api/projectsPOST /api/projectsDELETE /api/projects/:idGET /api/projects/:id/openPOST /api/projects/:id/closePOST /api/projects/:id/savePOST /api/projects/import
Files:
GET /api/files/tree/:projectIdGET /api/files/:projectId/readPOST /api/files/:projectId/writePOST /api/files/:projectId/createDELETE /api/files/:projectId/deletePOST /api/files/:projectId/upload
Collaborators:
GET /api/collaborators/:projectIdPOST /api/collaborators/:projectId/inviteDELETE /api/collaborators/:projectId/:userId
AI:
POST /api/ai/chatPOST /api/ai/autocomplete
429means OpenRouter rate-limit or quota/credit issue.- It is not always a missing-key issue.
- Verify billing/usage in OpenRouter, then retry.
- Ensure owner has opened the project at least once (owner clone exists).
- Verify container mounts owner workspace and project directory exists.
- Use
POST /api/projects/:id/closeas owner to stop stale language container, then reopen.
cd backend && npm run build
cd frontend && npm run build- Do not commit
.envfiles. - Rotate API keys if they were ever pushed to remote history.
- Keep GitHub provider tokens user-scoped and short-lived.