A modern, AI-powered code editor designed for learning web development. Coder provides an intuitive environment where beginners can write HTML, CSS, and JavaScript with real-time preview and intelligent AI assistance.
- Multi-language Support: Write and edit HTML, CSS, and JavaScript in separate tabs with syntax highlighting
- Live Preview: See your changes instantly with embedded preview and WebSocket live reload
- AI Assistant: Get coding help, suggestions, and explanations from an intelligent AI with context-aware recommendations
- Code Context Menu: Right-click on any code to get AI suggestions for debugging, explanations, improvements, or creative ideas
- Smart Code Merging: AI-powered code integration that intelligently merges suggestions without conflicts
- Real-time Collaboration: WebSocket-powered live updates across preview windows
- Dark/Light Mode: Toggle between themes for comfortable coding in any environment
- Download Projects: Export your complete project as a ZIP file with proper structure
- Persistent Storage: Your code is automatically saved in browser sessions
- Responsive Design: Optimized interface that works on desktop and mobile devices
- Code Suggestions: AI-generated recommendations based on your current project context
- Frontend: React 18, TypeScript, Tailwind CSS, Vite
- Backend: Express.js, Node.js, WebSocket (ws)
- AI Integration: External AI webhook for intelligent code assistance
- UI Components: Radix UI primitives with custom styling
- Syntax Highlighting: Prism.js with custom themes
- Code Processing: Advanced CSS merging and JavaScript execution
- File Generation: JSZip for project downloads
- Icons: Lucide React
- State Management: React hooks with session-based storage
- Node.js 20 or higher
- npm package manager
- Clone the repository:
git clone <your-repo-url>
cd coder
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open your browser and navigate to
http://localhost:5000
npm run dev
- Start development server with hot reloadnpm run build
- Build for production deploymentnpm run start
- Start production servernpm run check
- Run TypeScript type checkingnpm run db:push
- Push database schema changes (if using database features)
βββ client/ # Frontend React application
β βββ public/ # Static assets
β βββ src/
β β βββ components/ # React components
β β β βββ ui/ # Reusable UI components (Radix-based)
β β β βββ AiAssistant.tsx # AI chat and suggestions
β β β βββ CodeEditor.tsx # Main code editing interface
β β β βββ CodeContextMenu.tsx # Right-click context menu
β β β βββ SyntaxHighlighter.tsx # Code syntax highlighting
β β βββ pages/ # Page components
β β βββ hooks/ # Custom React hooks
β β βββ lib/ # Utility libraries
β β βββ utils/ # Helper functions (ZIP generation, etc.)
β β βββ config/ # Configuration constants
βββ server/ # Backend Express server
β βββ index.ts # Server entry point with WebSocket
β βββ routes.ts # API routes and preview generation
β βββ storage.ts # In-memory session storage
β βββ vite.ts # Vite development middleware
βββ shared/ # Shared TypeScript types and schemas
The main code editing interface featuring:
- Tabbed editing for HTML, CSS, and JavaScript
- Syntax highlighting with Prism.js
- Auto-save functionality
- Context menu integration for AI assistance
- Code folding and line numbers
Intelligent coding assistant providing:
- Interactive chat for coding questions
- Context-aware code suggestions based on current project
- Debugging assistance and error detection
- Code explanations and learning guidance
- Creative coding ideas and enhancements
Real-time preview with:
- WebSocket-powered live reload
- Automatic CSS and JavaScript injection
- Session-based code storage
- Embedded preview windows
- Error handling and console integration
Right-click functionality offering:
- Debug this: Find and fix code issues
- Explain this: Understand code functionality
- Is there a better way?: Get optimization suggestions
- Surprise me: Receive creative enhancement ideas
This project is fully optimized for Replit deployment:
- Import Repository: Create a new Repl by importing this repository
- Automatic Dependencies: Replit automatically detects Node.js and installs packages
- Port Configuration: Pre-configured to run on port 5000 (optimal for Replit)
- Run Button: Click Run to start the development server
- Click the Deploy button in your Repl
- Choose Autoscale deployment for web applications
- Configure deployment settings:
- Build command:
npm run build
- Run command:
npm run start
- Primary domain: Choose your desired URL
- Build command:
- Click Deploy to publish your application
The application works out of the box with these customizable options:
- AI Webhook URL: Configure in
client/src/config/constants.ts
- Port Settings: Default 5000 (optimized for Replit)
- Session Storage: In-memory storage (perfect for development)
- WebSocket Endpoints: Automatically configured for live preview
- Write Code: Use the HTML, CSS, and JS tabs to build your project
- Live Preview: Click "Live Preview" to see real-time results
- AI Assistance: Ask questions in the AI chat or right-click code for help
- Apply Suggestions: Use "Apply" buttons to integrate AI recommendations
- Download Project: Export as ZIP when ready to share or deploy
- Code Context: Right-click any code selection for contextual AI help
- Smart Merging: AI intelligently combines suggestions with existing code
- Theme Toggle: Switch between light and dark modes for comfort
- Session Persistence: Your work is automatically saved during sessions
- Beginner-Friendly: Starts with example code and guided interactions
- Progressive Learning: Build complexity gradually with AI guidance
- Real-time Feedback: Immediate visual feedback in live preview
- Interactive Explanations: AI explains concepts as you code
- Best Practices: Learn modern web development standards
- Error Prevention: AI helps catch and fix common mistakes
The application integrates with external AI services:
- Webhook Configuration: Set AI endpoint in constants file
- Context-Aware Requests: Sends current code context for better suggestions
- Response Processing: Intelligent parsing of AI recommendations
- Error Handling: Graceful fallbacks for AI service issues
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes with proper TypeScript types
- Test thoroughly in both development and production modes
- Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- TypeScript: Fully typed codebase with strict type checking
- ESLint: Code quality and style enforcement
- Hot Reload: Instant updates during development
- WebSocket: Real-time communication for live features
- Responsive: Mobile-first design principles
- Accessibility: ARIA compliance and keyboard navigation
MIT License - see LICENSE file for details
- AI Assistant: Built-in help for coding questions
- Documentation: Comprehensive code examples and guides
- Issues: Report bugs and request features in GitHub issues
- Replit Community: Share your projects in Replit's community
Happy Coding! π
Transform your web development journey with Coder - where intelligent assistance meets creative coding.