A collaborative real-time code editor that enables multiple users to code together simultaneously.
- Real-time Collaboration: Multi-user editing with live cursor tracking
- Multi-language Support: Syntax highlighting for various programming languages
- Code Execution: Run and test code directly in the browser
- Integrated Chat: Built-in team communication
- Drawing Board: Collaborative whiteboard for brainstorming
- Room-based Sessions: Create/join coding rooms with unique IDs
- User Presence: See who's online and active
- Modern UI: Responsive interface with NextUI and Tailwind CSS
Frontend: React 18, Vite, Socket.IO Client, Monaco Editor, NextUI, Tailwind CSS, Framer Motion, React Router, Excalidraw
Backend: Node.js, Express.js, Socket.IO, Redis, Redis Streams Adapter
Before running this project, make sure you have the following installed:
- Node.js (v16 or higher) - Download
- npm or yarn - Package manager
- Redis - Installation Guide
- Git - Version control
git clone https://github.com/siddxharth1/real-time-code-editor.git
cd real-time-code-editor
# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
PORT=3000
REDIS_URL="redis://default:your_redis_password@localhost:6379"
Note: Update the Redis URL with your actual Redis configuration. If you're running Redis locally without authentication, you can use:
REDIS_URL="redis://localhost:6379"
# Navigate to frontend directory (from project root)
cd frontend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
Edit the .env
file in the frontend directory:
VITE_BACKEND_URL="http://localhost:3000"
On Windows:
- Download Redis from Redis Windows releases
- Install and start the Redis server
- Default runs on
localhost:6379
On macOS:
# Using Homebrew
brew install redis
brew services start redis
On Linux (Ubuntu/Debian):
sudo apt update
sudo apt install redis-server
sudo systemctl start redis
sudo systemctl enable redis
# Run Redis in Docker
docker run -d --name redis-server -p 6379:6379 redis:latest
# Or with authentication
docker run -d --name redis-server -p 6379:6379 redis:latest redis-server --requirepass yourpassword
- Redis Cloud (free tier available) https://redis.io/try-free/
Make sure Redis is running.
cd backend
npm run dev
The backend server will start on http://localhost:3000
cd frontend
npm run dev
The frontend will start on http://localhost:5173
cd backend
npm start
cd frontend
npm run build
npm run preview
-
Access the Application: Open your browser and navigate to
http://localhost:5173
-
Create a Room:
- Click on "Create Room" to generate a new coding session
- Share the room ID with your collaborators
-
Join a Room:
- Enter an existing room ID to join a collaborative session
- Provide your username to identify yourself
-
Start Coding:
- Select your preferred programming language
- Start coding with real-time collaboration
- Use the integrated chat for communication
- Access the drawing board for brainstorming
We welcome contributions! Please follow these steps:
- Check Existing Issues: Browse through existing issues to avoid duplicating work
- Create an Issue: Before starting any work, create an issue describing:
- The feature you want to add
- The bug you want to fix
- The improvement you want to make
- Wait for Assignment: Don't start working until a maintainer assigns the issue to you
- Discuss: Use the issue comments to discuss implementation details
- Fork the repository
- Create a feature branch:
git checkout -b feature/issue-number-description
- Commit your changes:
git commit -m 'Fix #123: Add amazing feature'
- Push to the branch:
git push origin feature/issue-number-description
- Open a Pull Request referencing the issue
- Follow the existing code style
- Add comments for complex logic
- Test your changes thoroughly
- Update documentation if needed
- Reference the issue number in your commits and PR
- Ensure builds pass: Run
npm run build
in both frontend & backend directories
- Monaco Editor - VS Code editor component
- Socket.IO - Real-time communication
- NextUI - Modern React UI library
- Excalidraw - Collaborative drawing tool
- Redis - In-memory data store
Happy Coding! 🚀