Skip to content

aledesigncouk/gps-tracker-server

Repository files navigation

Nautilus Tracker - Backend

The Nautilus Tracker Backend API is a server-side solution designed to provide easy access to GPS tracking data stored in a MySQL database. Built using PHP, this API offers two primary endpoints that allow clients to retrieve and interact with GPS data based on specific parData Retrieval by Date Rangeameters.

Features:

  • Data Retrieval by Date Range: The first endpoint allows users to retrieve GPS data within a specified date range. Clients can pass start and end dates as query parameters, and the server will query the MySQL database to fetch the relevant data. The data is returned in a structured format, consisting of GeoJSON objects, with each object containing a year property and coordinates represented in a LineString geometry. This makes it ideal for visualizing GPS tracking data on a map, showing movement over time.

Example response:

[
    {
        "type": "Feature",
        "properties": {
            "year": 2023
        },
        "geometry": {
            "coordinates": [[-122.4194, 37.7749], [-122.4194, 37.7750]],
            "type": "LineString"
        }
    }
]
  • Available Years Endpoint: The second endpoint returns a list of all years that are represented in the database. This allows clients to dynamically filter and choose the specific time period they wish to query. The server retrieves this information by querying the year column in the database and returning a unique list of years.

Installation:

Follow these steps to set up and run the Nautilus Tracker app on your local machine.

Prerequisites:

  • PHP 8 or higher
  • Composer 2.8 or higher
  • Docker 28 or higher

Set Up Environment Variables

...

Secret credentials

API key and Database credential need to be stored in a .env file, that can be autogenerated at deployment time by actions.

CSV input format

CSV file rows must contain the first three fields formatted in the following way: DD/MM/YYYY HH:MM:SS, latitude, longitude 01/09/2023 00:35:55,52.66646,-2.4749416, [ ... ]

About

API Service for GPS tracker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published