This template provides starting point for Rails API backend, following Klika quality guidelines, with implemented authentication following OAuth2 standard.
- Ruby version defined in
.ruby-version
- Postgres database
$ bin/setup
this script will:
- install gem dependencies
- setup overcommit
- create .env.local
- create database and load default schema
To get basic idea about configuration approach read 12factor.
.env
configuration file has to include all basic configuration required for this project to work. For any environment specific configuration use .env.#{Rails.env}
specific configuration file. For local specific configuration use .env.local
Use Klika quality guidelines for general development references.
This project is following ruby style guide
Use GitFlow development workflow with controller tests and documentation included.
- no conflicts with target branch
- pass CircleCI tests
- code review approval
- feature followed by integration tests with dox annotations
- documentation generated from test before
Write request specs for new endpoints and include defined dox description files. See dox for usage details and specs/docs/v1/descriptions
for examples.
Run $ rake api:doc:html
to generate documentation. Generated html documentation will be saved in 'public/api/docs/v1/index.html' and publicly available on api domain. Eg. https://klika-rails-api.herokuapp.com/api/docs/v1/index.html
$ rake api:doc:html
Authentication is implemented using Doorkeeper and JWT token standard implementing both password and code grant flows. More datails about OAuth2 Standard.
This project will run static code analyser on every commit and full test suite on git push.
This template us using Rubocop for static code analysis. All rubocop offenses are automatically tracked and prevented on every commit. This feature is handled by Overcommit git hook manager.
We are using RSpec testing framework.
We are generating API documentation from request specs with Dox
Setup for Circle CI