Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

CodeForge

CodeForge is a real-time collaborative code editor. Users can create or join a room and edit the same code together through Socket.IO.

Features

  • Create a room with a generated UUID or join an existing room.
  • Join as a guest with only a username, or optionally create an account and log in.
  • Open login and sign-up from the top-right of the home page.
  • Sync code changes and participant lists in real time.
  • Restore the latest code saved for a room when joining again.
  • Show join and leave notifications.
  • Copy the Room ID to invite collaborators.
  • Edit C++ with CodeMirror, Dracula theme, line numbers, autocomplete, bracket matching, and auto-close brackets.
  • Use Socket.IO websocket transport with polling fallback for local development.

Tech Stack

Frontend

  • React 19 and Vite
  • React Router DOM
  • CodeMirror via @uiw/react-codemirror
  • Socket.IO client
  • React Hot Toast, Bootstrap, React Avatar, and UUID

Backend

  • Node.js and Express 5
  • Socket.IO
  • Node crypto for password hashing and signed authentication tokens
  • JSON files for local user and room-code persistence

Project Structure

client/   React and Vite frontend
server/   Express and Socket.IO backend

Local Setup

Install dependencies:

cd server
npm install

cd ../client
npm install

Start the backend in one terminal:

cd server
npm start

Start the frontend in another terminal:

cd client
npm run dev

Open http://localhost:5173 in the browser. The frontend uses http://localhost:5000 by default. To use another backend, set this value in client/.env:

VITE_BACKEND_URL=http://localhost:5000

Persistence

Room code is stored by Room ID in server/data/rooms.json. Local accounts are stored as salted password hashes in server/data/users.json. The server/data/ directory is ignored by Git because it contains local runtime data.

Authentication is optional for collaboration. Logged-in users receive a signed token and can still join the same rooms as guests.

For production, set a strong AUTH_SECRET environment variable and replace the local JSON stores with a shared database for multi-instance deployments.

Routes

  • / - home page, room creation, and room joining
  • /editor/:roomId - collaborative editor

License

ISC

About

It is a real‑time collaborative code editor — multiple users join a shared room and edit code together, with every keystroke synced live across everyone in the room.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages