[
A competitive programming platform that brings the excitement of 1v1 battles to Data Structures and Algorithms, similar to what platforms like Chess.com have done for chess.
- 1v1 DSA Battles: Real-time competitive programming matches
- ELO Rating System: Fair matchmaking based on skill level using Glicko rating system
- Progressive Difficulty: Problems adapt to your rating level
- Real-time Code Execution: Powered by Judge0 API
- Live Leaderboards: Global rankings and statistics
- Smart Matchmaking: Redis-powered real-time player matching
- Learning Resources: Curated study materials and roadmaps
- Performance Analytics: Track your progress and improvement
- Battle History: Review past matches and solutions
Users engage in 1v1 DSA battles where each match consists of problems tailored to the players' current rating levels. The outcome affects their ELO-based rating:
- Win: Rating increases β¬οΈ
- Loss: Rating decreases β¬οΈ
This ensures players are always matched with opponents of similar skill levels, making competitions fair, engaging, and growth-oriented.
The difficulty of problems evolves dynamically with your rating to ensure continuous learning:
| Rating Range | Topics | Examples |
|---|---|---|
| Beginner (800-1200) | Arrays, Strings, Basic Patterns | Two Sum, Palindrome Check, String Reversal |
| Intermediate (1200-1600) | Recursion, Searching, Sorting, Sliding Window | Binary Search, Merge Sort, Maximum Subarray |
| Advanced (1600+) | Trees, Graphs, Dynamic Programming | LCA, Dijkstra's Algorithm, Knapsack Problem |
This system gamifies the learning process, giving users clear goals and visible progress.
Weβll include a curated resources section featuring:
Handpicked blog posts
Trusted YouTube videos
DSA sheets and roadmaps
This helps users strengthen weak areas identified during matches, turning losses into learning opportunities.
Like Chess.com, weβll have a global leaderboard to fuel competitiveness and motivation. Users can track their improvement and see how they stack up against others worldwide.
Most platforms focus on solving problems in isolation or participating in weekly contests. We're introducing real-time head-to-head battles, adaptive matchmaking, and a dynamic difficulty system that evolves with your skills. The format is both competitive and educational, turning DSA prep into a sport.
- React.js 18+ - Modern UI library
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- Shadcn/ui - Beautiful and accessible components
- Axios - HTTP client for API requests
- Node.js & Express.js - Server framework
- Socket.io - Real-time WebSocket communication
- Prisma ORM - Type-safe database client
- PostgreSQL - Primary database
- Redis - Caching and real-time matchmaking
- JWT - Authentication and authorization
- Judge0 API - Code execution and testing
- Docker - Containerization for development
- ESLint - Code linting
- Prettier - Code formatting
- Vercel - Frontend deployment
Ranked/
βββ client/ # Frontend React application
β βββ public/ # Static assets
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ lib/ # Utilities and configurations
β β βββ ...
β βββ package.json
βββ server/ # Backend Express application
β βββ controllers/ # Route handlers
β βββ middleware/ # Custom middleware
β βββ prisma/ # Database schema and migrations
β βββ problems/ # DSA problems and test cases
β βββ routes/ # API route definitions
β βββ helpers/ # Utility functions
β βββ package.json
βββ README.md
- Node.js (v16 or higher)
- Docker & Docker Compose
- Git
-
Clone the repository
git clone <repository-url> cd Ranked
-
Install dependencies
# Install root dependencies npm install # Install client dependencies cd client && npm install # Install server dependencies cd ../server && npm install
-
Set up environment variables
# Navigate to server directory cd server # Copy the environment template (if available) cp .env.example .env
Edit
server/.envwith your configuration. Required variables include:DATABASE_URL- PostgreSQL connection stringPATH_TO_PROBLEMS- Full path to problems directoryJUDGE0_API_URL- Judge0 API endpointJUDGE0_API_KEY- Your Judge0 API keyCALLBACK_URL- Callback URL for Judge0JWT_SECRET- Secure JWT secret keyREDIS_HOST- Redis host (localhost for local development)REDIS_PORT- Redis port (6379 by default)
-
Start the database services
# Make sure you're in the server directory cd server docker-compose -f docker-compose.pg.yaml up
-
Set up Prisma Studio (New Terminal)
cd server npx prisma studio -
Start the backend server (New Terminal)
cd server npm run start-dev -
Start the frontend (New Terminal)
cd client npm run dev -
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
- Prisma Studio: http://localhost:5555
-
Start Docker services (Terminal 1):
cd server docker-compose -f docker-compose.pg.yaml up -
Launch Prisma Studio (Terminal 2):
cd server npx prisma studio -
Start backend (Terminal 3):
cd server npm run start-dev -
Start frontend (Terminal 4):
cd client npm run dev
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
npm run start-dev- Start development servernpm start- Start production servernpm run db:migrate- Run database migrationsnpm run db:seed- Seed the database
# Generate Prisma client
npx prisma generate
# Run migrations
npx prisma migrate dev
# Reset database
npx prisma migrate reset
# View database in browser (runs on http://localhost:5555)
npx prisma studio# Start database services
docker-compose -f docker-compose.pg.yaml up
# Start services in background
docker-compose -f docker-compose.pg.yaml up -d
# Stop services
docker-compose -f docker-compose.pg.yaml down
# View running containers
docker-compose -f docker-compose.pg.yaml psPOST /auth/register
POST /auth/login
POST /auth/logoutGET /api/users/profile
PUT /api/users/profile
GET /api/users/statsPOST /api/matchmaking/join-queue
DELETE /api/matchmaking/leave-queue
GET /api/matchmaking/statusGET /api/battles/history
GET /api/battles/:id
POST /api/battles/:id/submitGET /api/leaderboard
GET /api/leaderboard/user/:id# Run server tests
cd server
npm test
# Run client tests
cd client
npm test- Connect your GitHub repository to Vercel
- Set build command:
cd client && npm run build - Set output directory:
client/dist
- Set up your production database
- Configure environment variables
- Deploy using your preferred platform (Railway, Heroku, etc.)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Join our community discussions
- Mobile application
- Tournament system
- Team battles
- AI-powered problem recommendations
- Integration with popular coding platforms
- Advanced analytics dashboard
Happy Coding! π