需在 client 和 server 目录分别创建 .env,前端要填 VITE_BACKEND_URL 和 VITE_PISTON_API_URL,后端设 PORT=3000;代码执行依赖自备的 Piston API 实例,未配置则无法运行代码;前端默认访问 http://localhost:5173/,后端默认 3000 端口,需保证两者地址对应
Code-Sync
sahilataharMIT更新放缓基于 MERN 的实时协作代码编辑器,支持生成独立房间、语法高亮和自动补全,多人可同时编辑、保存、下载文件并通过群聊沟通。
A real-time collaborative code editor featuring unique room generation, syntax highlighting, and auto-suggestions. Users can seamlessly edit, save, and download files while communicating through group chat
git clone https://github.com/<your-username>/Code-Sync.git
npm install # Run in both client and server directories
cd client && npm run dev
cd server && npm run devREADME 未说明硬件要求;前后端均为 Node.js 服务,本地运行需 Node 环境,代码执行依赖外部 Piston API 实例
基于房间的实时协作代码编辑器,多人同时编辑、运行代码并群聊
基于 MERN 的实时协作代码编辑器,支持生成独立房间、语法高亮和自动补全,多人可同时编辑、保存、下载文件并通过群聊沟通。
核心能力
- 用唯一房间 ID 让多人实时同步编辑多个文件
- 支持文件与文件夹的创建、打开、保存、删除和整理
- 内置代码执行,可直接在协作环境中运行代码
- 提供语法高亮、自动语言检测和按语言自动补全
- 集成实时群聊、在线状态列表和协同画板
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
A collaborative, real-time code editor where users can seamlessly code together. It provides a platform for multiple users to enter a room, share a unique room ID, and collaborate on code simultaneously.
🔮 Features
- 💻 Real-time collaboration on code editing across multiple files
- 📁 Create, open, edit, save, delete, and organize files and folders
- 💾 Option to download the entire codebase as a zip file
- 🚀 Unique room generation with room ID for collaboration
- 🌍 Comprehensive language support for versatile programming
- 🌈 Syntax highlighting for various file types with auto-language detection
- 🚀 Code Execution: Users can execute the code directly within the collaboration environment
- ⏱️ Instant updates and synchronization of code changes across all files and folders
- 📣 Notifications for user join and leave events
- 👥 User presence list with online/offline status indicators
- 💬 Real-time group chatting functionality
- 🎩 Real-time tooltip displaying users currently editing.
- 🖊 Showing real-time selection of what each user has currently selected.
- 💡 Auto-suggestion based on programming language
- 🔠 Option to change font size and font family
- 🎨 Multiple themes for personalized coding experience
- 🎨 Collaborative Drawing: Enable users to draw and sketch collaboratively in real-time
- 🤖 Copilot: An AI-powered assistant that generates code, allowing you to insert, copy, or replace content seamlessly within your files.
🚀 Live Preview
You can view the live preview of the project here.
💻 Tech Stack
⚙️ Installation
Method 1: Manual Installation
-
Fork this repository: Click the Fork button located in the top-right corner of this page.
-
Clone the repository:
git clone https://github.com/<your-username>/Code-Sync.git -
Create .env file: Inside the client and server directories create
.envand set:Frontend:
VITE_BACKEND_URL=<your_server_url> VITE_PISTON_API_URL=<your_piston_instance_api_url>Backend:
PORT=3000 -
Install dependencies:
npm install # Run in both client and server directories -
Start the servers: Frontend:
cd client npm run devBackend:
cd server npm run dev -
Access the application:
http://localhost:5173/
🎥 Need help with the setup?
👉 Watch this video for a step-by-step guide.
Method 2: Docker Installation
-
Install Docker Desktop:
- Download and install Docker Desktop from Docker’s official website.
- Verify installation:
docker --version
-
Pull Docker Images:
# Pull Backend Image docker pull sahilatahar/code-sync-server:latest # Pull Frontend Image docker pull sahilatahar/code-sync-client:latest -
Run Docker Containers:
# Run Backend Container (Port 3000) docker run -d -p 3000:3000 --name code-sync-server sahilatahar/code-sync-server:latest # Run Frontend Container (Port 5173) docker run -d -p 5173:5173 --name code-sync-client sahilatahar/code-sync-client:latest -
Access the application:
http://localhost:5173/
🔮 Features for Next Release
- Admin Permission: Implement an admin permission system to manage user access levels and control over certain platform features.
🤝 Contribute
We welcome contributions to make Code Sync even better! Follow the contribution guidelines to get started.
🌟 Support Us
If you find this helpful or valuable, please consider 🌟 starring the repository. It helps us gain visibility and encourages further development.
🧾 License
This project is licensed under the MIT License.
🌟 Appreciation for Resources
Special thanks to:
-
EMKC for providing the Piston API:
-
Tldraw contributors:
-
Pollinations AI: