A comprehensive interactive platform for mastering Data Structures and Algorithms with real-time code execution, progress tracking, and gamified learning experience.
๐ Live Demo โข ๐ Documentation โข ๐ Report Bug โข โจ Request Feature
- โจ Overview
- ๐ฏ Features
- ๐ ๏ธ Tech Stack
- ๐๏ธ Project Structure
- โก Quick Start
- ๐ง Installation
- ๐ Usage
- ๐ API Endpoints
- ๐ Environment Variables
- ๐งช Testing
- ๐ค Contributing
- ๐ License
- ๐ฅ Authors
DSA Algorithm Learning Platform is a modern, full-stack web application designed to make learning Data Structures and Algorithms engaging and interactive. Built with React, Node.js, and Prisma, it provides a comprehensive environment for coding practice, progress tracking, and competitive learning.
- Interactive Problem Solving: Solve DSA problems with real-time code execution
- Progress Tracking: Monitor your learning journey with detailed analytics
- Gamified Experience: Earn achievements, badges, and compete on leaderboards
- Multi-Language Support: Code in multiple programming languages
- 3D Visualizations: Beautiful 3D animations and interactive elements
- Responsive Design: Seamless experience across all devices
| Feature | Description |
|---|---|
| ๐ User Authentication | Secure JWT-based registration and login system |
| ๐ Problem Database | Extensive collection of DSA problems categorized by difficulty |
| ๐ป Code Editor | Monaco Editor with syntax highlighting and auto-completion |
| โก Real-time Execution | Execute code with test cases and get instant feedback |
| ๐ Progress Analytics | Track solved problems, success rates, and time complexity |
| ๐ Leaderboard System | Compete with other users and climb the rankings |
| ๐๏ธ Achievement System | Unlock badges and achievements for milestones |
| ๐ฑ Responsive UI | Beautiful, mobile-first design with dark mode support |
- 3D Background Animations using Three.js and React Three Fiber
- Interactive Data Visualizations with Recharts
- Real-time Notifications using React Hot Toast
- State Management with Zustand
- Form Validation with React Hook Form
- API Caching with TanStack Query (React Query)
- Code Syntax Highlighting with React Syntax Highlighter
- Intersection Observer for performance optimization
| Technology | Version | Purpose |
|---|---|---|
| React | 18.3.1 | UI Framework |
| Vite | 5.4.17 | Build Tool & Dev Server |
| Tailwind CSS | 3.4.1 | Styling Framework |
| React Router | 6.20.1 | Client-side routing |
| Framer Motion | 10.16.16 | Animations |
| Three.js | 0.158.0 | 3D Graphics |
| Monaco Editor | 0.44.0 | Code Editor |
| Zustand | 4.4.7 | State Management |
| TanStack Query | 5.8.4 | Server State Management |
| Recharts | 2.8.0 | Data Visualization |
| Technology | Version | Purpose |
|---|---|---|
| Node.js | 18+ | Runtime Environment |
| Express.js | 4.18.2 | Web Framework |
| Prisma | 5.6.0 | Database ORM |
| MySQL | Latest | Database |
| JWT | 9.0.2 | Authentication |
| bcryptjs | 2.4.3 | Password Hashing |
| Helmet | 7.1.0 | Security Middleware |
| Morgan | 1.10.0 | HTTP Request Logger |
DsaAlgo/
โโโ ๐ backend/ # Node.js/Express backend
โ โโโ ๐ server.js # Main server entry point
โ โโโ ๐ config/ # Database configuration
โ โโโ ๐ controllers/ # Route controllers
โ โ โโโ authController.js # Authentication logic
โ โ โโโ problemController.js # Problem management
โ โ โโโ progressController.js # User progress tracking
โ โ โโโ leaderboardController.js # Leaderboard logic
โ โโโ ๐ middleware/ # Custom middleware
โ โ โโโ auth.js # JWT authentication middleware
โ โโโ ๐ prisma/ # Database schema & migrations
โ โ โโโ schema.prisma # Database schema definition
โ โ โโโ seed.js # Database seeding script
โ โโโ ๐ routes/ # API route definitions
โ โโโ ๐ package.json # Backend dependencies
โ
โโโ ๐ frontend/ # React frontend application
โ โโโ ๐ index.html # HTML entry point
โ โโโ ๐ src/
โ โ โโโ ๐ App.jsx # Main React component
โ โ โโโ ๐ components/ # Reusable UI components
โ โ โ โโโ Dashboard.jsx # User dashboard
โ โ โ โโโ ProblemList.jsx # Problem browsing
โ โ โ โโโ ProblemDetail.jsx # Individual problem view
โ โ โ โโโ Navbar.jsx # Navigation component
โ โ โ โโโ 3D/ # Three.js 3D components
โ โ โโโ ๐ pages/ # Route-level components
โ โ โ โโโ Login.jsx # Authentication pages
โ โ โ โโโ Register.jsx
โ โ โ โโโ Leaderboard.jsx
โ โ โโโ ๐ store/ # Zustand state management
โ โ โ โโโ authStore.js # Authentication state
โ โ โ โโโ problemStore.js # Problem data state
โ โ โ โโโ leaderboardStore.js # Leaderboard state
โ โ โโโ ๐ services/ # API service layer
โ โ โ โโโ api.js # Axios API configuration
โ โ โโโ ๐ data/ # Static data and mock data
โ โ โโโ ๐ utils/ # Utility functions
โ โโโ ๐ vite.config.js # Vite build configuration
โ โโโ ๐ tailwind.config.js # Tailwind CSS configuration
โ โโโ ๐ package.json # Frontend dependencies
โ
โโโ ๐ README.md # Project documentation
| Directory | Purpose |
|---|---|
backend/controllers/ |
Business logic for API endpoints |
backend/routes/ |
API route definitions and middleware |
backend/prisma/ |
Database schema, migrations, and seeding |
frontend/src/components/ |
Reusable React UI components |
frontend/src/store/ |
Global state management with Zustand |
frontend/src/services/ |
API integration and HTTP client setup |
Get up and running in under 5 minutes! ๐โโ๏ธ
- Node.js (v18 or higher) ๐ฆ
- npm or yarn package manager ๐
- MySQL database (local or cloud) ๐๏ธ
- Git for version control ๐ง
# Clone the repository
git clone https://github.com/naveenkumar29052006/DsaAlgo.git
cd DsaAlgo
# Setup backend
cd backend
npm install
cp .env.example .env # Configure your environment variables
npm run db:generate
npm run db:push
npm run db:seed
npm run dev
# Setup frontend (in a new terminal)
cd ../frontend
npm install
cp .env.example .env # Configure frontend environment
npm run dev๐ That's it! Open http://localhost:3000 to see the app.
git clone https://github.com/naveenkumar29052006/DsaAlgo.git
cd DsaAlgocd backend
# Install dependencies
npm install
# Setup environment variables
cp .env.example .env
# Edit .env with your database credentials and JWT secretRequired Environment Variables:
DATABASE_URL="mysql://username:password@localhost:3306/dsaalgo"
JWT_SECRET="your-super-secret-jwt-key"
JWT_EXPIRES_IN="7d"
FRONTEND_URL="http://localhost:3000"
PORT=5001# Generate Prisma client
npm run db:generate
# Push schema to database
npm run db:push
# Seed the database with sample data
npm run db:seedcd ../frontend
# Install dependencies
npm install
# Setup environment variables
cp .env.example .env
# Edit .env with your backend URLFrontend Environment Variables:
VITE_API_URL="http://localhost:5001"# Start backend (from backend directory)
npm run dev
# Start frontend (from frontend directory - new terminal)
npm run dev- Register: Create a new account with email and username
- Login: Access your personalized dashboard
- Profile: Manage your account and view statistics
- Browse Problems: Explore categorized DSA problems
- Select Difficulty: Choose from School, Basic, Easy, Medium, Hard
- Code Solution: Use the Monaco editor with syntax highlighting
- Test & Submit: Run test cases and submit your solution
- Track Progress: Monitor your solving statistics
- View your problem-solving statistics
- Track time complexity improvements
- Monitor success rates across categories
- Earn achievements and badges
- Compete with other users
- View global rankings
- Track your position and progress
Sample API Usage:
// Login user
const loginResponse = await fetch('/api/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
login: '[email protected]',
password: 'password123'
})
});
// Fetch problems
const problemsResponse = await fetch('/api/problems', {
headers: { 'Authorization': `Bearer ${token}` }
});
// Submit solution
const submissionResponse = await fetch('/api/problems/submit', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify({
problemId: 'problem-id',
code: 'your-solution-code',
language: 'javascript'
})
});| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
POST |
/register |
Register new user | โ |
POST |
/login |
User login | โ |
GET |
/me |
Get current user | โ |
PUT |
/profile |
Update user profile | โ |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/ |
Get all problems | โ |
GET |
/categories |
Get problem categories | โ |
GET |
/:id |
Get specific problem | โ |
POST |
/submit |
Submit solution | โ |
GET |
/:id/solutions |
Get problem solutions | โ |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/ |
Get user progress | โ |
GET |
/stats |
Get detailed statistics | โ |
POST |
/update |
Update progress | โ |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/ |
Get global leaderboard | โ |
GET |
/achievements |
Get user achievements | โ |
# Database
DATABASE_URL="mysql://username:password@localhost:3306/dsaalgo"
# JWT Configuration
JWT_SECRET="your-256-bit-secret"
JWT_EXPIRES_IN="7d"
# Server Configuration
PORT=5001
NODE_ENV="development"
# CORS Configuration
FRONTEND_URL="http://localhost:3000"
# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000 # 15 minutes
RATE_LIMIT_MAX_REQUESTS=100
# File Upload (if needed)
MAX_FILE_SIZE=5242880 # 5MB# API Configuration
VITE_API_URL="http://localhost:5001"
# App Configuration
VITE_APP_NAME="DSA Learning Platform"
VITE_APP_VERSION="1.0.0"
# Features Flags
VITE_ENABLE_3D_ANIMATIONS="true"
VITE_ENABLE_DARK_MODE="true"# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm test
# E2E tests
npm run test:e2e# Generate coverage report
npm run test:coverage- User registration and login
- Problem browsing and filtering
- Code editor functionality
- Solution submission
- Progress tracking
- Leaderboard updates
- Responsive design across devices
We welcome contributions from developers of all skill levels! ๐
-
Fork the Repository
# Click the Fork button on GitHub, then: git clone https://github.com/YOUR-USERNAME/DsaAlgo.git cd DsaAlgo
-
Create a Feature Branch
git checkout -b feature/amazing-feature
-
Make Your Changes
- Add new features
- Fix bugs
- Improve documentation
- Add tests
-
Test Your Changes
npm run test npm run lint -
Commit Your Changes
git add . git commit -m "โจ Add amazing feature"
-
Push to Your Fork
git push origin feature/amazing-feature
-
Create a Pull Request
- Go to GitHub and create a Pull Request
- Describe your changes clearly
- Link any relevant issues
- Use ESLint and Prettier for consistent formatting
- Follow conventional commit messages
- Write clear, descriptive variable and function names
- Add comments for complex logic
- Ensure all tests pass โ
- Update documentation if needed ๐
- Add tests for new features ๐งช
- Keep PRs focused and atomic ๐ฏ
When reporting bugs, please include:
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Browser/OS information
- Screenshots if applicable
Look for issues labeled with:
good first issue- Perfect for newcomershelp wanted- We need community helpdocumentation- Improve our docsbug- Fix existing issues
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Adarsh Priydarshi & Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Lead Developer & Project Creator
"Building the future of interactive learning, one algorithm at a time."
Special thanks to:
- Open Source Community for amazing libraries and tools
- Contributors who help improve this platform
- Users who provide feedback and suggestions
- Education Technology pioneers who inspire us