An intelligent, full-stack web platform for AI-powered code analysis, debugging, and real-time execution β built for developers who want instant, actionable feedback on their code.
Code Shield is a full-stack web application that lets developers write, upload, analyze, and execute code directly in the browser. It integrates large language models (via OpenRouter/OpenAI) for code review and debugging, and uses Judge0 for real-time multi-language code execution β all inside a Monaco-powered editor.
The platform also includes a separate Admin Dashboard for monitoring live users, tracking activity, and viewing error reports via Sentry.
- Monaco Editor β Professional VS Code-like code editing experience
- AI Code Review β Get explanations, suggestions, and best practices from an LLM
- AI Debugging β Paste broken code and get targeted fix suggestions
- Code Execution β Run code in 10+ languages with stdin support via Judge0
- Project Management β Upload, save, rename, and reload code projects
- Language Detection β Automatically detects code language on upload
- In-Editor Search β Search within the active file
- Google & GitHub Login β Secure OAuth authentication via NextAuth.js
- Admin Dashboard β Protected route with admin-only Google OAuth
- User Monitoring β View registered users pulled from Google Sheets
- Live User Count β Real-time online user tracking via Pusher
- Error Monitoring β Integrated Sentry dashboard link for production errors
| Layer | Technology |
|---|---|
| Framework | Next.js 15 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS + MUI |
| Editor | Monaco Editor (@monaco-editor/react) |
| Authentication | NextAuth.js v4 (Google, GitHub OAuth) |
| Database | PostgreSQL via Neon (serverless) |
| ORM | Drizzle ORM |
| File Storage | Vercel Blob |
| AI / LLM | OpenRouter SDK + OpenAI SDK |
| Code Execution | Judge0 API |
| Real-time | Pusher (presence channels) |
| Error Tracking | Sentry |
| Deployment | Vercel |
βββ app/
β βββ api/
β β βββ analyze-code/ # AI code analysis endpoint
β β βββ run-code/ # Judge0 execution endpoint
β β βββ save-project/ # Save project to DB + Blob
β β βββ get-projects/ # Fetch all projects
β β βββ get-project-details/# Fetch single project + blob content
β β βββ get-users/ # Admin: fetch users from Google Sheets
β β βββ pusher/presence/ # Pusher auth for presence channel
β β βββ auth/[...nextauth]/ # NextAuth.js handler
β βββ admin/
β β βββ login/ # Admin login page
β β βββ dashboard/ # Admin overview
β β βββ user-monitoring/ # Live user list + count
β βββ editor/ # Main editor page
β βββ components/
β βββ editor/
β β βββ Analysis.tsx # AI review panel
β β βββ Debug.tsx # AI debug panel
β β βββ FileExplorer.tsx# Project file tree
β β βββ Output.tsx # Execution output
β β βββ Terminal.tsx # Terminal with stdin
β β βββ Search.tsx # In-file search
β βββ LoginCard.tsx
β βββ Navbar.tsx
β βββ ProjectContext.tsx
β βββ PusherProvider.tsx
βββ types/ # Shared TypeScript types
βββ public/ # Static assets
βββ drizzle.config.ts
βββ package.json
The database uses PostgreSQL on Neon, managed via Drizzle ORM.
// app/lib/schema.ts
export const projects = pgTable('projects', {
id: serial('id').primaryKey(),
projectName: varchar('project_name', { length: 256 }),
fileName: varchar('file_name', { length: 256 }).notNull(),
blobUrl: varchar('blob_url', { length: 256 }).notNull(),
});idβ Auto-incrementing primary keyprojectNameβ User-defined project namefileNameβ Original filename of the uploaded codeblobUrlβ URL pointing to the file content stored in Vercel Blob
- Node.js 18+
- A Neon PostgreSQL database
- Vercel account (for Blob storage)
- Judge0 API key (RapidAPI)
- OpenRouter or OpenAI API key
- Google & GitHub OAuth apps
- Pusher account
- Sentry project
# Clone the repository
git clone https://github.com/H-sharma63/Minor-Project.git
cd Minor-Project
# Install dependencies
npm installCreate a .env.local file in the root:
# Database
DATABASE_URL=your_neon_postgres_url
# NextAuth
NEXTAUTH_SECRET=your_secret
NEXTAUTH_URL=http://localhost:3000
# Google OAuth (User)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
# Google OAuth (Admin)
ADMIN_GOOGLE_CLIENT_ID=your_admin_google_client_id
ADMIN_GOOGLE_CLIENT_SECRET=your_admin_google_client_secret
# GitHub OAuth
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
# AI
OPENROUTER_API_KEY=your_openrouter_key
# Code Execution
JUDGE0_API_KEY=your_judge0_rapidapi_key
# Vercel Blob
BLOB_READ_WRITE_TOKEN=your_blob_token
# Pusher
PUSHER_APP_ID=your_pusher_app_id
PUSHER_KEY=your_pusher_key
PUSHER_SECRET=your_pusher_secret
PUSHER_CLUSTER=your_pusher_cluster
# Sentry
SENTRY_DSN=your_sentry_dsnnpm run devOpen http://localhost:3000 in your browser.
# Push schema to Neon DB
npx drizzle-kit pushUser writes/uploads code
β
Monaco Editor (frontend)
β
βββββββββββββββββββββββββββββββ
β User triggers action: β
β β’ Analyze β /api/analyze-code β OpenRouter β Analysis Panel β
β β’ Debug β /api/analyze-code β OpenRouter β Debug Panel β
β β’ Run β /api/run-code β Judge0 β Terminal Output β
β β’ Save β /api/save-project β Neon DB + Vercel Blob β
βββββββββββββββββββββββββββββββ
- Users log in via Google or GitHub OAuth through NextAuth.js
- Admins use a separate Google OAuth provider with restricted access
- Sessions are JWT-based and validated on protected routes
Browser (Next.js Client)
β
Vercel (Next.js Server / API Routes)
β
ββββββββββββ¬ββββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ
β Neon DB β Vercel βOpenRouterβ Judge0 β Pusher β
β(Postgres)β Blob β (LLM) β (Run Code)β(Realtime)β
ββββββββββββ΄ββββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββ
Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.
This project is for academic and portfolio purposes.
Harshit Sharma GitHub