Skip to content

ResistanceCalendar/resistance-calendar-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resistance Calendar API

API for Resistance Calendar events

Codeship Status

Getting Started

Prerequisites

Demo

An instance of the application is running at the following location:

https://resistance-calendar.herokuapp.com/v1/events

Endpoints

All endpoints try to be compliant with the OSDI Events standard which exposes two high level endpoints and a few options for paging:

Queries

Queries are intended to comply with the ODATA standard and use odata-v4-mongodb to do so which implements much, but not all of the standard. Some examples of common queries are:

Start date

Filter by start date (dates in ISO8601 format):

Nested properties

Filter by nested property (postal_code and locality/city):

Text searching

This can be done via multiple contains functions combined via and / or logical operators and are not case sensitive.

Location

Searching is not technically ODATA compliant since there is not affordance for radial searches. This implementation filters by location using coordinates (longitude, latitude), city, or postal code and distance in meters. If coordinates are specified, they are used as they are the preferred method of location based searching since postal_codes are only supported for US and may be out of date.

Ordering

Again, using the ODATA standard, ordering is done like so:

Cities endpoint

Intended to find the city based on a set of coordinates

Created / updated at queries

For ETL based processes, limiting the number of events queried for can be done by created_date and modified_date fields

Run the server

cd resistance-calendar-api

# Export the facebook token. Eventually this can be made to auto-refresh using the app secret.
export FB_GRAPH_API_TOKEN=[YOUR FACEBOOK TOKEN]

# Start mongodb
mkdir .db
mongod --dbpath .db/

# Always a good idea to install packages
npm install && npm install semistandard -g

# Run the tests!
npm test

# Run the service
npm start

Technical Architecture

The service is a node service based on the hapijs framework and uses mongodb

About

API for Resistance Calendar events

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published