Skip to content

Harsh-sh7/NotAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 NotAI β€” AI Chat, Code Execution & Contest Arena

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.

Status React TypeScript Express MongoDB


⚑ Overview

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.


✨ Features

πŸ’¬ Chat Interface

  • Google Gemini AI integration
  • Real-time streaming responses
  • Persistent chat history (MongoDB)
  • Multiple conversation sessions

πŸ’» Code Assistant

  • Supports JavaScript, Python, Java, C++
  • Judge0 API integration for safe cloud execution
  • Monaco Editor (VS Code-like experience)
  • Syntax highlighting and error reporting

πŸ† Contest Arena

  • 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

πŸ” Authentication

  • JWT-based user sessions
  • Encrypted passwords (bcrypt)
  • Protected API routes

πŸ“± Responsive Design

  • Mobile-first layout
  • PWA-ready for installable experience
  • Smooth animations and dark/light mode

🧩 Project Structure

Frontend β€” React + TypeScript

frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/   # Chat, CodeEditor, Auth, Contest, Leaderboard, etc.
β”‚   β”œβ”€β”€ context/      # Auth, Chat & Contest state
β”‚   β”œβ”€β”€ services/     # API integration
β”‚   └── types/        # TypeScript definitions

Backend β€” Node.js + Express

backend/
β”œβ”€β”€ models/       # MongoDB schemas (User, Chat, Submission)
β”œβ”€β”€ routes/       # Auth, Chat & Contest APIs
β”œβ”€β”€ middleware/   # JWT verification
└── server.js     # Entry point

πŸ› οΈ Tech Stack

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

🧱 Database Models

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
}

πŸ† Contest Arena β€” How It Works

Starting a Contest

  1. Select Difficulty β€” Choose from Beginner, Intermediate, or Expert
  2. Pick a Topic β€” Select from 15+ DSA topics or enter a custom one
  3. Choose Language β€” Python, JavaScript, C++, or Java
  4. Generate Problem β€” AI creates a unique coding challenge

Solving Problems

  • 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)

Tracking Progress

  • 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

Difficulty Levels

  • Beginner β€” Basic data structures and simple algorithms
  • Intermediate β€” Moderate complexity with multiple concepts
  • Expert β€” Advanced algorithms and complex problem-solving

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 16
  • MongoDB (local or Atlas)
  • Google Gemini API key
  • Judge0 API key

Setup

git clone https://github.com/Harsh-sh7/NotAI.git
cd NotAI

Backend

cd 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 dev

Frontend

cd ../frontend
npm install
# Add .env
VITE_API_URL=http://localhost:5001
GEMINI_API_KEY=your_gemini_api_key

npm run dev

Then visit http://localhost:3000.


βš™οΈ Environment Variables

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

🚒 Deployment

Build & Deploy

# Frontend
cd frontend && npm run build

# Backend
cd backend && npm start

Recommended Hosting:

  • Frontend β†’ Vercel / Netlify
  • Backend β†’ Render / Railway / DigitalOcean
  • Database β†’ MongoDB Atlas

🀝 Contributing

  1. Fork the repo
  2. Create a branch β†’ git checkout -b feature/new-feature
  3. Commit changes β†’ git commit -m "Added new feature"
  4. Push β†’ git push origin feature/new-feature
  5. Open a Pull Request

πŸ“œ License

This project is licensed under the MIT License β€” see LICENSE.


πŸ‘¨β€πŸ’» Author

Harsh Sharma
πŸ”— GitHub Profile
πŸ’‘ Project Repo: NotAI


πŸ™ Acknowledgments

  • Google Gemini AI
  • Judge0 API
  • React & TypeScript Communities
  • Tailwind CSS & Vite
  • MongoDB Atlas

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published