AlgoScheduler is a high-performance, containerized monorepo platform for executing and judging code submissions (similar to LeetCode or Codeforces).
[ Browser ] <---(HTTP/WS)---> [ Nginx Reverse Proxy (Frontend) ]
|
+-------------------------+-------------------------+
| |
[ React SPA ] [ Fastify API ]
(Monaco + Vite) (JWT, BullMQ Producer)
|
v
[ Postgres DB ] <--------------------------------------+ [ Redis Queue ]
(Prisma Storage) (BullMQ / Jobs)
|
v
[ Node Worker ] <--------------------------------------+ [ Judge Worker ]
(Stub Judge Logic) (BullMQ Consumer)
- Frontend: React 19, Vite, Monaco Editor (for a rich IDE experience).
- Backend: Fastify (high-performance Node.js framework), Zod (schema validation), BullMQ (distributed job queue).
- Database: PostgreSQL with Prisma ORM.
- Cache/Queue: Redis.
- Deployment: Docker Compose with multi-stage builds and Nginx as a reverse proxy.
- Environment Setup:
cp .env.example .env
- Launch Infrastructure:
docker-compose up -d
- Bootstrap Application:
npm install # Installs all deps & generates Prisma client npm run db:push # Syncs schema to Postgres npm run db:seed # Populates problems and test users
- Run All Services:
npm run dev
- Website: http://localhost:5173
- API Health: http://localhost:3001/api/health
- OpenAPI Docs: http://localhost:3001/api/docs
To deploy AlgoScheduler to a live server (VPS):
- Prerequisites: Ensure your server has Docker and Docker Compose installed.
- Clone & Config:
Edit
git clone <your-repo-url> cd AlgoScheduler cp .env.example .env
.envand setJWT_ACCESS_SECRET,JWT_REFRESH_SECRET, and your productionDATABASE_URL. - Build & Launch:
Your website will be live on port 80. Nginx handles serving the React files and routing
docker-compose -f docker-compose.prod.yml up -d --build
/apicalls to the containerized Node backend.
If you prefer managed hosting over a VPS:
- Link your GitHub repo to Railway.app.
- Add a Postgres and Redis service.
- Deploy the
backend/apiandbackend/workeras separate services. - Set the
DATABASE_URLandREDIS_URLin the Railway environment variables.
- Link your repo to Vercel.
- Set the Root Directory to
frontend. - Set the Environment Variable:
VITE_API_BASE_URLto your Railway API URL (e.g.,https://api.myapp.railway.app). - Vercel will build and host your React app at a custom
.vercel.appdomain.
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/api/auth/register |
POST | No | Create a new student account |
/api/auth/login |
POST | No | Exchange credentials for JWT tokens |
/api/auth/refresh |
POST | Yes | Rotate refresh token for a new session |
/api/problems |
GET | No | List all published coding challenges |
/api/submissions |
POST | Yes | Submit code for evaluation |
/api/submissions/:id |
GET | Yes | Poll for submission status and results |
- Admin User:
admin@local.dev/password123 - Student User:
demo@local.dev/password123
frontend/: React application and Monaco integration.backend/api/: REST server and validation logic.backend/worker/: Asynchronous judging service.packages/db/: Prisma schema and shared database client.packages/shared/: Shared types and constants across the monorepo.
Created with ❤️ for competitive programming enthusiasts.