Skip to content

afm-sayem/ground-zero

Repository files navigation

Dependency Status license

Ground Zero is a collection of features implemented on top of Express with the help of ObjectionJS and PostgreSQL. The API stores and serves data for a movie review site.

Play with the API with some sample requests.

Features:

  • User registration with verification
  • Token based authentication
  • Permissions
  • Dynamic query filters
  • Full-text search
  • Geolocation
  • Browsable API documentation
  • Planned: Recommendations

API Design:

The filtering API is using objection-find which exposes a powerful queryable API to the consumers. The API consumer can dynamcally filter on the properties of any resource they have access to without a single modification done to the server.

All query parameters are grouped in four classes: filters, pagination, inclusions and ordering. There's an excellent discussion in one of the issues in Ghost where they discuss implementing this pattern to let the consumers access the API easily.

Getting started:

  • Install nvm and then nvm install node (minimum version: 7.x).
  • Add node_modules to your path variable. For example, for zsh, add this to your .zshrc: export PATH="$PATH:./node_modules/.bin"
  • Install project dependencies: npm install
  • Install PostgreSQL and create a database.
  • Install redis
  • Create an environment variable configuration file named .env in the project root and define the environment variables. Here's a sample.
  • Create tables: knex migrate:latest
  • Populate tables with data: knex seed:run
  • Run the server: npm run dev
  • Test the API: http://localhost:3000/movies

Releases

No releases published

Packages

No packages published