A web-based code compiler that supports multiple programming languages, built using Next.js, TypeScript, ShadCN, and Monaco Editor.
Write, compile, and execute code in multiple languages, all from your browser!
- Multi-Language Support – Compile C, C++, JavaScript, Python, and more!
- Real-time Code Execution – Execute code instantly with API-powered execution.
- Dark/Light Mode – Theme toggling using ShadCN.
- Monaco Editor – A powerful code editor with syntax highlighting & autocomplete.
- Code Templates – Auto-loads default "Hello, World!" programs for different languages.
- Mobile-Friendly – Fully responsive UI for different screen sizes.
- Frontend: Next.js, TypeScript, Tailwind CSS, ShadCN, Monaco Editor
- Backend: Next.js API Routes
- Deployement: Vercel
- Code Execution API: Piston API
git clone https://github.com/DevFreAkeD/CoDevCompile-2.0.git
cd CoDevCompile-2.0
npm install
# or
yarn install
npm run dev
# or
yarn dev
Now open http://localhost:3000 in your browser. 🎉
POST /api/compile
Request Body (JSON)
{
"code": "#include <stdio.h>\nint main() { printf(\"Hello, World!\"); return 0; }",
"language": "c",
"input": ""
}
Response
{
"stdout": "Hello, World!",
"stderr": "",
"code": 0,
"signal": null,
"output": "Hello, World!"
}
- Header: Contains the "Execute" button and dark mode toggle.
- Sidebar: Allows selecting different languages.
- Code Editor: Monaco Editor with syntax highlighting.
- Input/Output Panels: Displays input fields and execution results.
/app
├── /api
│ ├── /compile/route.ts # API Route for executing code
├── /components
│ ├── CodeEditor.tsx # Monaco-based code editor
│ ├── Sidebar.tsx # Language selection sidebar
│ ├── Header.tsx # Navbar with execute button
├── /context
│ ├── CodeContext.tsx # Manages code execution state
├── /lib
│ ├── constants.ts # Stores default "Hello World" templates
├── /public # Language icons
│ ├── c.svg
│ ├── cpp.svg
├── package.json
├── README.md
Contributions are welcome! To contribute:
- Fork this repo.
- Create a feature branch (
git checkout -b feature-name
). - Commit your changes (
git commit -m "Add feature"
). - Push the branch (
git push origin feature-name
). - Open a Pull Request! 🎉
This project is open-source and available under the MIT License.
Link: https://codevcompile.vercel.app
If you find this project useful, consider sponsor me to support development.
🚀 Built with ❤️ by DevFreAkeD
🔗 Need help? Feel free to open an issue!