• Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    JavaScript
  • Created over 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Compass is a GPS tracking server that stores data in flat files.

Compass

Compass is a GPS tracking server that stores data in flat files.

mapview

Requirements

  • PHP 5.5 or above
  • MySQL (for storing user accounts and lists of databases, not for storing the actual location data)

PHP extensions

You'll need to make sure the following PHP extensions are installed. Typically these are installed using the package manager of your operating system.

  • curl
  • mbstring
  • zip
  • unzip

Optional

  • Redis (for the job queue, can use MySQL instead)

Setup

Compass is built using the Lumen framework. If you have any trouble getting started, you can refer to the Lumen documentation for tips that may have been skipped or assumed in these instructions.

In the compass directory, copy .env.example to .env and fill in the details. Install the dependencies with composer.

$ composer install

Once you've created the database and configured the settings in .env, run the migrations to set up all the tables.

$ php artisan migrate

Web Server

Your web server will need to support URL re-routing to the index.php file of compass. This will vary based on your web server.

  • If you're using Apache, this will involve URL re-writing likely using .htaccess
  • If you're using Nginx, this will involve incorporating the following code into your server block, you should also add any applicable fastcgi settings inside the location block below:
try_files $uri /index.php?$args;

  location /index.php {
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }

Job Queue

For the job queue you will either need to have one of the supported options by Lumen. The two most likely options are an SQL database or Redis. You can find other supported options here

If you're using the database queue driver (QUEUE_DRIVER=database defined in .env), you'll need to create the migration for that table:

$ php artisan queue:table
$ php artisan migrate

If you're using Redis, make sure you've installed the Redis server and set QUEUE_DRIVER=redis.

Make sure the storage folder you've defined in STORAGE_DIR is writable by the web server (or by the PHP process if you're using php-fpm).

To process jobs on the queue, run

$ php artisan queue:listen

For more details on how to configure this to run in the background, see https://lumen.laravel.com/docs/5.1/queues#running-the-queue-listener

API

After you create a tracking database, you can visit the database's settings page to get a read or write token. These tokens are used with the API to update or retrieve data.

Writing

To write to a database, make a POST request in JSON format with the following keys:

POST /api/input

  • locations - a list of GeoJSON objects
  • token - the write token for the database (as a query string parameter or in the post body)

The GeoJSON objects must have at least one property, "timestamp", which is can be any value that can be interpreted as a date. The object can have any additional properties you wish.

The open source iOS Overland will send data in this format by default.

POST /api/input?token=XXXXXXX HTTP/1.1
Content-type: application/json

{
  "locations": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [-122.621, 45.535]
      },
      "properties": {
        "timestamp": "2017-01-01T10:00:00-0700",
        "horizontal_accuracy": 65
      }
    }
  ]
}

Reading

To read a database, make a GET request as follows:

Get all data for a calendar day

GET /api/query

  • token - (required) the read token for the database
  • tz - (optional, default UTC) timezone string (e.g. America/Los_Angeles) which will be used to determine the absolute start/end times for the day
  • format - (optional, default "full") either "full" or "linestring"
  • full - return one JSON record for each result in the database
  • linestring - combine all the returned results into a GeoJSON linestring
  • date - specify a date to return all data on that day (YYYY-mm-dd format)

Get the last location before a given timestamp

GET /api/last

  • token - (required) the read token for the database
  • tz - (optional, default UTC) timezone string (e.g. America/Los_Angeles) which will be used to determine the absolute start/end times for the day
  • before - (optional, default to now) specify a full timestamp to return a single record before this date (the point returned will be no more than 24 hours before the given date)
  • geocode - (optional) if "true", then the location found will be reverse geocoded using Atlas to find the city and timezone at the location

Find the last location matching a clock time

GET /api/find-from-localtime

This API method can help you answer the question "Where was I when my watch read 9:30am on July 15th?".

Timestamps in Exif data do not include the timezone offset, and there is no standard mechanism for including the timezone offset in Exif. Some Canon cameras put the offset in a field, but not all of them do. You can use this method to find your location given an Exif date.

  • token - (required) the read token for the database
  • input - specify a clock time in the format YYYY-mm-dd HH:MM:SS

This will query the database and find the closest matching location for when your clock read that time.

Credits

Compass icon by Ryan Spiering from the Noun Project.

Screenshot of the map view by Sebastiaan Andeweg.

License

Copyright 2015 by Aaron Parecki

Compass is licensed under the Apache 2.0 license

Compass is built using the Lumen framework, which is licensed under the MIT license

More Repositories

1

webmention.io

Easily enable webmentions and pingbacks on any web page
Ruby
681
star
2

Overland-iOS

πŸ“Œ GPS logger for iOS devices
Objective-C
595
star
3

oauth.net

