Welcome to the CodeSaarthi project. This document explains how the project is structured, the environment setup, and the exact steps to run and test the application at this stage.
To run this application, make sure you have the following installed on your machine:
- Node.js: Version 18.0.0 or higher
- npm (comes with Node) or pnpm
The application requires several external integrations (Authentication, Database, AI, Media Storage, and Live Video Streaming). The .env file in the root directory contains the necessary credentials:
- Authentication (Clerk): Handles user login, registration, and session management.
- Database (Prisma & Supabase): Connects to a PostgreSQL database hosted on Supabase.
- AI Core (Google Gemini): Evaluates user submissions and generates dynamic coding questions.
- Media Storage (Cloudinary): Handles image uploads for the blog platform.
- Video Streaming (LiveKit): Powers real-time WebRTC audio/video rooms for live sessions.
Note
All credentials and API keys are already configured in your local .env file. No additional service configuration is required to run the project.
Follow these steps to run the project on your machine:
Open your terminal in the project root directory and run:
npm installGenerate the TypeScript database client from the Prisma schema:
npx prisma generateIf you make changes to the database models in prisma/schema.prisma or need to sync the tables on the remote Supabase database:
npx prisma db pushRun the Next.js development server:
npm run devThe server will spin up:
- Next.js will run on http://localhost:3000 (or 3001 if port 3000 is occupied).
- The server will automatically watch for any changes you make to the code and hot-reload.
Once the server is running, you can explore the following modules in your browser:
- Route:
/contest(with query params, e.g.,?category=dsa&level=Basicor?category=web&level=Basic) - Features: A fully integrated Monaco Editor interface where you can write code, submit it, and receive instant feedback evaluated by Gemini AI.
- Route:
/sessions - Features: Join scheduled live audio/video streaming sessions. Admin users can initiate and host live rooms, while students can join in real-time.
- Route:
/history - Features: Track your coding stats, view accuracy breakdowns, and look up details of your past contest submissions.
- Route:
/leaderboard - Features: Compare scores and see who is leading the rankings.
- Route:
/blogs - Features: Read programming posts and technical guides.
Certain administrative tasks, such as scheduling live sessions (/admin/sessions) and creating/editing blogs (/admin/blog/new), are restricted to the admin email address:
- Admin Email:
saurabhsingh100605@gmail.com
When logged in with this email, the administrative options will automatically appear on the navbar and dashboard.