A powerful, lightweight development environment optimized for rapid prototyping and low-budget devices. Built with AI assistance, multi-file editing, WebContainer integration, and 100+ AI models.
- Multi-File Editing - Edit HTML, CSS, JavaScript, and more simultaneously
- Live Preview - See changes instantly as you type with WebContainer integration
- Multiple Layout Modes - Chat-only, code-only, split view, or fullscreen coding
- File Management - Create, edit, rename, delete files and folders with intuitive explorer
- Device Preview - Test on desktop, tablet, and mobile viewports
- Low-End Device Support - Optimized for budget smartphones and tablets (2GB+ RAM)
- Auto-Detection - Automatically detects device capabilities and adjusts performance
- Efficient Resource Usage - Minimal memory and CPU usage with smart optimizations
- Progressive Loading - Load features as needed to reduce initial load time
- Responsive Design - Perfect experience on any screen size
- Instant Setup - No complex configuration, start coding immediately
- AI-Assisted Development - Get help with code generation, debugging, and optimization
- Real-Time Collaboration - Share and iterate on ideas quickly
- Export Projects - Download your prototypes for further development
- 100+ AI Models: Access models from MiniMax, OpenAI, Meta-Llama, Qwen, DeepSeek, and more
- Streaming Responses: Real-time AI responses with typing indicators
- Chain of Thought Visualization: See how AI reasons through problems
- Context-Aware Assistance: AI understands your codebase and provides relevant help
- Smart Code Generation: Generate components, functions, and entire features
- Multi-File Editing: Edit HTML, CSS, JavaScript, and more simultaneously
- Live Preview: See changes instantly with WebContainer integration
- File Management: Intuitive file explorer with create, edit, rename, delete operations
- Multiple Layout Modes: Chat-only, code-only, split view, or fullscreen coding
- Syntax Highlighting: Support for 20+ programming languages
- Search & Replace: Find and replace across files
- Auto-Save: Never lose your work with automatic saving
- Low-End Device Optimized: Perfect for budget smartphones, tablets, and Chromebooks
- Auto Device Detection: Automatically adjusts performance based on device capabilities
- Responsive Design: Mobile-first with accessibility (WCAG 2.1 AA)
- Touch-Optimized: 44px+ touch targets on mobile devices
- Fast Loading: Optimized bundles, lazy loading, and efficient resource usage
- File Attachments: Drag-and-drop upload for images and documents
- Project Export: Download your prototypes for further development
- Multiple Themes: Light and dark mode support
- Keyboard Navigation: Full keyboard accessibility
- Undo/Redo: Complete editing history
- Device Preview: Test on desktop, tablet, and mobile viewports
- Web Apps - Build and test ideas quickly with live preview
- Landing Pages - Create marketing pages with instant visual feedback
- Interactive Demos - Prototype user interfaces with real-time updates
- Educational Projects - Learn by building with AI assistance
- Students - Learn coding on any device, including budget smartphones
- Emerging Markets - Develop on affordable hardware without compromising features
- Remote Teams - Collaborate from anywhere with lightweight tools
- Freelancers - Work efficiently on budget setups with full-featured environment
- Code Review - AI analyzes and suggests improvements to your code
- Bug Fixing - AI helps identify and resolve issues quickly
- Feature Development - AI generates boilerplate code and components
- Learning - AI explains code concepts and best practices
- Node.js 20.9.0+ and pnpm/npm
- Git
# Clone and install
git clone <your-repo-url>
cd ai-chatbot
pnpm install
# Set up environment (already configured in .env.local)
cp .env.local.example .env.local
# Run database migrations
# Go to Supabase Dashboard > SQL Editor
# Run: supabase/migrations/001_create_tables.sql
# Start development server
pnpm devVisit http://localhost:3000
-
Split View (Default)
- Chat and code editor side by side
- Perfect for AI-assisted development
- Real-time preview alongside coding
-
Chat Only
- Focus on AI conversation
- Great for planning and discussion
- Full-screen chat experience
-
Code Only
- Multi-file development environment
- File explorer, code editor, and live preview
- Ideal for intensive coding sessions
-
Fullscreen Code
- Maximum screen real estate for coding
- Best for complex projects and large screens
- Create Files/Folders: Click the
+button in file explorer - Edit Files: Select any file to open in the syntax-highlighted editor
- Live Preview: See changes instantly in the integrated preview panel
- Upload Files: Drag and drop files or use the upload button
- Search: Use Ctrl+F to search within files, Ctrl+H for replace
- Auto-Save: Files are automatically saved as you type
- Ask Questions: Get help with any coding problem or concept
- Generate Code: Request components, functions, or entire features
- Code Review: Ask AI to review and improve your existing code
- Debug Issues: Get help troubleshooting problems and errors
- Learn: Ask AI to explain programming concepts and best practices
- Optimize: Get suggestions for performance improvements
- Automatic detection of device capabilities (RAM, CPU, connection speed)
- Simplified animations and transitions for better performance
- Efficient memory management and garbage collection
- Lazy loading of heavy components and features
- Optimized rendering for slower devices
- Enable "Low-End Optimization" in settings for budget devices
- Use simple CSS animations on mobile devices
- Minimize JavaScript complexity for better performance
- Close unused browser tabs to free up memory
- Use code-only view for intensive editing on slower devices
- Start: Choose your view mode (split view recommended for beginners)
- Plan: Use AI chat to discuss your project ideas and get suggestions
- Code: Create files and start coding with AI assistance
- Preview: See your changes instantly in the live preview
- Test: Use device preview to test responsive design
- Iterate: Make improvements with AI help and real-time feedback
- Export: Download your completed prototype
Next.js Frontend → API Routes → HuggingFace API (AI)
→ Supabase (DB + Storage)
→ Clerk (Authentication)
→ Redis (Caching)
- Frontend: Next.js 14+, TypeScript, Tailwind CSS
- AI: Vercel AI SDK, HuggingFace Router (100+ models)
- Database: Supabase PostgreSQL with RLS
- Auth: Clerk with middleware protection
- Caching: Upstash Redis
- Storage: Supabase Storage (file attachments)
- Deployment: Vercel (recommended) or self-hosted
ai-chatbot/
├── app/
│ ├── api/chat/route.ts # Chat API endpoint
│ ├── page.tsx # Main chat interface with rapid prototyping
│ ├── layout.tsx # App layout with Open Graph tags
│ └── globals.css # Global styles (optimized)
├── components/
│ ├── file-manager/ # 🆕 Rapid Prototyping Components
│ │ ├── FileExplorer.tsx # File tree with CRUD operations
│ │ ├── CodeEditor.tsx # Multi-language code editor
│ │ ├── WebContainerPreview.tsx # Live preview with WebContainer
│ │ └── FileManager.tsx # Main file management component
│ ├── RapidPrototypeLayout.tsx # 🆕 Enhanced layout with view modes
│ ├── Message.tsx # Message display component
│ ├── ModelPicker.tsx # AI model selector
│ └── FileUpload.tsx # File upload component
├── lib/
│ ├── supabase.ts # Supabase client setup
│ └── models.ts # AI model definitions
├── supabase/
│ └── migrations/ # Database migrations
├── docs/
│ ├── DEPLOYMENT.md # Deployment guide
│ └── ARCHITECTURE.md # System architecture
├── public/
│ ├── manifest.json # 🆕 PWA manifest
│ └── og-image.svg # 🆕 Open Graph image
└── README.md # This file
All credentials are pre-configured in .env.local:
NEXT_PUBLIC_SUPABASE_URL- Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY- Supabase anonymous keySUPABASE_SERVICE_ROLE_KEY- Supabase service role key (server-side only)HUGGINGFACE_API_KEY- HuggingFace API key (server-side only)NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY- Clerk publishable keyCLERK_SECRET_KEY- Clerk secret key (server-side only)REDIS_URL- Redis connection string
MONGODB_URI- MongoDB for additional storageNEON_DATABASE_URL- Neon PostgreSQL alternativeE2B_API_KEY- E2B sandbox for code executionSMITHERY_API_KEY- Smithery MCP server integration
Choose from 100+ models grouped by provider:
// Models include:
- MiniMax M2 (204K context)
- OpenAI GPT-OSS (120B parameters)
- Meta Llama 3.3 (70B parameters)
- Qwen3 (235B parameters)
- DeepSeek V3 (reasoning model)
- And many more...Real-time AI responses using Vercel AI SDK:
const { messages, sendMessage, status } = useChat({
api: '/api/chat',
});Drag-and-drop or click to upload:
- Images (PNG, JPG, WebP)
- Documents (PDF, DOCX, TXT)
- Max 10MB per file
- Stored in Supabase Storage
- Row Level Security: Users can only access their own data
- API Key Protection: All keys server-side only
- Rate Limiting: Via Redis
- Input Sanitization: Prevent XSS attacks
- CORS: Restricted to allowed origins
- Stores chat sessions
- Links to user via
user_id - Tracks selected AI model
- Stores individual messages
- JSONB
partsfield for flexibility - Supports text, reasoning, sources, tool calls
- Metadata for uploaded files
- Links to messages and conversations
- Stores file URL, type, size
Chat with AI models
Request:
{
"messages": [...],
"model": "openai/gpt-oss-120b",
"webSearch": false
}Response: Server-Sent Events (streaming)
See DEPLOYMENT.md for detailed instructions.
# Push to GitHub
git init && git add . && git commit -m "Initial commit"
git remote add origin <your-repo>
git push -u origin main
# Deploy via Vercel Dashboard
# 1. Import GitHub repo
# 2. Add environment variables
# 3. DeployNote: Requires Node.js 20.9.0+ for Next.js 16. Vercel automatically provides the correct Node version.
The application is production-ready with enhanced rapid prototyping features. To test locally (requires Node.js 20.9.0+):
# Development with turbo mode (better for low-end devices)
pnpm dev:turbo
# Standard development
pnpm devVisit http://localhost:3000 and test:
- Type a message in the chat input
- Select different AI models from the model picker
- Upload files using the attachment button
- Enable web search toggle for enhanced responses
- Switch View Modes: Try chat-only, split view, code-only, and fullscreen modes
- File Management: Create HTML, CSS, JS files in the file explorer
- Live Coding: Edit files and see changes instantly in the preview
- Device Testing: Use viewport controls to test mobile/tablet/desktop views
- AI Assistance: Ask AI to generate code, review your work, or help debug
- Performance: Toggle low-end device optimization to test performance
- Export: Download your prototype projects
# Analyze bundle size
pnpm build:analyze
# Check performance with production build
pnpm build:production
pnpm start:production- Redis Caching: Model data, conversation lists
- Optimistic UI: Instant feedback before server response
- Code Splitting: Dynamic imports for large components
- Image Optimization: Next.js automatic optimization
- Edge Functions: Deploy to Vercel Edge for low latency
- Never commit
.env.localto version control - Rotate API keys regularly
- Monitor usage via provider dashboards
- Enable MFA on all service accounts
- Review RLS policies before production
- Scan dependencies for vulnerabilities (
npm audit)
- WCAG 2.1 AA compliant
- Keyboard navigation: Tab, Enter, Escape work everywhere
- Screen reader support: Proper ARIA labels
- Focus management: Visible focus rings
- Touch targets: Minimum 44px on mobile
- Color contrast: Meets accessibility standards
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Mobile browsers (iOS Safari, Chrome Android)
- Budget Smartphones (2GB+ RAM) - Android/iOS
- Tablets (iPad, Android tablets)
- Chromebooks - Perfect for education and development
- Low-end Laptops - Windows/Mac/Linux
- Any modern browser - Progressive enhancement
- Auto Device Detection: Detects RAM, CPU cores, and connection speed
- Adaptive Rendering: Adjusts features based on device capabilities
- Memory Management: Efficient garbage collection and resource usage
- Bundle Optimization: Tree shaking, code splitting, and lazy loading
- Progressive Loading: Load features as needed to reduce initial load time
- Optimized Animations: Simple animations for low-end devices
- Built-in performance monitoring and metrics
- Memory usage tracking and warnings
- Load time measurement and optimization tips
- Device capability detection and reporting
"Failed to fetch" error
- Check API keys in
.env.local - Verify HuggingFace API key is valid
- Check network connection
Authentication not working
- Verify Clerk keys are correct
- Check redirect URLs in Clerk dashboard
- Clear browser cookies and retry
File upload fails
- Check Supabase Storage bucket exists
- Verify RLS policies allow uploads
- Check file size limits (10MB max)
Database errors
- Run migrations in Supabase SQL Editor
- Check RLS policies are configured
- Verify Supabase URL and keys
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Multi-file editing with syntax highlighting
- Live preview with WebContainer integration
- Device viewport testing (mobile/tablet/desktop)
- Performance optimization for low-end devices
- Auto device capability detection
- Real WebContainer API integration (currently simulated)
- Project templates and starter kits
- Version control integration (Git)
- Collaborative editing (real-time)
- Component library and snippets
- MCP server integration UI
- E2B sandbox for code execution
- Voice input/output for accessibility
- Code generation templates
- Advanced debugging tools
- Performance profiling and optimization tips
- Multi-language support (i18n)
- Conversation export (PDF/Markdown)
- Advanced model parameters UI
- Analytics dashboard
- Offline support (PWA)
- Desktop app (Electron)
- Vercel AI SDK: https://sdk.vercel.ai
- HuggingFace: https://huggingface.co
- Supabase: https://supabase.com
- Clerk: https://clerk.com
- Next.js: https://nextjs.org
This project is for demonstration purposes. Ensure compliance with all third-party API terms of service.
For issues, questions, or feature requests:
- Open a GitHub Issue
- Check documentation in
/docs - Review architecture in
docs/ARCHITECTURE.md - Follow deployment guide in
docs/DEPLOYMENT.md
Built with Next.js, Vercel AI SDK, Supabase, and 100+ AI models via HuggingFace Router.