Arghyadeep09/DsaAlgo

โ˜… 0Forks 0GitHub โ†—Compare

Project website โ†—

README

๐Ÿš€ DSA Algorithm Learning Platform

DSA Learning Platform Logo

MIT License Node.js React Prisma Express.js Contributors Stars Issues

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


๐Ÿ“‹ Table of Contents


โœจ Overview

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.

๐ŸŽฏ Key Highlights

  • 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

๐ŸŽฏ Features

๐Ÿงฉ Core Features

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

๐ŸŽจ Advanced Features

  • 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

๐Ÿ› ๏ธ Tech Stack

Frontend ๐ŸŽจ

React Vite Tailwind CSS Three.js

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

Backend โš™๏ธ

Node.js Express.js Prisma MySQL

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

Development Tools ๐Ÿ”ง

ESLint Nodemon


๐Ÿ—๏ธ Project Structure

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

๐Ÿ—‚๏ธ Key Directories Explained

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

โšก Quick Start

Get up and running in under 5 minutes! ๐Ÿƒโ€โ™‚๏ธ

Prerequisites

  • Node.js (v18 or higher) ๐Ÿ“ฆ
  • npm or yarn package manager ๐Ÿ“‹
  • MySQL database (local or cloud) ๐Ÿ—„๏ธ
  • Git for version control ๐Ÿ”ง

๐Ÿš€ One-Command Setup

# 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.


๐Ÿ”ง Installation

Step 1: Clone the Repository

git clone https://github.com/naveenkumar29052006/DsaAlgo.git
cd DsaAlgo

Step 2: Backend Setup

cd backend

# Install dependencies
npm install

# Setup environment variables
cp .env.example .env
# Edit .env with your database credentials and JWT secret

Required 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

Step 3: Database Setup

# Generate Prisma client
npm run db:generate

# Push schema to database
npm run db:push

# Seed the database with sample data
npm run db:seed

Step 4: Frontend Setup

cd ../frontend

# Install dependencies
npm install

# Setup environment variables
cp .env.example .env
# Edit .env with your backend URL

Frontend Environment Variables:

VITE_API_URL="http://localhost:5001"

Step 5: Start Development Servers

# Start backend (from backend directory)
npm run dev

# Start frontend (from frontend directory - new terminal)
npm run dev

๐Ÿš€ Usage

๐Ÿ” Authentication

  1. Register: Create a new account with email and username
  2. Login: Access your personalized dashboard
  3. Profile: Manage your account and view statistics

๐Ÿงฉ Problem Solving

  1. Browse Problems: Explore categorized DSA problems
  2. Select Difficulty: Choose from School, Basic, Easy, Medium, Hard
  3. Code Solution: Use the Monaco editor with syntax highlighting
  4. Test & Submit: Run test cases and submit your solution
  5. Track Progress: Monitor your solving statistics

๐Ÿ“Š Progress Tracking

  • View your problem-solving statistics
  • Track time complexity improvements
  • Monitor success rates across categories
  • Earn achievements and badges

๐Ÿ† Leaderboard

  • Compete with other users
  • View global rankings
  • Track your position and progress

๐Ÿ’ป Code Examples

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'
  })
});

๐Ÿ“Š API Endpoints

๐Ÿ” Authentication Routes (/api/auth)

Method Endpoint Description Auth Required
POST /register Register new user โŒ
POST /login User login โŒ
GET /me Get current user โœ…
PUT /profile Update user profile โœ…

๐Ÿงฉ Problem Routes (/api/problems)

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 โœ…

๐Ÿ“ˆ Progress Routes (/api/progress)

Method Endpoint Description Auth Required
GET / Get user progress โœ…
GET /stats Get detailed statistics โœ…
POST /update Update progress โœ…

๐Ÿ† Leaderboard Routes (/api/leaderboard)

Method Endpoint Description Auth Required
GET / Get global leaderboard โœ…
GET /achievements Get user achievements โœ…

๐ŸŒ Environment Variables

Backend Configuration

# 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

Frontend Configuration

# 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"

๐Ÿงช Testing

Running Tests

# Backend tests
cd backend
npm test

# Frontend tests
cd frontend
npm test

# E2E tests
npm run test:e2e

Test Coverage

# Generate coverage report
npm run test:coverage

Manual Testing Checklist

  • User registration and login
  • Problem browsing and filtering
  • Code editor functionality
  • Solution submission
  • Progress tracking
  • Leaderboard updates
  • Responsive design across devices

๐Ÿค Contributing

We welcome contributions from developers of all skill levels! ๐ŸŽ‰

๐Ÿ”„ How to Contribute

  1. Fork the Repository

    # Click the Fork button on GitHub, then:
    git clone https://github.com/YOUR-USERNAME/DsaAlgo.git
    cd DsaAlgo
  2. Create a Feature Branch

    git checkout -b feature/amazing-feature
  3. Make Your Changes

    • Add new features
    • Fix bugs
    • Improve documentation
    • Add tests
  4. Test Your Changes

    npm run test
    npm run lint
  5. Commit Your Changes

    git add .
    git commit -m "โœจ Add amazing feature"
  6. Push to Your Fork

    git push origin feature/amazing-feature
  7. Create a Pull Request

    • Go to GitHub and create a Pull Request
    • Describe your changes clearly
    • Link any relevant issues

๐Ÿ“‹ Contribution Guidelines

Code Style

  • Use ESLint and Prettier for consistent formatting
  • Follow conventional commit messages
  • Write clear, descriptive variable and function names
  • Add comments for complex logic

Pull Request Guidelines

  • Ensure all tests pass โœ…
  • Update documentation if needed ๐Ÿ“
  • Add tests for new features ๐Ÿงช
  • Keep PRs focused and atomic ๐ŸŽฏ

Issue Reporting

When reporting bugs, please include:

  • Steps to reproduce the issue
  • Expected behavior vs actual behavior
  • Browser/OS information
  • Screenshots if applicable

๐Ÿท๏ธ Good First Issues

Look for issues labeled with:

  • good first issue - Perfect for newcomers
  • help wanted - We need community help
  • documentation - Improve our docs
  • bug - Fix existing issues

๐Ÿ“„ License

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.

๐Ÿ‘ฅ Authors

๐ŸŽจ Adarsh Priydarshi

Lead Developer & Project Creator

GitHub LinkedIn Email

"Building the future of interactive learning, one algorithm at a time."

๐Ÿ™ Acknowledgments

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

๐ŸŒŸ Show Your Support

If this project helped you learn DSA concepts or inspired your own projects, please consider:

โญ Star this repo ๐Ÿด Fork this repo ๐Ÿ“ข Share

๐Ÿ“ˆ Project Stats

GitHub stars GitHub forks GitHub watchers


Made with โค๏ธ by developers, for developers

Happy Coding! ๐Ÿš€

Contributors

adarsh-priydarshi-5646naveendhaterwal

Issues