A full-stack web app that merges AI-powered chat, live code execution, and AI-generated coding contests, built using React, TypeScript, Node.js, and MongoDB.
NotAI lets users chat with Google Gemini AI, manage multiple conversations, execute code in real time across popular programming languages, and compete in AI-generated coding contests β all in one clean, responsive interface.
- Google Gemini AI integration
- Real-time streaming responses
- Persistent chat history (MongoDB)
- Multiple conversation sessions
- Supports JavaScript, Python, Java, C++
- Judge0 API integration for safe cloud execution
- Monaco Editor (VS Code-like experience)
- Syntax highlighting and error reporting
- AI-Generated DSA Problems β Unique coding challenges generated by Gemini AI
- Three Difficulty Levels β Beginner, Intermediate, and Expert
- Multiple Topics β Arrays, Strings, Trees, Graphs, Dynamic Programming, and more
- Live Code Execution β Test your solutions with example and hidden test cases
- Progress Tracking β Track solved problems and success rate
- Leaderboard β Compete with other users and see rankings by difficulty
- Submission History β Review all your previous attempts and solutions
- Smart Problem Generation β Never get the same problem twice for a topic
- JWT-based user sessions
- Encrypted passwords (bcrypt)
- Protected API routes
- Mobile-first layout
- PWA-ready for installable experience
- Smooth animations and dark/light mode
frontend/
βββ src/
β βββ components/ # Chat, CodeEditor, Auth, Contest, Leaderboard, etc.
β βββ context/ # Auth, Chat & Contest state
β βββ services/ # API integration
β βββ types/ # TypeScript definitions
backend/
βββ models/ # MongoDB schemas (User, Chat, Submission)
βββ routes/ # Auth, Chat & Contest APIs
βββ middleware/ # JWT verification
βββ server.js # Entry point
| Layer | Technologies |
|---|---|
| Frontend | React, TypeScript, Tailwind CSS, Vite, Monaco Editor |
| Backend | Node.js, Express.js, Mongoose |
| Database | MongoDB |
| External APIs | Google Gemini AI, Judge0 API |
| Auth | JWT, bcrypt |
User
{
username: String,
email: String,
password: String,
createdAt: Date
}Chat
{
user: ObjectId (ref: User),
title: String,
messages: [{ role: String, content: String, timestamp: Date }],
createdAt: Date
}Submission (Contest)
{
user: ObjectId (ref: User),
problemTitle: String,
problemDescription: String,
difficulty: String,
topic: String,
language: String,
code: String,
solved: Boolean,
attempts: Number,
testCases: Array,
lastAttemptedAt: Date
}- Select Difficulty β Choose from Beginner, Intermediate, or Expert
- Pick a Topic β Select from 15+ DSA topics or enter a custom one
- Choose Language β Python, JavaScript, C++, or Java
- Generate Problem β AI creates a unique coding challenge
- Problem Description β Clear problem statement with constraints
- Example Test Cases β Visible test cases to understand the problem
- Code Editor β Monaco editor with syntax highlighting
- Run Code β Test with custom inputs
- Submit β Run against all test cases (including hidden ones)
- Dashboard β View your stats (problems solved, attempts, success rate)
- Submission History β Review all past attempts with code
- Leaderboard β See global rankings by difficulty level
- Smart Generation β System remembers solved problems to avoid duplicates
- Beginner β Basic data structures and simple algorithms
- Intermediate β Moderate complexity with multiple concepts
- Expert β Advanced algorithms and complex problem-solving
- Node.js β₯ 16
- MongoDB (local or Atlas)
- Google Gemini API key
- Judge0 API key
git clone https://github.com/Harsh-sh7/NotAI.git
cd NotAIcd backend
npm install
# Add .env
MONGODB_URI=mongodb://localhost:27017/notai
JWT_SECRET=your_jwt_secret
GEMINI_API_KEY=your_gemini_api_key
RAPIDAPI_KEY=your_judge0_api_key
PORT=5001
npm run devcd ../frontend
npm install
# Add .env
VITE_API_URL=http://localhost:5001
GEMINI_API_KEY=your_gemini_api_key
npm run devThen visit http://localhost:3000.
| Variable | Description |
|---|---|
MONGODB_URI |
MongoDB connection string |
JWT_SECRET |
JWT encryption key |
GEMINI_API_KEY |
Google Gemini API key |
RAPIDAPI_KEY |
Judge0 API key |
PORT |
Backend port |
VITE_API_URL |
Frontend API base URL |
# Frontend
cd frontend && npm run build
# Backend
cd backend && npm startRecommended Hosting:
- Frontend β Vercel / Netlify
- Backend β Render / Railway / DigitalOcean
- Database β MongoDB Atlas
- Fork the repo
- Create a branch β
git checkout -b feature/new-feature - Commit changes β
git commit -m "Added new feature" - Push β
git push origin feature/new-feature - Open a Pull Request
This project is licensed under the MIT License β see LICENSE.
Harsh Sharma
π GitHub Profile
π‘ Project Repo: NotAI
- Google Gemini AI
- Judge0 API
- React & TypeScript Communities
- Tailwind CSS & Vite
- MongoDB Atlas