Skip to content

Latest commit

Β 

History

History
122 lines (79 loc) Β· 2.65 KB

File metadata and controls

122 lines (79 loc) Β· 2.65 KB

CodeSandbox

A real‑time collaborative coding environment inspired by Project Idx, enabling multiple users to edit and execute code together seamlessly.


🧩 Features

  • Real‑Time Collaboration: Join or create rooms for live coding sessions with multiple users.
  • Integrated File System: Manage project files and directories within a tree structure.
  • WebSocket‑Powered Rooms: Low-latency updates and synchronization across participants.
  • Containerized Code Execution: Isolated, secure execution of user code using Docker containers.

πŸ“¦ Tech Stack

  • Backend: Node.js, Express.js, WebSockets
  • Frontend: React, Monaco Editor, React Query (Queries & Mutations)
  • Database: MongoDB
  • Containerization: Docker
  • CLI Tools: Exterm for terminal emulation

πŸš€ Getting Started

Prerequisites

Installation

  1. Install dependencies

    npm install
  2. Environment Variables

    Create a .env file in the root directory and set the following:

    MONGODB_URI=<your-mongo-connection-string>
    PORT=4000
  3. Start MongoDB

    # If running locally
    mongod --dbpath /path/to/your/db
  4. Start Docker daemon Ensure Docker is running before launching the app.

Running the App

  • Development mode

    npm run dev

    Runs both backend and frontend with hot-reloading.

  • Production mode

    npm start

The backend will be available at http://localhost:4000 and the frontend at http://localhost:3000 by default.


πŸ“‚ Project Structure

β”œβ”€β”€ client/           # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   └── public/
β”œβ”€β”€ server/           # Express backend
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   └── index.js
β”œβ”€β”€ docker/           # Docker configuration and scripts
β”œβ”€β”€ .env.example
└── README.md

🀝 Contributing

Contributions, issues, and feature requests are welcome! Please check issues and follow these steps:

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

πŸ“„ License

MIT


πŸ”— Links