Skip to content

evgenygurin/claude-code-ui-nextjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

82 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Claude Code UI - Next.js

Claude Code UI TypeScript Vercel v0

Modern web interface for Claude Code CLI and Cursor CLI built with Next.js 15, powered by v0 components, and deployed on Vercel.

🎯 Overview

Claude Code UI is a comprehensive web application that provides a beautiful, responsive interface for interacting with Claude Code and Cursor CLI tools. Built with modern technologies and best practices, it offers:

  • Real-time AI Chat Interface - Communicate with Claude and Cursor AI
  • Integrated Terminal - Direct CLI access through web browser
  • File Management - Browse, edit, and manage project files
  • Git Integration - Full Git workflow support
  • Production Monitoring Dashboard - Real-time error tracking, CI/CD monitoring, and system health
  • Intelligent Caching - Redis-backed caching with automatic fallback
  • Performance Monitoring - Comprehensive API and database performance tracking
  • Automated Reporting - Scheduled reports with email delivery
  • Mobile Responsive - Works perfectly on all devices
  • High Performance - Optimized for speed and scalability

πŸš€ Quick Start

Prerequisites

  • Node.js 20+
  • npm 10+
  • Claude Code CLI or Cursor CLI installed
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/your-org/claude-code-ui-nextjs.git
    cd claude-code-ui-nextjs
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env
    # Edit .env with your configuration
  4. Start development server

    npm run dev
  5. Open in browser

    http://localhost:3000
    

πŸ—οΈ Architecture

The application follows a modern, scalable architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚    β”‚   API Routes    β”‚    β”‚  External APIs  β”‚
β”‚   (Next.js)     │◄──►│ (Next.js API)   │◄──►│ Claude/Cursor   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β–Ό                       β–Ό                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Components    β”‚    β”‚   WebSocket     β”‚    β”‚   File System   β”‚
β”‚   (v0 + shadcn) β”‚    β”‚   (Real-time)   β”‚    β”‚   (Local/Cloud) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Technology Stack

Frontend

  • Next.js 15 - React framework with App Router
  • React 19 - Latest React with concurrent features
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first styling
  • v0 Components - AI-generated UI components
  • shadcn/ui - High-quality React components

Backend

  • Next.js API Routes - Serverless API endpoints
  • Vercel Edge Functions - Ultra-fast serverless functions
  • WebSockets - Real-time communication
  • NextAuth.js - Authentication solution
  • Prisma - Database ORM
  • Redis Caching - High-performance distributed caching
  • SSE (Server-Sent Events) - Real-time notifications
  • Performance Monitoring - Response time tracking and analytics

Infrastructure

  • Vercel - Hosting and deployment
  • PostgreSQL - Primary database
  • Redis - Caching and session storage
  • Vercel Blob - File storage
  • Sentry - Error tracking and monitoring
  • GitHub Actions - CI/CD pipeline integration

πŸ”‘ Environment Variables

Copy .env.example to .env and configure:

# Required - Basic Configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-generated-secret-here

# Required - AI Provider API Keys (choose one or both)
CLAUDE_API_KEY=your-claude-api-key
CURSOR_API_KEY=your-cursor-api-key

# Optional - Additional providers
OPENAI_API_KEY=your-openai-api-key

# Optional - Database (for production)
DATABASE_URL=postgresql://username:password@localhost:5432/claude-code-ui

Generating Secrets

For NEXTAUTH_SECRET, generate a secure random string:

openssl rand -base64 32

πŸ“š Documentation

Comprehensive documentation is available in the /docs directory:

πŸ”§ Development

Available Scripts

npm run dev          # Start development server
npm run build        # Build for production
npm run start        # Start production server
npm run lint         # Run ESLint
npm run type-check   # Run TypeScript checks

# Database commands
npm run db:generate  # Generate Prisma client
npm run db:push      # Push schema to database
npm run db:migrate   # Run migrations
npm run db:seed      # Seed database with sample data
npm run db:setup     # Complete database setup

Project Structure

claude-code-ui-nextjs/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”œβ”€β”€ dashboard/         # Dashboard pages
β”‚   └── globals.css        # Global styles
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ chat/             # AI chat interface
β”‚   β”œβ”€β”€ file-manager/     # File explorer
β”‚   β”œβ”€β”€ terminal/         # Terminal emulator
β”‚   β”œβ”€β”€ layout/           # Layout components
β”‚   └── ui/               # Base UI components
β”œβ”€β”€ lib/                   # Utilities and helpers
β”œβ”€β”€ types/                 # TypeScript type definitions
β”œβ”€β”€ docs/                  # Documentation
└── public/               # Static assets

πŸ”Œ API Endpoints

Monitoring Dashboard

  • GET /api/metrics/overview - System health overview
  • GET /api/metrics/sentry - Error tracking metrics
  • GET /api/metrics/cicd - CI/CD pipeline health
  • GET /api/metrics/conflicts - Merge conflict tracking

Reports & Notifications

  • GET /api/reports - Get scheduled reports
  • POST /api/reports/generate - Generate report on-demand
  • GET /api/reports/history - Report history with pagination
  • GET /api/notifications/sse - Real-time notification stream
  • GET /api/notifications - List notifications

Cache & Performance

  • GET /api/cache - Cache statistics
  • DELETE /api/cache?tag=metrics - Invalidate cache by tag
  • GET /api/monitoring/performance - Performance metrics

Chat Integration

  • POST /api/claude - Send messages to Claude AI
  • POST /api/cursor - Execute Cursor CLI commands

Terminal

  • POST /api/terminal - Execute terminal commands
  • GET /api/terminal - List terminal sessions
  • DELETE /api/terminal - Close terminal session

File Management

  • GET /api/files - List directory contents
  • POST /api/files - Create/write files
  • DELETE /api/files - Delete files

WebSocket

  • WS /api/ws - Real-time communication

πŸš€ Deployment

Deploy to Vercel

Deploy with Vercel

  1. One-click deploy using the button above
  2. Configure environment variables in Vercel dashboard
  3. Set up custom domain (optional)

Manual Deployment

# Install Vercel CLI
npm install -g vercel

# Deploy
vercel --prod

# Set environment variables
vercel env add NEXTAUTH_SECRET
vercel env add CLAUDE_API_KEY
# ... add other required variables

πŸ”’ Security

  • Environment Variables - Sensitive data stored securely
  • NextAuth.js - Industry-standard authentication
  • CORS Protection - Cross-origin request filtering
  • Rate Limiting - API abuse prevention
  • Input Validation - SQL injection protection

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

πŸ™ Acknowledgments


Built with ❀️ using Next.js, v0, and Vercel

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors