A full-stack, cloud-native developer environment combining real-time LLM code review, an authentic VS Code interactive terminal, polyglot remote code execution, and seamless workspace management.
🌐 Explore Live Application »
Key Features •
Architecture •
Tech Stack •
Getting Started •
API Docs •
Author
- Live URL: https://shubhamcodeai.vercel.app
- Status: 🟢 Online & High Availability (Vercel Edge & Serverless Python)
- Token-by-Token SSE: Streaming responses via Server-Sent Events for near-instant latency without buffering.
- xKiro AI Engine with Fallback: Powered primarily by Qwen 3.8 Omni Flash via xKiro API, with automatic graceful fallback to Meta Llama 3.1 8B on NVIDIA NIM.
- Context-Aware Review: Analyzes editor code, selected language, and syntax trees to highlight bugs, security vulnerabilities, edge cases, and time/space complexity optimizations.
- Automated YouTube Video Recommendations: Whenever relevant coding topics or algorithms are discussed, relevant educational lecture videos are dynamically fetched and embedded directly inside the chat feed.
- Instant Session Reset: Click the glowing AI Logo button directly above the decorator toolbar to instantly initialize a clean chat session with pre-configured suggestion chips (Explain Code, Find Bugs, Optimize, Security).
- Overlay Chat History: Click Old Chats to open a full slide-in drawer showing previous conversation threads with timestamps and message counts.
- Granular Chat Deletion (
🗑️): Remove individual sessions with a single click, keeping both guest and authenticated storage clutter-free.
- Zero Clutter: Replaced cumbersome static STDIN input forms with an integrated, authentic VS Code terminal experience (
>_ TERMINAL). - Smart Input Detection & Inline Prompt: Automatically parses incoming code for input operations (
cin >>,scanf,input(),Scanner) and prompts with an inline cursor (PS C:\workspace> █). - Live Echo Execution: Enter input values directly into the console prompt, hitting
Enterto freeze the input and immediately stream remote compiler execution outputs.
- Cloud Sandboxing: Executes C++, Python, Java, and JavaScript via the Judge0 API.
- Base64 & Unicode Normalization: Employs an internal string normalizer to convert mathematical Unicode symbols (e.g.,
≤,≥,≠, non-standard quotes) into strict ASCII prior to Base64 transmission, eliminating HTTP 400 submission errors.
- File Persistence: Save, tag, and organize custom source code snippets across multiple languages.
- Two-Way Sync: Load any saved code directly into the editor with automatic language switching and syntax re-highlighting.
- Persistent User State: Stores files safely with support for signed-in user profiles and local guest workspaces.
- Zero Cold-Start Lag: Engineered with cryptographically signed tokens (
django.core.signing) to operate statelessly across serverless lambdas. - No Database Locking: Eliminates database latency and connection pool exhaustion during sudden spikes on Vercel.
- Automated Spam Mitigation: Enforces a sliding-window rate limiting policy allowing a maximum of 7 messages per 60 seconds per client IP.
- Real IP Edge Detection: Extracts genuine user IP addresses behind Vercel edge reverse proxies (
HTTP_X_FORWARDED_FOR) with fallback handling. - Zero AI Token Waste: Throttled requests are blocked immediately at the Django gateway with HTTP 429 (
Too Many Requests), protecting API keys and upstream LLM quotas. - Live UI Cooldown Countdown: The chat Send button turns into a dynamic countdown (
Wait 22s...), temporarily disabling input until the cooldown window slides.
- THE DSA PATTERN PLAYBOOK Integration: Features a curated library of 75+ top interview DSA problems structured from the Playbook PDF across 13 core algorithmic categories:
- Arrays & Hashing (Two Sum, Contains Duplicate, Group Anagrams, etc.)
- Two Pointers (3Sum, Container With Most Water, Valid Palindrome, etc.)
- Sliding Window (Longest Substring Without Repeating, Min Window Substring, etc.)
- Stack (Valid Parentheses, Min Stack, Monotonic Stack, Largest Histogram)
- Binary Search (Search Rotated Array, 2D Matrix, Koko Bananas)
- Linked List (Reverse List, Cycle Detection, Merge K Sorted Lists)
- Trees (Invert Tree, Level Order Traversal, Validate BST, Max Path Sum)
- Tries (Implement Trie, Word Search II)
- Heap / Priority Queue (Kth Largest, Median Stream, Task Scheduler)
- Backtracking (Subsets, Combination Sum, N-Queens, Sudoku Solver)
- Graphs (Number of Islands, Rotting Oranges, Course Schedule)
- Dynamic Programming (Climbing Stairs, House Robber, Coin Change, LIS)
- Direct LeetCode Practice Links: One-click Practice on LeetCode ↗ links opening the exact problem page on LeetCode (
https://leetcode.com/problems/<slug>/). - Header Bar & Full-Page Navigation: Accessible via a dark-themed
[≡] Problem List < >toolbar bar above the Code Editor with a← Back to Dashboardbutton for smooth navigation. - Key Patterns & Takeaways: Includes essential interview takeaways, pattern summaries, and clean light-weight typography.
┌─────────────────────────────────────────────────────────────────────────┐
│ CLIENT BROWSER │
│ │
│ ┌──────────────────────┐ ┌─────────────────┐ ┌──────────────────┐ │
│ │ Monaco Code Editor │ │ VS Code Console │ │ AI Assistant UI │ │
│ │ (Syntax & Completion)│ │ (Inline Prompts)│ │ (SSE + Cooldown) │ │
│ └──────────┬───────────┘ └────────┬────────┘ └────────┬─────────┘ │
└──────────────┼───────────────────────┼────────────────────┼─────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────────────┐
│ DJANGO REST API (VERCEL) │
│ │
│ ┌──────────────────────┐ ┌─────────────────┐ ┌──────────────────┐ │
│ │ /api/run-code │ │ 7-Msg/Min Shield│ │ /api/auth/* │ │
│ │ (Code Execution) │ │ (Rate Limiter) │ │ (Stateless HMAC) │ │
│ └──────────┬───────────┘ └────────┬────────┘ └──────────────────┘ │
│ │ ▼ │
│ │ ┌─────────────────┐ │
│ │ │ /api/chat-stream│ │
│ │ │ (SSE Streaming) │ │
│ │ └────────┬────────┘ │
└──���───────────┼───────────────────────┼──────────────────────────────────┘
│ │
┌──────┴──────┐ ┌──────┴──────────────────────────┐
▼ ▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────────────────┐ ┌──────────────────┐
│ Judge0 │ │ Base64 │ │ Primary Provider │ │ Fallback NIM │
│ Sandbox │ │ Engine │ │ xKiro (Qwen 3.8 Omni)│ │ (Llama 3.1 8B) │
└──────────┘ └──────────┘ └──────────────────────┘ └──────────────────┘
| Layer | Technologies |
|---|---|
| Frontend Framework | Vanilla ES6+ JavaScript, Semantic HTML5, Custom CSS3 Design System |
| Code Editor | Monaco Editor (VS Code core engine) |
| Backend Framework | Django 6.0, Django REST Framework, Python 3.10+ |
| Rate Limiting & Security | Sliding-Window IP Throttler (7 msgs/60s via Django Memory Cache) |
| AI LLM Inference | xKiro API (Qwen 3.8 Omni Flash:free), NVIDIA NIM (Llama 3.1 8B) |
| Code Execution | Judge0 CE (Dockerized remote compiler engine) |
| Streaming Protocol | Server-Sent Events (SSE) via StreamingHttpResponse |
| Authentication | Cryptographic HMAC Token Signing (django.core.signing) |
| Static Assets | WhiteNoise Static Asset Compression & Caching |
| Hosting & CI/CD | Vercel Serverless Functions + GitHub Actions Auto-Deploy |
| Shortcut | Action | Scope |
|---|---|---|
| F5 or Ctrl + Shift + Enter | Run Code / Compile | Global Editor |
| Ctrl + S | Quick Save Workspace | Global Editor |
| Enter (in terminal) | Submit Input Value | Active Terminal Prompt |
| Enter (in chat) | Send Message to AI | Chat Input Box |
| Escape | Close Any Active Popup / Dropdown | Global Window |
- Python 3.10+
- Git
- Free API key from xKiro or NVIDIA Build
git clone https://github.com/shubhamjrd4559-sudo/CodeSenseAI.git
cd CodeSenseAIpython -m venv venv
venv\Scripts\activatepython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the root directory:
# Django Settings
DEBUG=True
SECRET_KEY=your-secure-django-secret-key-here
# Primary AI Model (xKiro)
XKIRO_API_KEY=your-xkiro-api-key-here
XKIRO_MODEL=qwen/qwen3.8-omni-flash:free
# Secondary Fallback Model (NVIDIA NIM)
NVIDIA_API_KEY=nvapi-your-nvidia-key-here
LLM_MODEL=meta/llama-3.1-8b-instruct
# Execution Engine (Judge0)
RAPIDAPI_KEY=your-rapidapi-key-here # Optional if using public endpointpython manage.py migrate
python manage.py runserverOpen your browser and navigate to:
http://127.0.0.1:8000
- Endpoint:
POST /api/run-code/ - Payload:
{
"code": "#include <iostream>\nint main() { std::cout << \"Hello World\"; return 0; }",
"language": "cpp",
"stdin": ""
}- Response:
{
"success": true,
"output": "Hello World",
"exit_code": 0,
"execution_time": "0.045s",
"memory": "1420 KB"
}- Endpoint:
POST /api/chat-stream/ - Headers:
Accept: text/event-stream - Payload:
{
"message": "Explain the time complexity of this binary search",
"code": "def binary_search(arr, x): ...",
"language": "python"
}- Response: Tokens streamed via SSE chunk format (
data: {"token": "..."}\n\n). - Rate Limit Reached (HTTP 429):
{
"success": false,
"error": "⏳ Rate limit reached: 1 minute me maximum 7 messages allow hain. Kripya 22s wait karein!",
"wait_seconds": 22
}This repository is optimized for deployment on Vercel:
- Fork or push your changes to your GitHub repository.
- Log in to Vercel and click "Add New Project".
- Select
CodeSenseAIand set Framework Preset to Other (handled automatically byvercel.json). - In Environment Variables, add:
XKIRO_API_KEY: Your xKiro API keySECRET_KEY: A random 50-character string
- Click Deploy. Vercel will build and deploy the application in under 60 seconds!
- Sliding-Window IP Rate Limiter: 7 messages / 60s abuse shield with live UI cooldown countdown.
- DSA Pattern Playbook & LeetCode Integration: 75+ top interview questions across 13 topics with direct LeetCode links & full-page dashboard navigation.
- RAG (Retrieval-Augmented Generation) Pipeline: Integrating vector embeddings (Pinecone) with a curated DSA & algorithmic pattern library for zero-hallucination code reviews.
- Upstash Redis Caching: Low-latency caching for frequent code queries and cross-region rate limiting.
- Multi-Tab File Editor: Support simultaneous multi-file workspaces and tabs.
- Real-Time Collaborative Coding: WebRTC / WebSocket powered peer-to-peer live pair programming.
Contributions are what make the open-source community an incredible place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'feat: Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
- GitHub: @shubhamjrd4559-sudo
- Live Project: https://shubhamcodeai.vercel.app
- Project Repository: CodeSenseAI
