A real-time collaborative code editor with AI assistance, built with React, TypeScript, and Socket.IO. Create rooms, code together, execute code, and get AI-powered suggestions for your projects.
- Real-time Collaboration: Multiple developers can edit code simultaneously in shared rooms
- Multi-file Support: Create, edit, and delete files within your collaborative workspace
- Code Execution: Run code directly in the browser using the Piston API
- AI Code Assistant: Get intelligent code suggestions and help with debugging
- Multiple Language Support: JavaScript, Python, Java, C++, and more
- Monaco Editor: Full-featured code editor with syntax highlighting and IntelliSense
- Responsive Design: Works seamlessly across desktop and mobile devices
- React 18 with TypeScript
- Vite for fast development and building
- Monaco Editor for code editing
- Material-UI for UI components
- TailwindCSS for styling
- Socket.IO Client for real-time communication
- React Router for navigation
- Node.js with Express
- Socket.IO for real-time collaboration
- Google Generative AI for code assistance
- Axios for HTTP requests
- Node.js (v18 or higher)
- npm or bun package manager
- Clone the repository:
git clone <repository-url>
cd code-collab- Install frontend dependencies:
npm install
# or
bun install- Install server dependencies:
cd server
npm install
# or
bun install- Set up environment variables:
Create .env in the root directory:
VITE_BACKEND_URL=http://localhost:4000Create server/.env:
PORT=4000
GOOGLE_API_KEY=your_google_ai_api_key- Start the backend server:
cd server
npm start
# or
bun start- Start the frontend development server:
npm run dev
# or
bun run dev- Open your browser and navigate to
http://localhost:5173
- Create or Join a Room: Enter a room ID on the homepage to create or join a collaborative session
- Add Files: Click "Add File" to create new files with different extensions
- Code Together: Start coding - changes are synchronized in real-time across all participants
- Execute Code: Click "Run code" to execute your code and see output in the console
- Get AI Help: Use the chat panel to ask questions about your code and get AI-powered suggestions
- JavaScript (.js)
- TypeScript (.ts)
- Python (.py)
- Java (.java)
- C++ (.cpp)
- C (.c)
- Go (.go)
- Rust (.rs)
- And many more...
npm run dev # Start development server
npm run build # Build for production
npm run lint # Run linting
npm run format # Format code with Biome
npm run preview # Preview production buildnpm start # Start server with nodemon
npm run build # Run server in production modeThe application is configured for deployment on:
- Frontend: Netlify or Vercel (configuration files included)
- Backend: Any Node.js hosting platform
Make sure to set the following environment variables:
VITE_BACKEND_URL: Your backend server URLGOOGLE_API_KEY: Google Generative AI API keyPORT: Server port (default: 4000)
├── src/
│ ├── components/ # Reusable UI components
│ ├── Chatbot/ # AI chat functionality
│ ├── utils/ # Utility functions
│ └── assets/ # Static assets
├── server/
│ ├── helpers/ # Server utilities
│ └── index.js # Main server file
└── public/ # Static files
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.