How shivaay100/real_time_tracker works
LiveRoute is an authenticated, real-time location-sharing web app with an interactive map and chat. The main workflow is: users register or log in, the browser collects GPS coordinates, the server records and broadcasts updates, and connected browsers show users on a map. The server also tracks online presence, serves user and history APIs, and handles chat. The README describes historical trails and messaging; source confirms history storage/API and direct-message storage, while the sampled client currently broadcasts chat and does not render fetched history. Arrows reflect the sampled app and client code; unsampled view details are not inferred.
Main entry points: app.js Express and Socket.IO · script.js Tracking client · index.ejs Map dashboard · User.js User model
Components 18
Access and sessions
- Express and Socket.IO
app.js - Auth guards
middleware/auth.js - Login view
views/login.ejs - Registration view
views/register.ejs
Persistence
- User model
models/User.js - DB connection
config/database.js - Location history model
models/LocationHistory.js - Message model
models/Message.js
Browser interface
- Tracking client
public/js/script.js - Map dashboard
views/index.ejs - Login page
views/login.ejs - Register page
views/register.ejs - Interface styling
public/css/style.css - UI effects
public/js/animations.js
Other components
- User
- MongoDB
- Browser geolocation
- OpenStreetMap tiles
Connections 24
- User → Login page: opens
- User → Register page: opens
- User → Map dashboard: uses
- Express and Socket.IO → Auth guards: checks access
- Express and Socket.IO → Login page: renders
- Express and Socket.IO → Register page: renders
- Express and Socket.IO → Map dashboard: renders
- Express and Socket.IO → User model: queries and saves
- Express and Socket.IO → Location history model: stores and queries
- Express and Socket.IO → Message model: stores direct messages
- Express and Socket.IO → DB connection: connects through
- DB connection → MongoDB: connects
- User model → MongoDB: persists users
- Location history model → MongoDB: persists locations
- Message model → MongoDB: persists messages
- User → Tracking client: operates
- Map dashboard → Tracking client: loads
- Tracking client → Browser geolocation: watches position
- Tracking client → Express and Socket.IO: sends locations and chat
- Express and Socket.IO → Tracking client: broadcasts updates
- Tracking client → Express and Socket.IO: requests users and history
- Tracking client → OpenStreetMap tiles: loads map tiles
- Map dashboard → Interface styling: uses
- Tracking client → UI effects: uses effects