██████╗ ██████╗ ██████╗ ███████╗███╗ ███╗ █████╗ ██╗ ██╗
██╔════╝██╔═══██╗██╔══██╗██╔════╝████╗ ████║██╔══██╗╚██╗██╔╝
██║ ██║ ██║██║ ██║█████╗ ██╔████╔██║███████║ ╚███╔╝
██║ ██║ ██║██║ ██║██╔══╝ ██║╚██╔╝██║██╔══██║ ██╔██╗
╚██████╗╚██████╔╝██████╔╝███████╗██║ ╚═╝ ██║██║ ██║██╔╝ ██╗
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
The Open-Source Competitive Coding Platform — Code. Analyze. Dominate.
codeMAX is a fully open-source, industry-grade competitive programming platform — free for everyone, forever.
Built with love by developers, for developers. Solve problems, compete in contests, analyze your code, and climb the leaderboard.
🚀 Live Demo · 📖 Documentation · 🐛 Report Bug · ✨ Request Feature
- ✨ Features
- 🎯 What Makes codeMAX Different
- 🛠️ Tech Stack
- 📁 Project Structure
- ⚡ Quick Start
- 🔧 Configuration
- 📡 API Reference
- 🎨 UI & Theming
- 🤝 Contributing
- 📄 License
|
|
|
|
| Technology | Purpose |
|---|---|
| React 18 | UI framework with hooks and concurrent features |
| Vite | Lightning-fast build tool and dev server |
| Tailwind CSS | Utility-first CSS with custom design tokens |
| Zustand | Lightweight global state management |
| React Router v6 | Client-side routing with nested layouts |
| React Hot Toast | Beautiful notification toasts |
| Technology | Purpose |
|---|---|
| Node.js 18+ | JavaScript runtime |
| Express.js | RESTful API framework |
| MongoDB + Mongoose | NoSQL database with schema modeling |
| WebSocket (ws) | Real-time bidirectional communication |
| JWT | Stateless authentication tokens |
| Helmet | HTTP security headers |
| Morgan | HTTP request logging |
codemax/
├── 📦 package.json # Root workspace config (runs client + server)
├── 📄 README.md
├── 🔒 .gitignore
│
├── client/ # React frontend (Vite + Tailwind)
│ ├── src/
│ │ ├── App.jsx # Root app with routing
│ │ ├── index.css # Global styles & design tokens
│ │ ├── main.jsx # React entry point
│ │ ├── store/ # Zustand state stores (auth, theme)
│ │ ├── components/
│ │ │ └── Layout.jsx # App shell with navbar & sidebar
│ │ └── pages/
│ │ ├── Home.jsx # Landing dashboard
│ │ ├── Problems.jsx # Problem listing with filters
│ │ ├── ProblemSolve.jsx # Split-pane code editor + problem view
│ │ ├── Playground.jsx # Free-form code sandbox
│ │ ├── Contests.jsx # Live contest browser
│ │ ├── Leaderboard.jsx # Global rankings
│ │ ├── Profile.jsx # User profile & stats
│ │ ├── Login.jsx # Authentication
│ │ └── Register.jsx # User registration
│ └── tailwind.config.js # Custom color system & animations
│
└── server/ # Node.js + Express backend
├── src/
│ ├── index.js # App entry, middleware, WebSocket init
│ ├── config/
│ │ └── database.js # MongoDB connection setup
│ ├── models/
│ │ ├── User.model.js # User schema (auth, stats, ratings)
│ │ ├── Problem.model.js # Problem schema (test cases, editorial)
│ │ ├── Submission.model.js # Submission schema (verdict, timing)
│ │ └── Contest.model.js # Contest schema (problems, participants)
│ ├── routes/
│ │ ├── auth.routes.js # /api/auth — login, register, refresh
│ │ ├── problem.routes.js # /api/problems — CRUD & search
│ │ ├── submission.routes.js # /api/submissions — submit & history
│ │ ├── contest.routes.js # /api/contests — contest management
│ │ ├── leaderboard.routes.js# /api/leaderboard — rankings
│ │ ├── compiler.routes.js # /api/compiler — code execution
│ │ └── user.routes.js # /api/users — profile & stats
│ ├── services/
│ │ ├── codeExecutor.service.js # Sandboxed multi-language runner
│ │ └── staticAnalyzer.service.js # Code quality & pattern analysis
│ ├── middleware/
│ │ └── error.middleware.js # Global error handling
│ ├── utils/
│ │ └── logger.js # Structured logging utility
│ └── websocket/
│ └── index.js # WebSocket handlers for real-time features
└── .env # Environment configuration (see below)
Make sure you have the following installed:
- Node.js
>= 18.0.0— Download - MongoDB
>= 7.0(local) or a MongoDB Atlas account - npm
>= 9.0.0(comes with Node.js)
git clone https://github.com/your-username/codemax.git
cd codemaxnpm run install:allThis single command installs dependencies for the root, client, and server in one shot.
# Copy the example env file
cp server/.env.example server/.envEdit server/.env with your settings (see Configuration below).
npm run devThis concurrently starts:
- 🌐 Frontend → http://localhost:5173
- ⚙️ Backend API → http://localhost:5000
- 📡 WebSocket →
ws://localhost:5000/ws - 💚 Health Check → http://localhost:5000/health
# ── Server ─────────────────────────────────────
PORT=5000
NODE_ENV=development
# ── Database ───────────────────────────────────
# Local MongoDB
MONGODB_URI=mongodb://127.0.0.1:27017/codemax
# OR: MongoDB Atlas (cloud)
# MONGODB_URI=mongodb+srv://<user>:<password>@cluster.mongodb.net/codemax
# ── Authentication ──────────────────────────────
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
JWT_EXPIRES_IN=7d
# ── CORS ───────────────────────────────────────
CORS_ORIGIN=http://localhost:5173
# ── Rate Limiting ──────────────────────────────
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX=100
⚠️ Never commit your.envfile. It is already listed in.gitignore.
All API endpoints are prefixed with /api.
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
POST |
/api/auth/register |
Register a new user | No |
POST |
/api/auth/login |
Login and receive JWT | No |
POST |
/api/auth/refresh |
Refresh access token | Yes |
POST |
/api/auth/logout |
Invalidate token | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/api/problems |
List all problems (with filters) | No |
GET |
/api/problems/:slug |
Get problem by slug | No |
POST |
/api/problems |
Create a new problem | Admin |
PUT |
/api/problems/:id |
Update a problem | Admin |
DELETE |
/api/problems/:id |
Delete a problem | Admin |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
POST |
/api/submissions |
Submit a solution | Yes |
GET |
/api/submissions |
Get submission history | Yes |
GET |
/api/submissions/:id |
Get submission details | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
POST |
/api/compiler/run |
Execute code (sandbox) | Yes |
POST |
/api/compiler/analyze |
Run static analysis | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/api/contests |
List all contests | No |
GET |
/api/contests/:id |
Get contest details | No |
POST |
/api/contests/:id/register |
Register for a contest | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/api/leaderboard |
Global rankings | No |
GET |
/api/leaderboard/contest/:id |
Contest-specific leaderboard | No |
codeMAX uses a fully customizable Tailwind CSS design system with:
- Primary color: Indigo (
#6366f1) — buttons, links, accents - Accent color: Cyan (
#22d3ee) — highlights, badges, glow effects - Dark mode: Slate-based palette with glassmorphism effects
- Light mode: Clean white/gray with vibrant primary contrast
The theme toggle is available in the top navigation bar. The selected preference is persisted locally via Zustand.
Defined in client/tailwind.config.js:
colors: {
primary: { /* Indigo scale 50–950 */ },
accent: { /* Cyan scale 50–950 */ },
dark: { /* Slate scale — adapts per theme */ }
}We welcome contributions of all kinds — bug fixes, new features, documentation improvements, and more!
- Fork this repository
- Create a feature branch:
git checkout -b feat/amazing-feature - Commit your changes:
git commit -m "feat: add amazing feature" - Push to your fork:
git push origin feat/amazing-feature - Open a Pull Request — we'll review it as soon as possible!
- Follow the existing code style and naming conventions
- Write meaningful commit messages (we follow Conventional Commits)
- Add comments for complex logic
- Test your changes before submitting a PR
- For large changes, open an issue first to discuss the approach
Look for issues tagged with good first issue — these are great starting points for new contributors!
If you discover a security vulnerability, please do not open a public issue. Instead, email us directly so we can address it responsibly before public disclosure.
This project is licensed under the MIT License — see the LICENSE file for full details.
MIT License — Free to use, modify, and distribute.
Attribution appreciated but not required.
Made with ❤️ for the developer community
codeMAX is free and open-source — forever.
⭐ Star this repo if you find it useful — it helps more developers discover codeMAX!