CodeSync is a collaborative coding room app focused on real-time pair programming, room-based problem solving, and protected workspace navigation. The current implementation emphasizes the collaborative experience: authentication, room creation, live editor sync, and challenge browsing are the core features that are working in this build.
The app currently lets users:
- sign up and log in securely
- access protected pages only when authenticated
- create rooms or join them with a unique room code
- collaborate inside a shared coding workspace
- see live updates when teammates type in the same room
- browse coding problems and assign a challenge to a room
- move between dashboard, problem pages, and room pages without breaking access rules
This version is built as a collaborative coding experience, not as a fully implemented online judge or automated testcase runner.
- Frontend: React + Vite
- Routing: React Router
- UI: custom responsive styling
- Backend: Node.js + Express
- Real-time sync: Socket.IO
- Database: PostgreSQL + Prisma ORM
- Authentication: JWT + bcrypt
- User registration and login flows
- JWT-based authentication checks
- Protected routes for dashboard, problems, and room content
- Current user retrieval via authenticated requests
- Create a room with a custom name
- Join an existing room using a room code
- View participants inside the room
- See room details and join state from the dashboard
- Real-time room join handling
- Shared code synchronization across connected clients
- Shared language updates in the active workspace
- Live editor updates visible across tabs and users in the same room
- Browse available challenges
- Open a challenge detail page
- Assign a selected problem to a room
- View examples, description, constraints, and expected format
- Login and registration pages are public
- Dashboard, problems, and room pages are protected
- Unauthorized users are redirected away from protected areas
CodeSync/
├── client/ # React frontend
│ ├── src/
│ ├── public/
│ ├── package.json
│ ├── vite.config.js
│
├── server/ # Express API + Prisma + database layer
│ ├── src/
│ ├── prisma/
│ ├── .env.example
│ ├── package.json
│
├── README.md
└── .gitignore
The client app handles:
- authentication pages
- dashboard flow
- room creation and joining
- challenge browsing and details
- Monaco-based editor usage
- real-time Socket.IO communication
The server exposes REST endpoints for:
- authentication routes
- room creation and room lookup
- challenge retrieval
- real-time room behavior through Socket.IO
Prisma models support:
- users
- rooms
- participants
- problems
- submissions
Before running the app, make sure you have:
- Node.js 20+
- npm
- PostgreSQL running locally
git clone https://github.com/codesketch11/CodeSync
cd CodeSynccd client
npm install
cd ../server
npm installCreate a local environment file in the server folder:
cd server
copy .env.example .envThen update the values in .env:
DATABASE_URL="postgresql://USER:PASSWORD@localhost:5432/codesync"
JWT_SECRET="replace-with-a-long-random-secret"
PORT=5000Make sure your PostgreSQL database is running and that the database name matches the value in DATABASE_URL.
cd server
npx prisma migrate deployIf needed, generate the Prisma client:
npx prisma generatecd server
npm run devThe API will run on:
http://localhost:5000
Open a second terminal and run:
cd client
npm run devThe frontend will usually run on:
http://localhost:5173
- Register or log in.
- Open the dashboard.
- Create a room or join with a code.
- Collaborate inside the room.
- Pick a challenge and view the problem details.
- Work on the shared editor with live updates across users.
- The project is currently focused on collaborative room workflow and secure access control.
- Automated running and judging of submitted code is a future enhancement, not part of the current implementation.
- Keep your
.envfile private and do not commit secrets to version control.



