An AI-powered LeetCode-style coding platform with secure code execution, personalized learning analytics, and intelligent code assistance.
BeatCode is a comprehensive coding practice platform designed to help developers improve their problem-solving skills through interactive coding challenges, AI-powered assistance, and detailed performance analytics.
๐ Learn by Doing : Practice coding with real-world problems
๐ค AI-Powered Learning : Get intelligent hints, code reviews, and explanations
๐ Track Progress : Visualize your growth with detailed analytics
๐จ Beautiful Experience : Modern UI with dark/light themes
Feature
Description
๐ป Code Editor
Monaco Editor (VS Code experience) with syntax highlighting
๐ Secure Execution
Sandboxed code execution via JDoodle API (with Mock Mode)
๐ค AI Assistant
Groq-powered hints, code reviews, and explanations
๐ Analytics
Activity heatmap, time analysis, and progress tracking
๐ Gamification
Leaderboard, solved problems tracking
๐ Theme Support
Dark/Light mode toggle
๐ Authentication : Secure JWT-based login/register
๐ Dashboard : Personalized progress overview
๐พ Submission History : Track all your attempts
โญ Problem Solving : Solve problems in multiple languages
โ Create Problems : Add new problems with test cases
โ๏ธ Update Problems : Edit existing problems
๐๏ธ Delete Problems : Remove problematic content
๐งช Test Cases : Public + Hidden test case support
Technology
Purpose
Node.js
Runtime environment
Express.js
Web framework
MongoDB Atlas
Database (Cloud)
JWT
Authentication
JDoodle API
Code execution (with mock mode)
Groq API
AI-powered assistance
Technology
Purpose
React
UI framework
Redux Toolkit
State management
Vite
Build tool
Monaco Editor
Code editor
Axios
HTTP client
CSS-in-JS
Styling
Service
Purpose
Vercel
Frontend hosting
Render
Backend hosting
MongoDB Atlas
Cloud database
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FRONTEND โ
โ (Vercel - React + Redux) โ
โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โ Login โ โ Home โ โ Problem โ โ Dashboardโ โ
โ โ Page โ โ Page โ โ Page โ โ Page โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ AI Helper / Monaco Editor โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Axios Client โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BACKEND โ
โ (Render - Node.js/Express) โ
โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Auth API โ โ Problems APIโ โ Submissions โ โ
โ โ /api/auth โ โ /api/problemsโ โ /api/submit โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ AI Service โ โ JDoodle API โ โ User DB โ โ
โ โ (Groq) โ โ (Executor) โ โ (MongoDB) โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Role
Email
Password
Admin
john@beatcode.com
password123
User
student@beatcode.com
password123
Node.js (v16+)
MongoDB Atlas account (or local MongoDB)
JDoodle API credentials (optional, mock mode available)
Groq API key (for AI features)
# Clone the repository
git clone https://github.com/The-AarushiSingh/BeatCode.git
cd BeatCode
# Install backend dependencies
npm install
# Install frontend dependencies
cd frontend
npm install
cd ..
# Set up environment variables
cp .env.example .env
# Edit .env with your credentials
# Server
PORT = 3000
NODE_ENV = production
# MongoDB
MONGODB_URI = your_mongodb_connection_string
# JWT
JWT_KEY = your_jwt_secret_key
JWT_SECRET = your_jwt_secret_key
# JDoodle
JDOODLE_CLIENT_ID = your_jdoodle_client_id
JDOODLE_CLIENT_SECRET = your_jdoodle_client_secret
# Groq AI
GROQ_API_KEY = your_groq_api_key
# Mock Mode
USE_MOCK = true # Set to false to use real JDoodle
# Start backend
npm run dev
# In another terminal, start frontend
cd frontend
npm run dev
Method
Endpoint
Description
POST
/api/auth/register
Register a new user
POST
/api/auth/login
Login user
POST
/api/auth/logout
Logout user
GET
/api/auth/check
Check authentication status
Method
Endpoint
Description
Auth
GET
/api/problems
Get all problems
None
GET
/api/problems/:id
Get problem by ID
None
POST
/api/problems
Create new problem
Admin
PUT
/api/problems/:id
Update problem
Admin
DELETE
/api/problems/:id
Delete problem
Admin
Method
Endpoint
Description
Auth
POST
/api/problems/:id/submit
Submit a solution
User
GET
/api/problems/user/solved
Get solved problems
User
Method
Endpoint
Description
Auth
POST
/api/problems/:id/hint
Get AI hint
User
POST
/api/problems/:id/review
Get AI code review
User
GET
/api/problems/:id/explanation
Get AI explanation
User
GET
/api/problems/recommendation
Get problem recommendation
None
BeatCode/
โโโ frontend/ # React Frontend
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ AIHelper.jsx # AI Assistant UI
โ โ โ โโโ Heatmap.jsx # Activity heatmap
โ โ โ โโโ TimeAnalysis.jsx # Time analytics
โ โ โโโ pages/
โ โ โ โโโ Login.jsx
โ โ โ โโโ SignUp.jsx
โ โ โ โโโ HomePage.jsx
โ โ โ โโโ ProblemPage.jsx
โ โ โ โโโ Dashboard.jsx
โ โ โ โโโ Leaderboard.jsx
โ โ โ โโโ Admin.jsx
โ โ โโโ store/
โ โ โ โโโ store.js # Redux store
โ โ โ โโโ authSlice.js # Auth state
โ โ โ โโโ ProblemSlice.js # Problems state
โ โ โโโ utils/
โ โ โโโ axiosClient.js # API client
โ โโโ index.html
โ โโโ package.json
โ โโโ vite.config.js
โ
โโโ src/ # Backend
โ โโโ config/
โ โ โโโ db.js # Database connection
โ โ โโโ redis.js # Redis connection
โ โโโ controllers/
โ โ โโโ authController.js # Auth logic
โ โ โโโ userProblem.js # Problem CRUD
โ โ โโโ userSubmission.js # Submission logic
โ โ โโโ aiController.js # AI endpoints
โ โโโ middleware/
โ โ โโโ adminMiddleware.js # Admin auth
โ โ โโโ userMiddleware.js # User auth
โ โโโ models/
โ โ โโโ user.js # User schema
โ โ โโโ problems.js # Problem schema
โ โ โโโ submissions.js # Submission schema
โ โโโ routes/
โ โ โโโ userAuth.js # Auth routes
โ โ โโโ prbCreator.js # Problem routes
โ โโโ services/
โ โ โโโ aiService.js # Groq AI service
โ โโโ utils/
โ โ โโโ jdoodleValidator.js # Code execution
โ โโโ index.js # Server entry
โ
โโโ .env # Environment variables
โโโ package.json
โโโ README.md
๐ง Challenges & Solutions
1. JDoodle API Rate Limits โ ๏ธ
Challenge: JDoodle's free tier limits to 200 requests per day , which was a significant bottleneck during development and testing.
Solution:
Mock Mode : Implemented a USE_MOCK environment variable that bypasses JDoodle entirely
Graceful Fallback : When rate limit is hit, the system falls back to mock mode
Developer Experience : Mock mode allows uninterrupted development and testing
2. CORS Configuration ๐
Challenge: Frontend (Vercel) couldn't communicate with backend (Render) due to CORS issues.
Solution:
Configured CORS to allow multiple origins (localhost, Vercel, Render)
Used environment variables for dynamic origin configuration
3. Code Editor Integration ๐
Challenge: Implementing a VS Code-like experience in the browser.
Solution:
Integrated Monaco Editor (VS Code's editor)
Added support for multiple languages (JavaScript, Python, Java, C++, Go, Rust)
Implemented boilerplate code generation
Feature
Description
๐น Video Explanations
Upload and view solution videos (Cloudinary)
๐ฌ Discussion Forums
Community discussions for each problem
๐ฑ Mobile App
React Native mobile application
๐ Notifications
Email and in-app notifications
Feature
Description
๐ง Smart Recommendations
ML-based problem suggestions
๐ Advanced Analytics
Detailed performance insights
๐ฏ Daily Challenges
New problem every day
๐ Contests
Timed coding competitions
Feature
Description
๐ค Collaborative Coding
Real-time pair programming
๐ Learning Paths
Curated problem sets for skill levels
๐ Enterprise Features
Team management, SSO, reporting
๐ Multi-language UI
Support for multiple languages
Contributions are welcome! Please follow these steps:
Fork the repository
Create a feature branch (git checkout -b feature/AmazingFeature)
Commit your changes (git commit -m 'Add some AmazingFeature')
Push to the branch (git push origin feature/AmazingFeature)
Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
JDoodle - For providing the code execution API
Groq - For the free AI API
Render - For the free backend hosting
Vercel - For the free frontend hosting
MongoDB - For the free cloud database
If you found this project helpful, please give it a โญ on GitHub!
Built with โค๏ธ by Aarushi Singh