πŸ”’ The oauth.net website. Feel free to send pull requests with updates.
PHP
267
star
4

Google-Voice-PHP-API

Unmaintaned: Please do not contact me with support requests. If this no longer works, it's because Google Voice changed their systems. I will accept pull requests that fix things. Check out http://twilio.com for a much better API for sending and receiving SMSs.
PHP
229
star
5

iMessage-Export

Archive your iMessage history to HTML, CSV or SQL
PHP
187
star
6

IndieAuth.com

This service is being discontinued in favor of indielogin.com
Ruby
182
star
7

sign-in-with-apple-example

Sample code for the Sign in with Apple API
PHP
155
star
8

indielogin.com

Sign in with your domain name
JavaScript
131
star
9

emoji-detector-php

This library will find all emoji in an input string and return information about each emoji character.
PHP
126
star
10

live-chat-overlay

Restyle the YouTube "popout chat" window so you can key it over a video to show comments on a livestream
JavaScript
124
star
11

pkce-vanilla-js

A demonstration of the OAuth PKCE flow in plain JavaScript
HTML
122
star
12

Quill

πŸ–‹ A Micropub client for creating posts
PHP
111
star
13

Bootstrap-Skin

Bootstrap Skin for MediaWiki. Bootstrap is an excellent toolkit by Twitter. This is a MediaWiki skin based off of that template.
JavaScript
100
star
14

OwnYourGram

πŸ“· Save your Instagram photos to your own website!
PHP
92
star
15

sample-oauth2-client

Sample OAuth2 client using the GitHub API
PHP
86
star
16

XRay

X-Ray returns structured data from any URL
PHP
85
star
17

Nautilus

Turn your website into an ActivityPub profile
PHP
76
star
18

Meetable

a minimal website for posting events
PHP
70
star
19

Aperture

Aperture is a Microsub server. Currently in beta.
PHP
67
star
20

Device-Flow-Proxy-Server

Add the OAuth 2.0 Device Flow to any OAuth server
PHP
66
star
21

Monocle

Monocle is a reader app that talks to a Microsub server
Sass
47
star
22

quick-php-authentication

Add Authentication to your PHP App in 5 Minutes!
PHP
44
star
23

Watchtower

🏰 a minimal API for watching web pages for changes, roughly speaks the WebSub protocol
PHP
43
star
24

IndieNews

πŸ“° News aggregator for IndieWeb-related posts
PHP
35
star
25

Slack-IRC-Gateway

Bridge Slack rooms to IRC channels
JavaScript
34
star
26

atem-tally-controller

C++
34
star
27

Switchboard

a WebSub / PubSubHubbub 0.4 hub
PHP
33
star
28

ssh-config-aws

Helper scripts to generate an ~/.ssh/config file automatically from one or more AWS accounts
Ruby
31
star
29

micropub.rocks

Micropub test suite and debugging utility
PHP
31
star
30

Telegraph

Telegraph is an API for sending Webmentions
CSS
31
star
31

TikTokBot

TikTokBot is a bot framework for Slack and IRC.
Ruby
28
star
32

Flickr-Archiver-Ruby

Backs up your entire Flickr stream to a local site.
Ruby
27
star
33

Swarm-Checkins-Import

Import your Foursquare/Swarm checkins to your Micropub-enabled website
PHP
26
star
34

Atlas

🌎 Atlas is a set of APIs for looking up information about locations
CSS
25
star
35

Auto-AirBnB-Entry

Sets the door code to the last 4 digits of the next guest's phone number before they arrive.
PHP
25
star
36

websub.rocks

Test suite and debug utilities for W3C WebSub
PHP
24
star
37

checks

print your own checks!
PHP
23
star
38

rating-stars

⭐️⭐️⭐️⭐️⭐️ A 5-star rating widget implemented in JS and CSS
HTML
22
star
39

spiderpig

πŸ•·πŸ· reduces a dynamic website into a pile of smoldering html
JavaScript
21
star
40

OwnYourSwarm

JavaScript
21
star
41

webmention.rocks

a webmention validator and test suite
PHP
20
star
42

command-line-oauth

A quick demo of doing OAuth from the command line
PHP
19
star
43

picofeed

PHP library to parse and write RSS/Atom feeds
PHP
18
star
44

QuartzDB

A flat-file database optimized to hold time-series data.
PHP
18
star
45

twitter-slack-stream

Stream tweets from conference attendees to a Slack channel
Ruby
16
star
46

youtube-chat-map

Show your livestream viewers on a map!
PHP
15
star
47

p3k-http

A simple HTTP client, used by https://p3k.io projects
PHP
13
star
48

p3k

This is a repository for filing issues against the software the runs my website. The source code is not public, but various components are.
13
star
49

p3k-micropub

Utilities to help handle Micropub requests when building servers and clients
PHP
12
star
50

