Prism is a production-style educational project built to demonstrate the integration of AI tools into a modern web development workflow. It allows users to paste code, select a focus area (Security, Performance, Readability), and receive structured, improved feedback powered by an LLM.
Experience Prism in action:
- Frontend Application: https://prism-two-snowy.vercel.app/
- Backend API Documentation: https://prism-backend-drab.vercel.app/api/v1/docs
- API Health Check: https://prism-backend-drab.vercel.app/api/v1/health
Note: The application is deployed on Vercel with automatic CI/CD via GitHub Actions. Every push to
maintriggers production deployment, whiledevelopbranch deploys to preview environments.
- Monorepo: NPM Workspaces
- Backend: NestJS + TypeScript (Modular Architecture, DTOs, Validation)
- Database: SQLite + Prisma ORM
- Frontend: Vue 3 + TypeScript + Vite + TailwindCSS
- Shared: Common DTOs and Types
- AI Integration: Google Gemini API (with rate limiting)
- MCP Server: Model Context Protocol for AI agent integration
- DevOps: Docker, GitHub Actions CI
- AI Development: See AGENTS.md
- Smart Code Editor: Syntax-ready input area.
- Focus Selection: Tailored AI prompts based on review goals.
- Structured Feedback: Clear, line-by-line analysis with severity levels.
- Modern UI: Glassmorphism, smooth gradients, and responsive design.
- MCP Integration: AI agents (ChatGPT, Claude) can use Prism as a tool via Model Context Protocol. Learn more
prism/
βββ apps/
β βββ backend/ # NestJS API (Port 3000)
β β βββ src/
β β β βββ modules/
β β β β βββ review/ # Code review logic
β β β β βββ llm/ # Google Gemini integration
β β β β βββ health/ # Health check endpoints
β β β β βββ mcp/ # Model Context Protocol server
β β β βββ prisma/ # Database service
β β β βββ main.ts # App bootstrap + Swagger
β β βββ prisma/
β β βββ schema.prisma # Production (Postgres)
β β βββ schema.sqlite.prisma # Local dev (SQLite)
β β
β βββ frontend/ # Vue 3 SPA (Port 5173)
β βββ src/
β β βββ components/ # Vue components
β β βββ api/ # Centralized API client
β β βββ App.vue # Main application
β βββ public/
β
βββ packages/
β βββ shared/ # Shared TypeScript types/DTOs
β
βββ .github/
β βββ workflows/
β βββ ci.yml # CI/CD pipeline
β
βββ docker-compose.yml # Container orchestration
The backend exposes three types of APIs:
-
REST API (
/api/v1/*)/review/analyze- Code analysis endpoint/review/models- Available AI models/review/history- Review history management/health- System health check
-
OpenAPI/Swagger (
/api/v1/docs)- Interactive API documentation
- Request/response schemas
- Try-it-out functionality
-
MCP Server (
/api/v1/mcp/*)- Model Context Protocol endpoints
- Enables AI agents (ChatGPT, Claude) to use Prism as a tool
- Tools:
analyze_code,get_available_models,get_review_history - Resources:
prism://models,prism://history/*,prism://review/* - Prompts:
security_review,performance_review,readability_review - Full MCP Documentation
Prism allows you to test both local and production environments seamlessly.
Ideal for standard development without external dependencies.
- Initialize:
npm run setup:local
- Run:
npm run dev
Use this to test your cloud database locally.
- Configure Environment:
Add your Vercel/Neon connection string to
apps/backend/.env:PRISMA_DATABASE_URL="postgres://user:pass@host/db?sslmode=require"
- Initialize:
npm run setup:postgres
- Run:
npm run dev
If you already have the project set up and just want to toggle:
- Switch to SQLite:
npm run db:local:sync - Switch to Postgres:
npm run db:prod:sync
This project is optimized for a zero-config deployment on Vercel:
- Framework: Select
NestJSfor the backend andVitefor the frontend. - Build Command: The root
package.jsonincludesvercel-build, which Vercel will use to:- Initialize the Postgres Prisma Client.
- Automatically push schema changes to your Vercel Postgres instance.
- Build the monorepo.
- Environment Variables:
- Ensure
PRISMA_DATABASE_URL(orPOSTGRES_PRISMA_URL) is set. - Set
GEMINI_API_KEYin settings.
- Ensure
Visit http://localhost:3000/api/v1/health to see your system status.
- Append
?ping=trueto verify the live database connection (passive by default).
Run the entire stack with one command:
docker-compose up --buildAccess Frontend at http://localhost:8080 and Backend at http://localhost:3000.
- Backend Unit Tests:
npm run test -w apps/backend - Backend E2E Tests:
npm run test:e2e - Frontend Unit Tests:
npm run test -w apps/frontend
Prism implements the Model Context Protocol (MCP), allowing AI agents to use it as a tool for code analysis.
- Create a Custom GPT in ChatGPT
- Add an Action using Prism's OpenAPI schema:
https://prism-backend-drab.vercel.app/api/v1/docs - Configure MCP endpoints
- Ask ChatGPT to review code - it will automatically use Prism!
Example:
You: "Review this code for security issues:
SELECT * FROM users WHERE id = " + userId
ChatGPT: [Uses Prism's analyze_code tool]
I found a critical SQL injection vulnerability...
Add to your claude_desktop_config.json:
{
"mcpServers": {
"prism": {
"url": "https://prism-backend-drab.vercel.app/api/v1/mcp"
}
}
}Restart Claude Desktop - it can now analyze code using Prism automatically!
# List available tools
curl -X POST https://prism-backend-drab.vercel.app/api/v1/mcp/tools/list
# Analyze code
curl -X POST https://prism-backend-drab.vercel.app/api/v1/mcp/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "analyze_code",
"arguments": {
"code": "function test() { var x = 1; }",
"focus": "readability"
}
}'Full MCP Documentation: MCP_INTEGRATION.md
This project demonstrates two levels of AI integration:
The entire project was built using AI agents with Model Context Protocol tools. Every componentβfrom architecture to deploymentβwas developed through human-AI collaboration.
Development Tools Used:
view_file,view_file_outline- Code explorationwrite_to_file,replace_file_content- Code generation and editingrun_command- Package installation, testing, buildinggrep_search,find_by_name- Codebase navigation
Key Implementations:
- Database layer with dual Prisma schemas (SQLite/Postgres)
- Docker containerization with multi-stage builds
- Comprehensive test suite (unit + E2E + integration)
- CI/CD pipeline with automated deployment
- OpenAPI/Swagger documentation
- MCP server implementation
Full Development Workflow: AGENTS.md
The application itself integrates AI for code analysis:
LLM Integration:
- Provider: Google Gemini API (
gemini-1.5-flash) - Features: Structured JSON output, rate limiting, fallback mocks
- Focus Areas: Security, Performance, Readability, Bugs
MCP Server:
- Exposes Prism's capabilities to AI agents
- Tools:
analyze_code,get_available_models,get_review_history - Resources: Models, review history, individual reviews
- Prompts: Pre-configured review templates
Architecture:
AI Agent (ChatGPT/Claude)
β MCP Protocol
Prism MCP Server
β Internal API
Review Service
β LLM API
Google Gemini
β Analysis
Structured Feedback
Automated via GitHub Actions:
- On Push: Runs tests (unit + E2E + frontend)
- On Success: Triggers Vercel deployment via Deploy Hooks
- Environments:
mainβ production,developβ preview
- README.md - This file, project overview
- AGENTS.md - AI-assisted development workflow
- MCP_INTEGRATION.md - MCP server usage guide
- PROMPTS.md - Initial development prompts
MIT