CodeSync is a real-time collaborative code editor designed for developers to work together on projects seamlessly. With a modern, intuitive interface, it offers features like live code editing, multi-file support, and integrated chat. The application is built with the MERN stack, leveraging Socket.IO for real-time communication and Render for hosting.
- Real-time Collaboration: Synchronized code editing for all users in a room.
- Multi-file Support: Create, delete, and switch between multiple code files within a single room.
- Integrated Chat: Real-time room chat with history persistence.
- Online User Presence: See who's currently in your room.
- Code Execution: Run your code instantly in Node.js, Python, Java, C, and C++ through the JDoodle API.
- Secure Authentication: Email/password authentication using JSON Web Tokens (JWT).
- Scalable Real-time Engine: Designed to handle 1k+ concurrent users with a scalable Socket.IO architecture.
- Persistence: Code and chat history are saved in MongoDB Atlas for reliability.
- Modular Backend: Clear separation of concerns with dedicated controllers and services.
- Cost-effective Hosting: Deployed on Render to ensure a low-cost, scalable solution.
- React 18: Frontend UI library.
- Monaco Editor: The powerful code editor component.
- Socket.IO-Client: For real-time WebSocket communication.
- Axios: HTTP client for API requests.
- React Router v6: For client-side routing.
- React-Bootstrap: Responsive UI components.
- Node.js & Express.js: Backend web server.
- Socket.IO: Real-time engine for event-driven communication.
- Mongoose: MongoDB object modeling.
- bcryptjs: Password hashing.
- jsonwebtoken: For JWT authentication.
- cors: To manage Cross-Origin Resource Sharing.
- MongoDB Atlas: A cloud-hosted NoSQL database service.
- JDoodle: For multi-language code execution.
- Render: Cloud platform for hosting the backend and frontend.
codesync/
βββ client/ # React Frontend
β βββ src/
β β βββ components/
β β β βββ CodeEditor.jsx
β β β βββ Chat.jsx
β β β βββ FileTabs.jsx
β β β βββ OnlineUsers.jsx
β β βββ context/
β β β βββ AuthContext.js
β β β βββ SocketContext.js
β β βββ pages/
β β β βββ Dashboard.jsx
β β β βββ Room.jsx
β β β βββ Login.jsx
β β β βββ Signup.jsx
β β βββ services/
β β β βββ api.js
β β βββ App.jsx
βββ server/ # Node.js Backend
β βββ models/
β β βββ User.js
β β βββ Room.js
β β βββ Chat.js
β βββ routes/
β β βββ auth.js
β β βββ rooms.js
β βββ controllers/
β β βββ authController.js
β β βββ roomController.js
β β βββ jDoodleService.js
β βββ middleware/
β β βββ auth.js
β βββ index.js # Main server entry point
βββ package.json
βββ README.md