Skip to content

shreyam91/Realtime-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Location Tracker

This is a real-time location tracking application built using JavaScript, Socket.io, Express.js, and the OpenMap API. The project allows users to track their location on a map in real-time, with frequent updates on their current position.

Features

  • Real-time location updates: The location is updated frequently using Socket.io, ensuring a smooth and seamless tracking experience.
  • Accurate positioning: The application leverages the OpenMap API to display an accurate location on the map.
  • Interactive Map: Users can see their current location and watch updates in real-time as they move.
  • Simple interface: Easy-to-use front-end interface that displays the map and location data.

Technologies Used

  • JavaScript (Node.js)
  • Socket.io (for real-time communication between server and client)
  • Express.js (web server framework)
  • OpenMap API (for geolocation and map display)

Project Setup

1. Clone the Repository

2. Install Dependencies

Make sure you have Node.js installed. If not, download and install it from here.

Install the required dependencies using npm:

npm install

3. Set Up OpenMap API Key

To use the OpenMap API, you'll need an API key. Follow these steps:

  1. Go to the OpenMap API website.
  2. Create an account and get your API key.
  3. Create a .env file in the root directory of the project and add the following line with your API key:

4. Run the Server

Once the dependencies are installed and the API key is set, you can start the server:

npm start

The server will run at http://localhost:3000. Open this URL in your browser to access the application.

5. Client-side Interaction

Once the app is running, the user's location will be tracked and displayed on the map. You can see the real-time updates on the map as you move.

How It Works

  1. Server-Side (Express.js + Socket.io):

    • The server listens for incoming WebSocket connections through Socket.io.
    • When a client connects, the server tracks the user's real-time location and broadcasts it to all connected clients.
  2. Client-Side (JavaScript + OpenMap API):

    • The client uses the browser's Geolocation API to get the user's current position.
    • The position is sent to the server using Socket.io, and the server responds with updated location data.
    • The location is plotted on the map using the OpenMap API.
  3. OpenMap API:

    • The OpenMap API is used to display a map with accurate geolocation information based on the received latitude and longitude.

Example Use Case

  1. Launch the application.
  2. Allow the browser to access your location.
  3. Your real-time location will be displayed on the map, and updates will be sent to the server periodically.
  4. The location will be updated on all connected clients in real time.

Contributing

Feel free to fork the repository and submit pull requests if you'd like to contribute. If you encounter any issues or have suggestions, please open an issue on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Socket.io: Provides real-time bi-directional communication.
  • Express.js: Web framework for building the server.
  • OpenMap API: Used to get the user's location and display it on a map.

About

This is a real-time location tracking application built using JavaScript, Socket.io, Express.js, and the OpenMap API. The project allows users to track their location on a map in real-time, with frequent updates on their current position.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors