A modern, feature-rich online code editor built with React, Chakra UI, and Monaco Editor. Write, edit, and preview code directly in your browser with a VS Code-like experience.
Visit the live application: CodeCraft Pro
- Monaco Editor Integration: Full-featured code editor with IntelliSense, syntax highlighting, and auto-completion
- Multi-File Support: Create and manage multiple files and folders in a project structure
- File Explorer: VS Code-style file tree with drag-and-drop support
- Tab Management: Work with multiple files simultaneously using tabs
- Auto-Save: Automatic saving of files and project state to local storage
- Theme Support: Light and dark mode themes
- Real-Time Preview: Live HTML/CSS/JS preview in an isolated iframe
- Console Output: Integrated console for viewing JavaScript logs and errors
- Developer Tools: Built-in developer tools with console, output, and terminal views
- Rocket Mode: Turbo execution mode for faster code processing
- Project Templates: Pre-built HTML and JavaScript project templates
- Import/Export: Import existing projects or export your work
- File Operations: Create, rename, delete files and folders
- Smart Language Detection: Automatic programming language detection based on file extension
- Developer Tools Mode: Bundle and preview code locally using blob URLs
- Console/Preview Toggle: Switch between console output and live preview
- Responsive Preview: Test your web apps in different device sizes
- Fullscreen Mode: Distraction-free coding experience
- Frontend Framework: React 19
- UI Library: Chakra UI v2
- Code Editor: Monaco Editor (VS Code's editor)
- Icons: React Icons
- Animations: Framer Motion
- Build Tool: Vite
- Package Manager: Yarn
- State Management: React Hooks
- File System: Custom virtual file system implementation
- Clone the repository:
git clone https://github.com/tanishraj/online_code_editor.git
cd online_code_editor- Install dependencies using Yarn:
yarn install- Start the development server:
yarn dev- Open your browser and navigate to:
http://localhost:5173
yarn dev- Start development serveryarn build- Build for productionyarn preview- Preview production buildyarn lint- Run ESLint
online_code_editor/
├── src/
│ ├── api/ # API integration
│ ├── components/ # React components
│ │ ├── ModernOutput.jsx # Console and output panel
│ │ ├── PreviewMode.jsx # Live preview component
│ │ ├── ProjectEditor.jsx # Main editor component
│ │ └── StackBlitzExplorer.jsx # File explorer
│ ├── hooks/ # Custom React hooks
│ ├── styles/ # CSS and styling
│ ├── theme/ # Chakra UI theme configuration
│ ├── utils/ # Utility functions
│ │ ├── fileSystem.js # Virtual file system
│ │ └── storage.js # Local storage management
│ ├── App.jsx # Main app component
│ └── main.jsx # App entry point
├── public/ # Static assets
├── package.json # Dependencies and scripts
└── vite.config.js # Vite configuration
Create a .env file in the root directory:
VITE_API_URL=your_api_url_hereFor the best development experience, install these VS Code extensions:
- ESLint
- Prettier
- ES7+ React/Redux/React-Native snippets
- Click on the file explorer
- Right-click to create new files/folders
- Start coding in the editor
- Click "HTML Template" for a basic HTML/CSS/JS project
- Click "JavaScript" for JavaScript snippets
- Click "Run Code" to execute JavaScript
- Use "Preview" mode for HTML/CSS/JS projects
- Toggle between Console and Preview views
Ctrl/Cmd + S- Save file (auto-save is enabled)Ctrl/Cmd + Enter- Run codeCtrl/Cmd + /- Toggle commentCtrl/Cmd + F- FindCtrl/Cmd + H- Replace
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Large bundle size (739KB) - consider implementing code splitting
- Preview mode requires HTML files in the project
This project is licensed under the MIT License - see the LICENSE file for details.
Tanish Raj
- GitHub: @tanishraj
- Monaco Editor team for the amazing code editor
- Chakra UI team for the beautiful component library
- React team for the powerful framework
- All contributors and users of this project
- ✅ Core editor functionality
- ✅ File management system
- ✅ Live preview
- ✅ Console integration
- ✅ Theme support
- ✅ Auto-save
- 🔄 Code execution API integration (in progress)
- 📋 Collaborative editing (planned)
- 📋 Cloud storage (planned)
Made with ❤️ by Tanish Raj