Realtime map collaboration app where one user (Tracker) shares live map movement and other users (Tracked) follow in the same room.
- Frontend: React + Vite + React Leaflet + Socket.IO Client
- Backend: Node.js + Express + Socket.IO
- Deployment: Vercel (client) + Render (server)
- Room-based map sync using Socket.IO
- Role-based behavior:
tracker: broadcasts map positiontracked: receives and follows tracker position
- One-tracker-per-room protection
- Tracker disconnect handling (
Tracker Leftstate) - Throttled + precision-controlled coordinate updates for smoother sync
Geo-Sync/
client/ # React app (Vite)
server/ # Express + Socket.IO server
- Node.js 18+
- npm
From project root:
cd server
npm install
cd ../client
npm installCopy client/.env.example to client/.env and update as needed:
VITE_SOCKET_URL=http://localhost:5000
VITE_MAP_PROVIDER=leafletStart server (Terminal 1):
cd server
npm run devStart client (Terminal 2):
cd client
npm run devOpen the Vite URL (usually http://localhost:5173).
- User enters
roomId+ role (trackerortracked). - Client emits
join_session. - Server accepts join and emits
join_accepted. - Tracker emits
map_moveupdates. - Server relays updates as
sync_mapto others in same room. - Tracked client sets map view from incoming data.
join_sessionjoin_acceptedtracker_takenmap_movesync_maptracker_disconnectedconnection_status
Create a new Web Service from this repo with:
- Root Directory:
server - Build Command:
npm install - Start Command:
node src/server.js - Environment: Node
After deploy, copy your Render backend URL (example: https://your-api.onrender.com).
Create a new project from this repo with:
- Root Directory:
client - Build Command:
npm run build - Output Directory:
dist
Add environment variables in Vercel Project Settings:
VITE_SOCKET_URL=https://geo-sync.onrender.com
VITE_MAP_PROVIDER=leafletRedeploy after adding variables.
- Current server CORS is open (
origin: "*"). For production, restrict to your Vercel domain. - Render free tier can sleep; first socket connection may be slow after inactivity.
npm run dev- start Vite dev servernpm run build- build production frontendnpm run preview- preview build locally
npm run dev- start server with nodemon
Add your deployed URLs here:
- Frontend (Vercel):
https://geo-sync-gray.vercel.app/ - Backend (Render):
https://geo-sync.onrender.com