Code editor created for community .
This project is an advanced Code Editor and Compiler platform designed specifically for students to write, compile, and run code in multiple programming languagesβall within a single, unified web application. It provides a seamless and interactive experience, empowering learners to experiment and practice coding in an efficient environment.
A comprehensive web-based code editor and compiler that supports multiple programming languages in a single platform. This project provides students and developers with an integrated development environment (IDE) for writing, editing, and executing code across various programming languages.
The platform is built using modern web technologies including React, Vite, and Tailwind CSS to ensure a fast, responsive, and visually appealing user interface. It leverages an external compilation API service (requiring an API key) to compile and execute code securely in the cloud.`
-
Multi-language Support: Supports 40+ programming languages including:
- JavaScript, TypeScript, Python, Java, C/C++
- Go, Rust, Swift, Kotlin, Ruby, PHP
- Assembly, Bash, Haskell, Scala, SQL, and many more
- Compile and run code from a wide range of programming languages.
-
Monaco Editor Integration: Professional code editing experience with:
- Syntax highlighting
- Auto-completion
- Error detection
- Dark theme interface
- Minimap navigation
- User-friendly, syntax-highlighted editor to write and edit code.
-
Real-time Code Execution: Execute code directly in the browser with:
- Live output display
- Error handling and display
- Execution status tracking
- Base64 encoding for secure transmission
-
Responsive Design: Modern, dark-themed UI built with Tailwind CSS
-
Keyboard Shortcuts: Ctrl+Enter to run code quickly
-
Resizable Panels: Adjustable editor and output panel sizes
-
Language Switching: Easy language selection with version information
-
Code Snippets: Access to a library of code snippets for common tasks
-
Cloud Compilation: Code is sent to a secure API to compile and run, handling backend complexities.
-
Fast and Responsive UI: Built using React with Vite and styled using Tailwind CSS for modern, responsive design.
-
API Key Based Access: Secure access to the compilation API with a user-provided API key.
- Frontend Framework: React 19.1.0
- Build Tool: Vite 6.3.5
- Styling: Tailwind CSS 3.4.17
- Code Editor: Monaco Editor (@monaco-editor/react)
- HTTP Client: Axios 1.9.0
- Code Execution API: Judge0 CE via RapidAPI
- Language: JavaScript/JSX
- Package Manager: npm
- Node.js (version 14 or above)
- npm or yarn package manager
- API key for the code compilation service (you must register on the API provider's platform to obtain this)
-
Clone the repository
git clone <repository-url> cd tech_compiler
-
Install dependencies
npm install
-
Configure API Key
- Sign up for RapidAPI and subscribe to Judge0 CE
- Replace the API key in
src/components/api.js
:
"X-RapidAPI-Key": "YOUR_API_KEY_HERE"
-
Start the development server
npm run dev
-
Open your browser
- Navigate to
http://localhost:5173
- Navigate to
code-editor/
βββ public/
βββ src/
β βββ components/
β β βββ CompilerLandingPage.jsx # Main editor component
β β βββ CodeEditorWindow.jsx # Monaco editor wrapper
β β βββ LanguageSelector.jsx # Language dropdown
β β βββ Output.jsx # Output display component
β β βββ api.js # API integration
β β βββ constant.js # Language configurations
β βββ hooks/
β β βββ keyPress.js # Custom hook for keyboard shortcuts
β βββ App.jsx # Root component
β βββ main.jsx # Entry point
β βββ index.css # Global styles
βββ package.json
βββ vite.config.js
βββ README.md
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run lint
- Run ESLint for code quality
This project uses Judge0 CE API through RapidAPI for code execution:
- Submission Endpoint: Creates code execution jobs
- Status Endpoint: Checks execution status and retrieves results
- Base64 Encoding: Ensures secure code transmission
- Polling Mechanism: Handles asynchronous execution
- JavaScript (Node.js): 63
- Python 3: 71
- Java (OpenJDK): 62
- C++ (GCC): 54
- C (GCC): 50
- And 35+ more languages...
- Select Language: Choose from the dropdown menu (40+ languages available)
- Write Code: Use the Monaco editor with syntax highlighting
- Execute Code: Click "Run Code" or press Ctrl+Enter
- View Output: Results appear in the bottom panel
- Resize Panels: Drag the divider to adjust editor/output sizes
- Handle Errors: Error messages are displayed with red highlighting
- Main container component
- Manages editor state and execution
- Handles resizing functionality
- Integrates all sub-components
- Monaco editor wrapper
- Provides syntax highlighting
- Manages editor configuration
- Handles code snippets
- Dropdown for language selection
- Displays language versions
- Updates editor configuration
- Displays execution results
- Handles error formatting
- Provides output scrolling
- Toggle visibility
- Judge0 CE API integration
- Handles code submission
- Manages execution polling
- Error handling
npm run build
- Connect your GitHub repository
- Set build command:
npm run build
- Set publish directory:
dist
- Deploy automatically
For production deployment, consider using environment variables for the API key:
const API_KEY = import.meta.env.VITE_RAPIDAPI_KEY || "your-fallback-key";
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- File upload/download functionality
- User authentication and code saving
- Collaborative editing features
- Additional language support
- Custom themes and fonts
- Code sharing functionality
- Performance optimizations
- Mobile responsiveness improvements
- API rate limiting may occur with frequent requests
- Some languages may have longer execution times
- Large output may affect performance
This project is licensed under the MIT License - see the LICENSE file for details.
[ VISHAL & SHAILENDRA ]
- GitHub: Vishal,Shailendra Singh Panwar
- Email: [email protected] , [email protected]
- LinkedIn: Vishal Choudhary,shailendrasingh189.
- Judge0 CE for providing the code execution API
- Monaco Editor team for the excellent code editor
- React and Vite communities for the amazing tools
- Tailwind CSS for the utility-first CSS framework