Skip to content

travi-org/api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API for Travi.org

Coverage Status Code Climate travi.org-admin/travi-api Pact Status Node CI Workflow Status

license

Try It

You can interact with the api through the Swagger UI instance hosted with the API.

Project Goals

I'm using this as an opportunity to learn how to apply a number of core concepts of api development to node.

  • HAL compatible Hypermedia/HATEOAS API
  • Access Control
    • Limited read-only access with no auth context
    • Privilege elevation for advanced actions
      • Either OAuth or Oz for authorization
  • Consumer Driven Contracts
    • Pact Provider
    • Leverage the broker the share pacts from consumers

Contribution

Commitizen friendly Renovate

Environment variables

This application uses environment variables for certain configuration. For local development, the npm script dev expects a .env file to exist, as described here and contain the necessary variable definitions.

Database

Postgres is used as the database.

Initial setup for this application

$ psql -c 'create database travi_api;'

Management with Homebrew

Installation
$ brew install postgresql
Troubleshooting
Ensure the service is started
$ brew services list
$ brew services start postgresql
View the log
$ tail /usr/local/var/postgres/server.log
Remove the pid file
$ rm /usr/local/var/postgres/postmaster.pid
Rebuild everything
$ rm -rf /usr/local/var/postgres
$ initdb -D /usr/local/var/postgres
$ createdb