eschwelgin / openbrewerydb-rails-api

Open Brewery DB Ruby on Rails REST API server

Home Page:https://www.openbrewerydb.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open Brewery DB - REST API Server Github Actions Badge

The Open Brewery DB API server is a Ruby on Rails API app connected to a PostgreSQL DB server.

Related project: Open Brewery DB

Description

This is the code for the Open Brewery DB API server.

Documentation

Dependencies

Run locally

  • Clone the repo $ git clone https://github.com/chrisjm/openbrewerydb-rest-api
  • Run bundle install
  • Run bundle exec rails db:setup
  • Run bundle exec rails s
  • The server will be running at http://localhost:3000

Note: There is no front-end for the API at this time.

Database setup

There are some assumptions for the local PostgreSQL service configuration.

  • Host is localhost or 127.0.0.1
  • User is blank (i.e. it is the current system user)
  • Password is blank

All of these settings can be overwritten by setting environment variables in .env:

  • POSTGRES_USER
  • POSTGRES_PASSWORD
  • POSTGRES_HOST

See config/database.yml for configuration.

Seed breweries dataset

Included in the repo at lib/import/brewers_association/ is scraped HTML from the Brewer's Association. This will be replaced soon with a full compressed SQL which will be easier

bundle exec rake breweries:import:brewers_association

Run tests

bundle exec rake or bundle exec rspec

About

Open Brewery DB Ruby on Rails REST API server

https://www.openbrewerydb.org/

License:MIT License


Languages

Language:HTML 99.1%Language:Ruby 0.9%