Skip to content
ShauryaSood2003Public

About

A leetCode like application where you can solve some questions

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

46 Commits

Folders and files

Repository files navigation

CodeCrack

A LeetCode-style competitive programming platform with problems, contests, a discussion forum, and real-time code execution.

Architecture

Architecture

Submissions flow through a Redis queue to a worker pool that executes code via the Piston API. Results are pushed back to the browser over WebSockets via a Redis pub/sub channel.

Getting Started

Prerequisites: Docker and Docker Compose

git clone https://github.com/ShauryaSood2003/CodeCrack
cd CodeCrack

# Set your secrets (only these two are required)
cp .env.example .env
# Edit .env and set JWT_SECRET and ADMIN_CODE

docker compose up --build
Service URL
Frontend http://localhost:5173
Backend http://localhost:4000
WebSocket ws://localhost:8080

That's it. Docker Compose starts Postgres, both Redis instances, the backend (with automatic DB migration), the worker, the WebSocket server, and the frontend.

Local Development (without Docker)

If you prefer to run services directly for faster iteration:

Infrastructure:

docker run -e POSTGRES_PASSWORD="password" -d -p 5432:5432 postgres
docker run --name redis-queue -d -p 6379:6379 redis
docker run --name redis-pubsub -d -p 6381:6379 redis

Backend — create backend/.env from backend/.env.example, then:

cd backend && npm install && npx prisma migrate deploy && npm run dev

Workers, WebSocket — each in its own terminal:

cd workers && npm install && npm run dev
cd websocket && npm install && npm run dev

Frontend:

cd frontEnd && npm install && npm run dev

Database migrations

To create a new migration after changing backend/prisma/schema.prisma:

cd backend && npx prisma migrate dev --name <migration_name>

Contributing

We welcome contributions of all kinds — bug reports, feature requests, code, and docs.

  1. Fork the repo and create a branch: git checkout -b my-feature
  2. Make your changes
  3. Open a pull request describing what you changed and why

About

A leetCode like application where you can solve some questions

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages