Back Office Planning System (BOPS)
Dependency | Version |
---|---|
Ruby | 2.6.5 |
Rails | 6.0.2.2 |
Postgresql | 1.2.3 |
Node | 13.8.0 |
Yarn | 1.15.2 |
$ git clone git@github.com:unboxed/bops.git
$ bundle install
$ yarn install
Within psql's CLI, enable the postgis and postgis_topology extensions:
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
$ rails db:setup
You can run the full test suite using following command:
$ rspec
Individual system specs with opening Chrome browser can be run using the following command:
$ JS_DRIVER=selenium_chrome rspec spec/system/log_in_spec.rb
$ rails server
http://southwark.local.abscond.org:3000/
or
http://lambeth.local.abscond.org:3000/
##Dependencies
You will need to install wkhtmltopdf
locally as this renders the PDF of the decision notice. Install this with the command:
brew install --cask wkhtmltopdf
##API
API documentation is available at /api-docs/index.html and can be autogenerated by running:
rake rswag:specs:swaggerize
Once you have the application running, you can submit planning application through the API. You can do this throught he provided swagger documentation at /api-docs/index.html
- Click Authorize and fill in the API key ('123' if not otherwise specified at db:seed)
- POST /api/v1/planning_applications > Try it out > Choose 'Full' example > Click Execute.
We need a single openapi file to exist, but to keep the code easier to maintain we have multiple files that are then compiled into this single file:
public/api-docs/v1/_build/swagger_doc.yaml
.
So to create a new api endpoint, create your yaml doc inside public/api-docs/v1 and reference it in
public/api-docs/v1/swagger_doc.yaml
like so:
$ref: "./your_new_file_name.yaml"
Make changes to your new file, and when you're happy aggregate them into our single file by installing this package in your machine:
npm install -g swagger-cli
and running:
swagger-cli bundle public/api-docs/v1/swagger_doc.yaml --outfile public/api-docs/v1/_build/swagger_doc.yaml --type yaml