How rohit-sharma-1802/codesync works
Project type and purpose
• This is a full-stack, real-time collaborative coding environment with an integrated whiteboard.
• The frontend is a React/Vite single-page application using Tailwind CSS for styling, organized into reusable components, contexts, hooks, and pages.
• The backend is a Node.js/Express server that leverages Socket.io for bidirectional real-time communication and calls out to the Piston API for code execution.
File structure
• Top level:
• client/ – React code (App.jsx, pages, components, contexts, hooks, API wrappers, socket client).
• server/ – Node.js/Express entrypoint (server.js) and utility functions (utils/actions.js).
• The client/src/api/index.jsx suggests REST calls (e.g. file save/download).
• The client/src/socket/socket.js and server.js indicate Socket.io as the real-time layer.
• No persistent database directory—file operations appear ephemeral or in-memory (could be extended to a DB later).
• Deployment configs (vercel.json, vite.config.js) show Vercel/Vite usage.
README for additional insights
• Real-time features: code sync, chat, drawing, user presence, tooltips, auto-suggest.
• Code execution via Piston API, drawing via Tldraw.
• Tech stack badges confirm React, Express, Socket.io, Node.js, Tailwind.
Essential architectural elements
• Socket.io “Room” abstraction in the server and how clients join it.
• Dual-channel communication: real-time socket vs. request/response REST.
• High-level UI flows (e.g., user types code → event → broadcast → UI update).
• Code execution request path: UI → server → Piston → server → UI.