Welcome to CollabCode, a real-time collaborative code editor that allows multiple users to join a room and code together simultaneously. This application is perfect for pair programming, technical interviews, and teaching, providing a seamless and intuitive coding experience.

- Real-Time Collaboration: Code with multiple users in the same room, with changes appearing instantly for everyone.
- Live Chat: Communicate with your collaborators directly in the application with a built-in chatbox.
- Code Execution: Run your code directly in the editor and see the output in real-time for various languages (C++, Java, Python, JavaScript, etc.).
- Active User Avatars: See who is currently in the room and who is actively coding.
- Simple Room Management: Create a room with a single click and share the unique Room ID to invite others.
- Notifications: Get real-time toast notifications when users join or leave the room.
This project is built with a modern tech stack, ensuring a fast and reliable experience.
Frontend:
- React.js: For building the user interface.
- Socket.IO Client: To manage the real-time WebSocket connection.
- React Ace: A powerful code editor component for React.
- Axios: For making API requests to the code execution endpoint.
- React Hot Toast: For user-friendly notifications.
Backend:
- Node.js & Express.js: To build the server-side logic.
- Socket.IO: For enabling real-time, bidirectional communication.
- Nodemon: To automatically restart the server during development.
Services:
- Judge0: A robust API for securely executing code in multiple languages.
- UUID: For generating unique and random Room IDs.
To get a local copy up and running, follow these simple steps.
Make sure you have Node.js and npm installed on your machine.
-
Clone the repository:
git clone [https://github.com/your-username/CollabCode.git](https://github.com/your-username/CollabCode.git) cd CollabCode -
Set up the server:
- Navigate to the server directory.
cd server - Install the necessary packages.
npm install
- Create a
.envfile in theserverdirectory and add your Judge0 API key. You can get a free key from RapidAPI.# server/.env JUDGE0_API_KEY=YOUR_API_KEY_HERE
- Navigate to the server directory.
-
Set up the client:
- Navigate to the client directory from the root folder.
cd ../client - Install the necessary packages.
npm install
- Navigate to the client directory from the root folder.
You'll need two terminals open to run both the client and the server.
-
In your first terminal, start the server:
- Make sure you are in the
serverdirectory.npm run server
- Your server should now be running on
http://localhost:5001.
- Make sure you are in the
-
In your second terminal, start the client:
- Make sure you are in the
clientdirectory.npm start
- Your application will automatically open in your browser at
http://localhost:3000.
- Make sure you are in the
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request