A full-stack MERN application with real-time collaboration features using Socket.IO.
- ✅ JWT Authentication
- ✅ Real-time note editing with Socket.IO
- ✅ Online users tracking
- ✅ Role-based access (creator can edit, others read-only)
- ✅ Optimistic UI updates
- ✅ Auto-save with debouncing
- ✅ Responsive design
- ✅ MongoDB persistence
git clone https://github.com/VivekDev01/LiveDraft.git
cd LiveDraft- Install dependencies:
cd backend
npm install- Create
.envfile in backend folder:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key_here- Start the backend server:
npm run startServer will run on http://localhost:5000
- Install dependencies:
cd frontend
npm install- Start the development server:
npm run startFrontend will run on http://localhost:3000
POST /auth/signup- Register new userPOST /auth/login- Login user
GET /notes- Get all notes for logged-in userGET /notes/:id- Get specific notePOST /notes- Create new noteDELETE /notes/:id- Delete note (creator only)
user-online- Announce user is onlinejoin-note- Join a note roomleave-note- Leave a note roomnote-update- Update note content
online-users- Broadcast online users listnote-updated- Broadcast note updates to room
- Authentication: Users login with email/password, receive JWT token
- Dashboard: Shows all notes created by the user
- Real-time Editing:
- Creator can edit notes
- Changes broadcast to all viewers in real-time
- Auto-save with 500ms debounce
- Optimistic UI updates
- Online Users: Socket.IO tracks and displays online users
- Role-based Access: Only note creator can edit, others have read-only access
curl -X POST http://localhost:5000/auth/signup \
-H "Content-Type: application/json" \
-d '{
"name": "Test User",
"email": "test@example.com",
"password": "password123",
}'curl -X POST http://localhost:5000/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "password123"
}'- Open multiple browser windows/tabs to test real-time collaboration
- Use incognito mode to test with different users
- Check browser console for Socket.IO connection logs
- MongoDB connection string can be from MongoDB Atlas or local MongoDB
- Frontend: React.js, React Router, Socket.IO Client
- Backend: Node.js, Express.js, Socket.IO
- Database: MongoDB
- Authentication: JWT, Bcrypt
- Real-time: Socket.IO
- Notes are tied to the creator's user ID
- Real-time updates use Socket.IO rooms for efficient broadcasting
- Debouncing prevents excessive database writes
- JWT tokens expire after 2 days
- CORS is enabled for local development
- Search and filter notes
- Rich text editor
- File attachments
- Note sharing with specific users
- Note categories/tags
- Dark mode