indieauth.rocks

IndieAuth test suite - in progress
CSS
12
star
51

oauth-v2-1

OAuth 2.1
Shell
11
star
52

Teacup

β˜•οΈ Teacup is a simple Micropub app for tracking what you eat and drink
JavaScript
11
star
53

Flickr-Archivr

Download and archive your entire Flickr account as a static website
PHP
11
star
54

m5-core2-atem-controller

An ATEM controller using an M5 Core2
C++
11
star
55

Local-MediaWiki-Sync

Downloads all pages from a MediaWiki install to local text files.
PHP
11
star
56

chrome-open-tabs

Track your open Chrome tabs
JavaScript
10
star
57

clone-media-fragment

Clone the Media Fragment from the page's URL to any embedded media on the page
JavaScript
10
star
58

aperture-wordpress

A WordPress plugin to use Aperture as your Microsub endpoint
PHP
9
star
59

p3k-utils

a collection of smaller helper functions used by many of my applications
PHP
8
star
60

Squash-Reports

JavaScript
8
star
61

Geoloqi-Emergency-Beacon-Map

This application is a resource for citizens, medical teams and governments before, during and after disasters.
PHP
8
star
62

live-chat-overlay-remote

The remote window for the Live Chat Overlay browser extension
JavaScript
7
star
63

squawk-chat

A simple website chat widget backed by IRC
JavaScript
7
star
64

xmlrpc-micropub-bridge

XML-RPC to Micropub Bridge
PHP
7
star
65

p3k-websub

A library for subscribing to and publishing WebSub feeds
PHP
7
star
66

IndieAuth-Token-Endpoint

PHP
7
star
67

Meme-API

An API and TikTokBot integration that implements a !meme command to generate a meme image
Ruby
7
star
68

Loqi

Loqi is a friendly IRC bot
6
star
69

p3k-html-sanitizer

PHP
6
star
70

ca3db-ruby

Content-Addressable Avatar Archive
Ruby
6
star
71

Maniac-Clock

A sticky clock that also takes screenshots
JavaScript
6
star
72

Caterpillar

πŸ› Caterpillar is a PHP job queueing system based on beanstalkd
PHP
6
star
73

Teacup-Offline

Offline-first app for tracking food and drink posts
HTML
6
star
74

oauth-browser-based-apps

Best practices for OAuth in Browser-Based Apps
HTML
5
star
75

omniauth-indieauth

IndieAuth strategy for OmniAuth
Ruby
5
star
76

IndieWeb-Development

Makefile
5
star
77

Twitter-Archive-to-CSV

Convert your Twitter archive to a CSV file
PHP
5
star
78

esp-badge

esp32 with e-paper display
C++
5
star
79

music-map

Mapping all the songs we listened to on a road trip!
JavaScript
5
star
80

microsub.rocks

PHP
4
star
81

MediaWiki-Changelog-Graphs

Adds a special page showing a chart of wiki edits broken down by day, hour and month
4
star
82

PushupCounter-iOS

A silly app that counts pushups when you touch your nose to your phone
Objective-C
4
star
83

p3k-timezone

Look up the timezone given a latitude and longitude
PHP
4
star
84

BarBot

🍸
C++
4
star
85

curly

curly: A wrapper for `curl` which pretty-prints JSON output
Ruby
4
star
86

php-multipart-encoder

Multipart encoder for PHP
PHP
4
star
87

twtr

Algorithmic Twitter URL shortener
CSS
4
star
88

Gramophone

a Micropub client for publishing podcasts
PHP
4
star
89

blade-markdown-directive

adds a `@markdown` Blade directive for use in Laravel views
PHP
3
star
90

MediaWiki-Github-Issues

Render a list of Github issues in a wiki page
3
star
91

gnap-client-php

Sample GNAP client in PHP
PHP
3
star
92

reserved-usernames-php

A list of reserved usernames to prevent url collision with resource paths. Packaged as a Composer library. Source data: https://github.com/shouldbee/reserved-usernames
PHP
3
star
93

Crosswalk-Photo-Booth

Shell
2
star
94

automatic-indieauth-example

PHP
2
star
95

tz_world

A GeoJSON file of the TZ timezones of the world
Shell
2
star
96

discourse-disqus-oauth

Log in to Discourse with your Disqus account
Ruby
2
star
97

Airplane-Time

stretch time while flying between timezones - a progressive web app
HTML
2
star
98

IndieAuth-Client

Sample client app to authenticate against IndieAuth-enabled domains
PHP
2
star
99

ChatterCast-Seattle

Receive real-time 911 alerts from Seattle's open data feed. Works with Geoloqi.
PHP
2
star
100

example-indieauth-server

a prototype IndieAuth server to demonstrate what is required to build an IndieAuth server
PHP
2
star