Skip to content

MiloudiES/Code-Editor

Repository files navigation

Code-Editor

This project is a lightweight, web-based code editor built using React.js. It allows users to write and edit code in various programming languages (e.g., JavaScript, Python, HTML) with syntax highlighting and theme customization. The editor includes a toolbar for basic actions like running and saving code. Users can also switch between light and dark themes for a personalized experience. The project leverages libraries like monaco-editor for the editor functionality and localStorage for saving code snippets locally. It’s a great starting point for building more advanced features like code execution, collaboration, or integration with a backend service.

React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend using TypeScript and enable type-aware lint rules. Check out the TS template to integrate TypeScript and typescript-eslint in your project.

master =======

Code Editor

This project is a lightweight, web-based code editor built using React.js and Vite. It allows users to write and edit code in various programming languages (e.g., JavaScript, Python, HTML) with syntax highlighting and theme customization. The editor includes a toolbar for basic actions like running and saving code. Users can also switch between light and dark themes for a personalized experience. The project leverages libraries like monaco-editor for the editor functionality and localStorage for saving code snippets locally. It’s a great starting point for building more advanced features like code execution, collaboration, or integration with a backend service.


Features

  • Code Editing: Write and edit code in multiple languages with syntax highlighting.
  • Themes: Switch between light and dark themes.
  • Toolbar: Perform actions like running and saving code.
  • Local Storage: Save and load code snippets locally.
  • Lightweight: Built with React and Vite for fast performance.

Technologies Used

  • React.js: A JavaScript library for building user interfaces.
  • Vite: A fast build tool for modern web development.
  • Monaco Editor: A powerful code editor used in VS Code.
  • LocalStorage: For saving and loading code snippets.

Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/code-editor.git
    cd code-editor
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev
  4. Open your browser and navigate to http://localhost:5173.


Project Structure

code-editor/
├── src/
│   ├── components/        # React components (e.g., CodeEditor, Toolbar)
│   ├── App.jsx           # Main application component
│   ├── main.jsx          # Entry point
│   ├── styles.css        # Global styles
├── public/               # Static assets
├── package.json          # Project dependencies
├── vite.config.js        # Vite configuration

Available Scripts

  • npm run dev: Start the development server.
  • npm run build: Build the project for production.
  • npm run lint: Run ESLint to check for code issues.
  • npm run preview: Preview the production build locally.

Customizing the Editor

Adding Languages

The editor supports multiple languages out of the box. To add more, configure the monaco-editor settings in your CodeEditor component.

Changing Themes

Use the monaco-themes library to add more themes or customize existing ones.

Adding Features

  • Code Execution: Integrate a library like js-interpreter for JavaScript or build a backend service for other languages.
  • Collaboration: Use WebSockets or a service like Firebase for real-time collaboration.

Contributing

Contributions are welcome! If you'd like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Acknowledgments

  • Monaco Editor for the powerful editor functionality.
  • Vite for the fast development setup.
  • React for building the user interface.

This README provides a clear overview of your project, its features, and how to get started. Let me know if you'd like to add or modify anything! 😊

45aa3cb8b02e237e2a5b6f61e5e9dabfc579c3af

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published