/Realtime-Tracker

A real-time location tracking application built with Node.js, Express, Socket.io, and Leaflet.js. This app allows users to share their live location, which is displayed on an interactive map.

Primary LanguageJavaScript

📍 Real-Time Tracker App

A real-time location tracking application built using Node.js, Express, Socket.io, and Leaflet.js. This app allows users to share their live location, which updates dynamically on an interactive map.

✨ Features

  • Live Location Sharing – Uses the Geolocation API to send real-time location updates.
  • 🔄 Real-Time Updates – Powered by WebSockets (Socket.io) for seamless communication.
  • 🗺 Interactive Map – Displays live user locations using Leaflet.js and OpenStreetMap.
  • 👥 User Tracking – Detects when users connect or disconnect.
  • Lightweight & Fast – Built with Express.js for quick and efficient handling.

📂 Project Structure

realtime-tracker/
│── public/               # Frontend assets  
│   ├── css/style.css     # Styles for the map  
│   ├── js/script.js      # Handles socket connections and map updates  
│── views/  
│   ├── index.ejs         # Main frontend template  
│── app.js                # Backend server with Express & Socket.io  
│── package.json          # Project dependencies  
│── .env                  # Environment variables (PORT)  

🚀 Installation & Setup

1️⃣ Clone the repository

git clone https://github.com/your-username/realtime-tracker.git
cd realtime-tracker

2️⃣ Install dependencies

npm install

3️⃣ Run the server

🔹 Development Mode (Auto-restart with nodemon)

npm run dev

🔹 Production Mode

npm start

4️⃣ Open in Browser

Visit http://localhost:3000 to see the real-time tracking in action!

🛠 Technologies Used

  • Node.js + Express.js – Backend server
  • Socket.io – Real-time WebSocket communication
  • Leaflet.js – Interactive mapping
  • EJS – Templating engine
  • CSS – Styling

🌟 Future Enhancements

  • 🌍 Show all users' locations in real-time.
  • 🗺 Improve UI with custom map markers.
  • 📊 Store location history in a database (MongoDB/PostgreSQL).
  • 📱 Make the app mobile-friendly.