Practice real-world ML challenges, compete on the leaderboard, and level up your data science skills.
ML Code is an interactive coding platform specifically designed for Machine Learning and Data Science practitioners. Inspired by LeetCode, it offers a curated set of ML problems spanning topics like Classification, Regression, Deep Learning, NLP, Computer Vision, and more β with a built-in Python code editor, real-time code execution, and a competitive leaderboard.
| Feature | Description |
|---|---|
| π§© ML Problem Set | Curated problems across 10+ ML topics with difficulty tiers |
| β‘ In-Browser Code Editor | Monaco Editor (VS Code engine) with Python 3 support and light/dark toggle |
| π Code Execution | Run and submit code against hidden test cases in real time |
| π Dashboard | Personal stats, activity heatmap, and recent submissions at a glance |
| π Leaderboard | Live global rankings with a visual podium for the top 3 |
| π€ Profile Page | Detailed profile with rank, streak, solved stats, badges, and heatmap |
| π Submissions Page | Full history of all submissions with status filtering & code preview |
| π¬ Discussion | Per-problem discussion threads (post, view, delete your comments) |
| π‘ Hints | Two-level hints per problem, revealed on demand |
| π Authentication | Email/password and Google OAuth sign-in |
| π Premium Dark UI | Glassmorphism design, ambient glow backgrounds, smooth animations |
| π± Responsive | Works across desktop and tablet screens |
| Technology | Purpose |
|---|---|
| React 18 + TypeScript | UI framework |
| Vite 5 | Build tool & dev server |
| Tailwind CSS 3 | Utility-first styling |
| Framer Motion | Animations |
Monaco Editor (@monaco-editor/react) |
In-browser code editor |
| React Router v6 | Client-side routing |
| TanStack Query | Server state management |
| Lucide React | Icon library |
| Radix UI + shadcn/ui | Headless UI components |
| Sonner | Toast notifications |
| date-fns | Date formatting |
| React Markdown + remark-gfm | Problem description rendering |
| Technology | Purpose |
|---|---|
| Node.js + Express | REST API server |
| MongoDB + Mongoose | Database & ODM |
| JSON Web Tokens (JWT) | Authentication |
| bcryptjs | Password hashing |
| google-auth-library | Google OAuth verification |
| dotenv | Environment config |
MLCode/
βββ src/ # Frontend source
β βββ pages/
β β βββ Index.tsx # Landing page
β β βββ Problems.tsx # Problem list with filters
β β βββ ProblemDetail.tsx # Code editor + problem view
β β βββ Dashboard.tsx # User dashboard
β β βββ Leaderboard.tsx # Global rankings
β β βββ Profile.tsx # User profile
β β βββ Submissions.tsx # Submission history
β β βββ SignIn.tsx # Login page
β β βββ SignUp.tsx # Registration page
β β βββ EditProfile.tsx # Profile settings
β βββ components/
β β βββ ui/ # shadcn/ui components
β β βββ AppSidebar.tsx # Navigation sidebar
β β βββ DifficultyBadge.tsx # Easy/Medium/Hard badge
β β βββ RecentSubmissions.tsx
β β βββ SubmissionHeatmap.tsx
β βββ App.tsx # Routes configuration
β
βββ server/ # Backend source
β βββ models/
β β βββ User.js # User schema
β β βββ Problem.js # Problem schema
β β βββ Submission.js # Submission schema
β β βββ Discussion.js # Discussion/comment schema
β βββ routes/
β β βββ auth.js # Auth + user routes
β β βββ problems.js # Problem CRUD routes
β β βββ submissions.js # Submission routes
β β βββ discussions.js # Discussion routes
β β βββ execute.js # Code execution route
β β βββ verifyToken.js # JWT middleware
β βββ services/ # Execution service
β βββ index.js # Express app entry
β
βββ vercel.json # Vercel SPA routing config
βββ .env # Frontend env vars
βββ vite.config.ts
- Node.js v18+
- MongoDB (local or MongoDB Atlas)
- A Google Cloud project with OAuth 2.0 credentials
git clone https://github.com/Manvith-kumar16/MLCode.git
cd MLCodecd server
npm installCreate server/.env:
MONGO_URI=mongodb+srv://<user>:<password>@cluster.mongodb.net/mlcode
GOOGLE_CLIENT_ID=your_google_oauth_client_id
PORT=5001Start the server:
npm run dev# From the project root
npm installCreate .env in the root:
VITE_API_URL=http://localhost:5001Start the dev server:
npm run devThe app will be available at http://localhost:5173
| Method | Endpoint | Description |
|---|---|---|
POST |
/signup |
Register with email & password |
POST |
/signin |
Login with email & password |
POST |
/google |
Login / register via Google OAuth |
GET |
/me |
Get current user profile (auth required) |
PUT |
/me |
Update profile (auth required) |
GET |
/leaderboard |
Get top 10 users by points |
GET |
/rank/:userId |
Get a user's global rank |
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
List all problems |
GET |
/:id |
Get single problem by problemId |
| Method | Endpoint | Description |
|---|---|---|
POST |
/submit |
Submit solution for judging |
GET |
/user/:userId |
Get all submissions for a user |
GET |
/stats/:userId |
Get heatmap data for a user |
GET |
/problem/:problemId |
Get submissions for a problem |
| Method | Endpoint | Description |
|---|---|---|
POST |
/:problemId |
Run code without submitting |
| Method | Endpoint | Description |
|---|---|---|
GET |
/:problemId |
Get all comments for a problem |
POST |
/ |
Post a new comment (auth required) |
DELETE |
/:commentId |
Delete your comment (auth required) |
- Connect your GitHub repo to render.com
- Set Root Directory to
server - Build command:
npm install| Start command:npm start - Add environment variables:
MONGO_URI,GOOGLE_CLIENT_ID,PORT
- Import repo at vercel.com β root directory
. - Framework: Vite | Build:
npm run build| Output:dist - Add env variable:
VITE_API_URL=https://your-render-backend.onrender.com - Add your Vercel domain to Google Cloud Console β Authorized Origins
VITE_API_URL=https://mlcode-snkb.onrender.comMONGO_URI=mongodb+srv://...
GOOGLE_CLIENT_ID=...apps.googleusercontent.com
PORT=5001This project is open source and available under the MIT License.