Home Page
Problems List
Code Editor
Dashboard
Submissions
Account
CodeScale is a full-stack, focused coding judge platform built for developers who want to sharpen their Data Structures & Algorithms skills. Think of it as a self-hosted, lightweight LeetCode β with a built-in AI assistant, a dry-run canvas, real code execution, and a beautiful dashboard to track your growth.
The platform currently supports JavaScript and Python , with 30 curated problems spanning Easy, Medium, and Hard difficulty levels.
Feature
Description
π§© Problem Library
30 problems (10 Easy / 10 Medium / 10 Hard) with topic filters like Arrays, Trees, DP, Graphs and more
β‘ Live Code Execution
Write JavaScript or Python in a Monaco editor and run code with real test cases, getting instant verdicts
π€ AI Chatbot Assistant
Built-in DSA-only AI (powered by Groq) that guides you on approach, complexity, and strategy β without giving away the answer
ποΈ Dry Run Canvas
A freehand drawing canvas to sketch arrays, trees, or graphs before writing a single line of code
π User Dashboard
Points, streaks, activity heatmap, submission breakdown, and a leaderboard β all in one place
π Submission History
Full history of every accepted/rejected submission with source code review
π Auth System
JWT-based authentication with secure cookie storage, bcrypt password hashing, and Zod validation
π€ Account Management
Update name, email, password, and public bio from your account settings page
π‘οΈ Admin Panel
Protected admin routes to manage problems and platform analytics
π Leaderboard
Global rankings by total points earned across all accepted problems
CodeScale/
βββ π backend/
β βββ π config/
β β βββ db.js # MongoDB connection
β β βββ .env # Environment variables
β β βββ .env.example # Env template
β β
β βββ π controllers/
β β βββ auth.controller.js # Sign up / Sign in / Sign out
β β βββ user.controller.js # Profile & account updates
β β βββ problems.controller.js # Fetch problems & details
β β βββ user_submission.controller.js # Run & submit code
β β βββ user_history.controller.js # Submission history
β β βββ submissionDetail.controller.js # Single submission detail
β β βββ user_analytics.controller.js # Dashboard stats & heatmap
β β βββ chatbot.controller.js # Groq AI chatbot integration
β β βββ admin.controller.js # Admin problem management
β β βββ plateform_analytics.controller.js # Platform-wide stats
β β
β βββ π middleware/
β β βββ auth.middleware.js # JWT verification
β β βββ admin.middleware.js # Admin role guard
β β
β βββ π models/
β β βββ user.model.js # User schema (name, email, stats)
β β βββ problems.model.js # Problem schema (title, difficulty, tags)
β β βββ submission.model.js # Submission schema (code, verdict)
β β βββ avatar/ # Default avatar assets
β β
β βββ π routes/
β β βββ auth.route.js
β β βββ problems.route.js
β β βββ user.route.js
β β βββ user_submission.route.js
β β βββ user_history.route.js
β β βββ user_analytics.route.js
β β βββ chatbot.route.js
β β βββ admin.route.js
β β
β βββ π services/
β β βββ executionEngine.js # Code execution sandbox (JS & Python)
β β
β βββ π utils/
β β βββ template.js # Language code templates
β β βββ user_statsHelper.js # Points & streak calculation
β β
β βββ π temp/ # Temp files for code execution (auto-cleaned)
β βββ server.js # Express app entry point
β
βββ π frontend/
β βββ π src/
β β βββ π api/
β β β βββ api.js # Axios base instance
β β β
β β βββ π components/
β β β βββ π codeEditor/
β β β β βββ CodeEditor.jsx # Monaco editor wrapper
β β β β βββ DryRunCanvas.jsx # Freehand drawing canvas
β β β β βββ ProblemDescription.jsx # Problem sidebar
β β β β βββ Language.jsx # Language switcher
β β β β βββ RunCodeButton.jsx
β β β β βββ SubmitButton.jsx
β β β β
β β β βββ π chatbot/
β β β β βββ Chatbot.jsx # AI assistant panel
β β β β
β β β βββ π charts/
β β β β βββ StatsOverview.jsx # Points & difficulty breakdown
β β β β βββ SubmissionChart.jsx # Submission result chart
β β β β βββ DashboardSkeleton.jsx # Loading skeleton
β β β β
β β β βββ ActivityMap.jsx # GitHub-style activity heatmap
β β β βββ FilterProblem.jsx # Tag/difficulty filter UI
β β β βββ Leaderboard.jsx # Rankings widget
β β β βββ RecentSubmission.jsx # Recent activity feed
β β β βββ Navbar.jsx
β β β βββ HamburgerMenu.jsx
β β β
β β βββ π pages/
β β β βββ HomePage.jsx # Landing page
β β β βββ ProblemsList.jsx # All problems grid/list view
β β β βββ ProblemPage.jsx # Individual problem + editor
β β β βββ SubmissionHistory.jsx # Full submission log
β β β βββ SubmissionDetail.jsx # Single submission view
β β β βββ π auth/
β β β β βββ SignIn.jsx
β β β β βββ SignUp.jsx
β β β βββ π user/
β β β βββ UserDashboard.jsx # Personal stats dashboard
β β β βββ MyAccount.jsx # Account settings
β β β
β β βββ π hooks/
β β β βββ signIn.js
β β β βββ signUp.js
β β β βββ useChatBot.js
β β β
β β βββ π services/
β β β βββ heatMap.js # Heatmap data formatter
β β β βββ signIn.service.js
β β β βββ signUp.service.js
β β β
β β βββ π context/
β β β βββ ProblemContext.jsx # Problem state context
β β β
β β βββ App.jsx
β β βββ AppLayout.jsx
β β βββ main.jsx
β β
β βββ index.html
β βββ vite.config.js
β βββ package.json
β
βββ LICENSE
βββ README.md
Technology
Purpose
UI framework
Build tool & dev server
Utility-first styling
Client-side routing
Animations & transitions
VS Code-quality code editor
Dry run drawing canvas
HTTP client
Technology
Purpose
REST API framework
Server runtime
Database
ODM for MongoDB
Authentication tokens
Password hashing
Input validation
AI chatbot (DSA assistant)
Dev auto-restart
Service
Role
Frontend hosting
Backend hosting
/api/v1/auth β Sign up, Sign in, Sign out
/api/v1/problems β Get all problems, get problem by ID
/api/v1/submission β Run code, submit solution
/api/v1/user β Profile, account update, submission history
/api/v1/analytics β Dashboard stats, activity heatmap, leaderboard
/api/v1/chatbot β AI DSA assistant (Groq-powered)
/api/v1/admin β Admin problem management & platform analytics
π Getting Started Locally
git clone https://github.com/riteshrana12-dev/codeScale.git
cd CodeScale
cd backend
cp config/.env.example config/.env
# Fill in your MongoDB URI, JWT secret, and Groq API key in config/.env
npm install
npm run dev
cd ../frontend
# Create .env with your backend URL
echo " VITE_API_URL=http://localhost:3000" > .env
npm install
npm run dev
Frontend β http://localhost:5173
Backend β http://localhost:3000
This project is licensed under the ISC License β see the LICENSE file for details.
β If you found this project helpful, consider giving it a star! β