A real-time competitive coding platform where users compete in timed contests, solve coding problems, and get instant feedback on submissions.
ZyCode is a monorepo built with Turborepo and Bun. It consists of four applications and shared packages:
blitz/
├── apps/
│ ├── web/ # Next.js frontend
│ ├── backend/ # Express REST API
│ ├── wss/ # WebSocket server
│ └── worker/ # Submission queue worker
└── packages/
├── db/ # Prisma client (PostgreSQL)
├── ui/ # Shared UI components (shadcn/ui)
├── zod/ # Shared Zod schemas
├── eslint-config/
└── typescript-config/
Browser (Next.js)
│
├──[HTTP]──▶ backend (Express :3001)
│ └── auth, contest, submission routes
│
├──[WS]────▶ wss (WebSocket :8080)
│ └── real-time contest events
│
└── submission flow:
backend → Redis queue → worker → Judge0 → wss → browser
- Submissions are pushed to a Redis list by the backend and polled by the worker.
- The worker runs each submission against test cases via Judge0 and publishes results back through the WebSocket server.
- The WebSocket server broadcasts events (correct answer, contest ended, winner) to all participants in a contest room.
| Layer | Technology |
|---|---|
| Frontend | Next.js 16, React 19, Tailwind CSS v4, shadcn/ui, Framer Motion |
| Backend | Express 5, JWT auth |
| WebSocket | ws library |
| Worker | Redis (queue), Judge0 (code execution) |
| Database | PostgreSQL via Prisma ORM |
| Monorepo | Turborepo + Bun workspaces |
| Languages | TypeScript throughout |
- Bun >= 1.3.5
- Node.js >= 18
- PostgreSQL database
- Redis instance
- Judge0 instance (self-hosted or cloud)
1. Clone and install dependencies
git clone https://github.com/vignesh2731/Zycode.git
cd Zycode
bun install2. Configure environment variables
Create .env files in the relevant apps:
apps/backend/.env
DATABASE_URL=postgresql://user:password@localhost:5432/zycode
JWT_SECRET=your_jwt_secret
REDIS_URL=redis://localhost:6379apps/worker/.env
DATABASE_URL=postgresql://user:password@localhost:5432/zycode
JUDGE0_URL=http://localhost:2358packages/db/.env
DATABASE_URL=postgresql://user:password@localhost:5432/zycode3. Set up the database
cd packages/db
bunx prisma migrate dev4. Run the development servers
From the repo root:
bun run devThis starts all apps in parallel via Turborepo:
| App | URL |
|---|---|
| Web | http://localhost:3000 |
| Backend | http://localhost:3001 |
| WebSocket | ws://localhost:8080 |
| Worker | (background process) |
Code submissions can be made in:
- C++
- Java
- Python
- User authentication (signup / login with JWT)
- Create and join coding contests
- Real-time updates: correct answers and contest end events are broadcast instantly to all participants
- Automatic winner determination based on number of problems solved
- Monaco editor for code input