Skip to content

AdityaPatil1510/Online-Code-Editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Online Code Editor

A simple online code editor that allows users to write and execute JavaScript code directly in the browser.

This project demonstrates full-stack integration using React and Node.js, with clean API design and proper error handling.


Features

  • Write JavaScript code in browser
  • Execute code using backend API
  • Display output and runtime errors
  • Clean and minimal UI
  • Separate frontend and backend structure

Tech Stack

Frontend:

  • React
  • JavaScript
  • Fetch API

Backend:

  • Node.js
  • Express.js
  • child_process

Project Structure

online-code-editor

  • client (React frontend)
  • server (Node.js backend)
  • README.md

How to Run the Project

1. Start Backend

  • Go to server folder
  • Install dependencies
  • Run server

Server runs on: http://localhost:5000

Health check: http://localhost:5000/health


2. Start Frontend

  • Go to client folder
  • Install dependencies
  • Start React app

Frontend runs on: http://localhost:3000


API Endpoint

POST /api/execute

Request body:

  • language: javascript
  • code: JavaScript code as string

Response:

  • output (string) on success
  • error (string) on failure

Limitations

  • Only JavaScript supported
  • No user authentication
  • No persistent storage
  • Execution time is limited

Future Improvements

  • Support multiple languages
  • Add code editor library
  • Improve UI/UX
  • Add sandboxing for better security

Author

Aditya Patil

About

Online Code Editor is a MERN-stack full-stack web application that enables users to write, execute, and test code directly in the browser using a React-based editor and Node.js backend APIs for secure code execution.

Topics

Resources

Stars

Watchers

Forks

Contributors