CodeShala is a full-stack web application designed for coding practice, problem-solving, AI-assisted learning, and video-based explanations. It provides an interactive experience with a modern UI, real-time submissions, and powerful admin tools.
- Overview
- Features
- Tech Stack
- Project Structure
- Installation
- Configuration
- Running the Application
- API Endpoints
- Frontend Routes
- Database Models
- Security Features
- License
- Contributing
CodeShala is an interactive platform combining:
- Coding problem-solving
- Real-time submission results
- Video explanations
- AI chat support for doubts
- Admin dashboards for content management
- User progress tracking
It is built with React (Frontend) and Node.js + MongoDB (Backend).
- Register / Login / Logout
- Solve coding problems with built-in editor
- Submit solutions and view evaluation
- Watch solution videos
- Chat with AI for hints
- View submission history
- Track progress
- Add / Update / Delete problems
- Upload & manage videos
- Delete any submission
- Access admin dashboard
- MongoDB for storage
- Redis caching
- Google Generative AI integration
- Cloudinary for media
- JWT-based authentication
- Rate limiting
- Schema validation with Zod
- React 19
- Vite
- Tailwind CSS + DaisyUI
- Redux Toolkit
- React Router
- Axios
- Monaco Code Editor
- React Hook Form + Zod
- Node.js
- Express.js
- MongoDB + Mongoose
- Redis
- JWT Authentication
- Bcrypt
- Google Generative AI
- Cloudinary
- Rate Limiting
- CORS
CodeShala/
β
βββ CodeShaala-Backend-main/
β βββ index.js
β βββ vercel.json
β βββ package.json
β βββ src/
β βββ config/ # DB & Redis config
β βββ controllers/ # Business logic
β βββ middleware/ # Auth, rate limiter, admin
β βββ models/ # MongoDB schemas
β βββ routes/ # API Routes
β βββ utils/ # Helper utilities
β
βββ CodeShaala-Frontend-main/
βββ index.html
βββ package.json
βββ vite.config.js
βββ src/
βββ components/
βββ pages/
βββ store/
βββ utils/
- Node.js v16+
- MongoDB (Local / Atlas)
- Redis server
- Cloudinary account
- Google GenAI API key
- Navigate to backend:
cd CodeShaala-Backend-main- Install dependencies:
npm install- Create
.envfile:
PORT=5000
DB_CONNECT_STRING=your_mongodb_uri
REDIS_PASS=redis://localhost:6379
JWT_SECRET=your_jwt_secret
JUDGE0_KEY=your_judge0_secret_key
GOOGLE_AI_API_KEY=your_genai_key
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret- Navigate:
cd CodeShaala-Frontend-main- Install:
npm install- Create
.env:
VITE_API_URL=http://localhost:5000cd CodeShaala-Backend-main
npm run devServer starts at: http://localhost:5000
cd CodeShaala-Frontend-main
npm run devFrontend runs at: http://localhost:5173
| Method | Endpoint | Description |
|---|---|---|
| POST | /user/register |
Register user |
| POST | /user/login |
Login user |
| POST | /user/logout |
Logout |
| GET | /user/profile |
Get user profile |
| GET | /user/check-auth |
Validate token |
| Method | Endpoint | Description |
|---|---|---|
| GET | /problem |
Get all problems |
| GET | /problem/:id |
Get problem details |
| POST | /problem |
Create problem (Admin) |
| PUT | /problem/:id |
Update (Admin) |
| DELETE | /problem/:id |
Delete (Admin) |
| Method | Endpoint | Description |
|---|---|---|
| POST | /submission |
Submit code |
| GET | /submission/:userId |
User submissions |
| GET | /submission/history |
Submission history |
| DELETE | /submission/:id |
Delete submission |
| Method | Endpoint | Description |
|---|---|---|
| POST | /ai/chat |
Chat with AI |
| POST | /ai/solve-doubt |
AI help for problems |
| Method | Endpoint | Description |
|---|---|---|
| GET | /video |
Get all videos |
| GET | /video/:problemId |
Get problem videos |
| POST | /video |
Upload video (Admin) |
| DELETE | /video/:id |
Delete video |
| Route | Page |
|---|---|
/ |
Landing Page |
/login |
Login |
/signup |
Sign Up |
/home |
Homepage |
/problem/:id |
Problem + Code Editor |
/submission-history |
User submissions |
/admin |
Admin Dashboard |
/admin/upload |
Add problems |
/admin/video |
Video manager |
/admin/delete |
Content removal |
{
username: String,
email: String,
password: String,
role: String,
problemsSolved: [ObjectId],
submissions: [ObjectId],
createdAt: Date
}{
title: String,
description: String,
difficulty: String,
testCases: Array,
solutions: [ObjectId],
creator: ObjectId,
createdAt: Date
}{
userId: ObjectId,
problemId: ObjectId,
code: String,
language: String,
status: String,
output: String,
executionTime: Number,
submittedAt: Date
}{
problemId: ObjectId,
title: String,
videoUrl: String,
explanation: String,
uploadedAt: Date
}- JWT Authentication
- Password hashing (bcrypt)
- Rate limiting
- Input validation with Zod
- Role-based access control
- CORS protection
- Redis caching
ISC License
Active development is in progress β features and updates are being added regularly.
Made with β€οΈ by the CodeShala Team