Real-time collaborative code editor with multi-language support and execution.
This is a monorepo containing 5 services:
- frontend: React + Monaco editor UI (Yatharth)
- collab-server: Yjs + Redis collaboration backend (Yash Jain)
- execution-api: Code runner with ECS integration (Pranali)
- runners: Docker images for Python and Node.js (Pranali)
- translation: Gemini API Lambda for code translation (Binti)
- infra: AWS CDK infrastructure setup (Binti)
- shared: Shared types and API contracts (everyone)
- Node.js 18+ and npm 9+
- Docker (for running containers locally)
- AWS credentials configured (for CDK deployment)
- Git
- Clone and install
git clone <repo-url>
cd codecollab
npm install- Set up environment files
# In each service directory, create .env.local
cp .env.example .env.local
# Edit with your values- Start development servers
npm run devThis will start all services in watch mode.
Each person works on their assigned services but can read shared files:
Yatharth Mogra (Frontend)
frontend/- Read/writeshared/- Read only
Yash Jain (Collaboration)
collab-server/- Read/writeshared/- Read only
Pranali Thakkar (Execution)
execution-api/- Read/writerunners/- Read/writeshared/- Read only
Binti Padaliya (Translation + Infrastructure)
translation/- Read/writeinfra/- Read/writeshared/- Read only
The source of truth for all API contracts is shared/contracts.md.
Before implementing any endpoint or changing data structures:
- Update the contract in
shared/contracts.md - Update types in
shared/types.ts - Notify other team members in the PR
- Wait for feedback before coding
- Feature:
feature/description-of-work - Bug fix:
bugfix/description-of-fix - Infrastructure:
infra/description-of-change - Docs:
docs/description-of-update
[SERVICE] Brief description
Longer explanation if needed. Reference issues/PRs.
Example:
[collab-server] Add session persistence to DynamoDB
- Implement read/write operations for Session table
- Add GSI for public sessions filtering
- Add migration script for existing data
Closes #42
- Create PR with clear title mentioning the service
- Link related issues
- Include testing steps
- Request review from affected team members
- Get approval before merging to main
cd frontend
npm run devnpm run build --workspace=frontendnpm run test --workspacesnpm run build- Edit
shared/types.ts - Create PR for review
- All services pull latest main after merge
- Update
shared/contracts.md - Discuss changes in team slack
- Implement in corresponding services
- Update types in
shared/types.ts
cd infra
npm run synth # Generate CloudFormation
npm run diff # See what will change
npm run deploy # Deploy to AWSThree CDK stacks are deployed to AWS (us-east-1, account 212208751162):
| Stack | What it owns |
|---|---|
CodeCollab-NetworkStack |
VPC, public + private subnets |
CodeCollab-DataStack |
DynamoDB (sessions), ElastiCache Redis, S3 buckets (edit history, exec staging), ECR repos, translation Lambda, Yjs compaction Lambda |
CodeCollab-ComputeStack |
ECS Fargate cluster, ALB, Fargate services, auto-scaling |
All services run on Fargate in private subnets behind the ALB (codecollab-alb-*.us-east-1.elb.amazonaws.com).
| Service | Port | ALB path(s) | Health check | Min tasks | Max tasks | CPU scale-out |
|---|---|---|---|---|---|---|
| collab-server | 8000 | /ws/*, /api/sessions/* |
GET /health → 200 |
2 | 6 | 60 % |
| execution-api | 8001 | /api/run/* |
GET /health → 200 |
1 | 4 | 60 % |
| frontend | 3000 | / (default) |
GET / → 200 |
1 | 2 | 70 % |
Scale-out cooldown: 60 s (frontend: 120 s). Scale-in cooldown: 300 s for all services.
Port conflicts? Services default to:
- Frontend: 3000
- Collab Server: 8000
- Execution API: 8001
- Set different ports in .env.local
Node modules issues?
rm -rf node_modules package-lock.json
npm installAWS credentials not found?
# Configure AWS credentials
aws configure
# Or set environment variables
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...- Architecture questions: See
shared/contracts.md - Need to sync with team? Check calendar for collab sync time
- Blocked on another service? Open an issue on that service