Skip to content

Ruby on Rails API boilerplate

Notifications You must be signed in to change notification settings

shftco/rails-api-boilerplate

Repository files navigation

build & test & quality Ruby Style Guide Ruby Version Rails Version Swagger documentation

Rails API Boilerplate

cover

How to Works?

flowchart TD
  R[Request] --> C[Application Controller]
  C --> O[Application Operation]
  O -- Validate Params --> AC[Application Contract]
  O -- Application Contract returned success?--> S[Application Service]
  AC -- Validation success? --> O[Application Operation]
  AC -- Validation failed? --> E[Contract Errors]
  E --> RE
  S -- Process successful? --> RS[Resource]
  S -- Process failed? --> OE[Resource Errors]
  OE --> RE[Response]
  RS --> RE
  RE -- Returns --> C
Loading

Documentations

Installation

Prerequisites

Installation

  • Install GEM dependencies:

    bundle install
  • Create database, migrate tables and run the seed data:

    rails db:create
    rails db:migrate
    rails db:seed
  • If you are setting up again, when you already have previous databases:

    rails db:reset

    reset is equivalent of rails db:drop & rails db:setup.

  • Run the server

    ./bin/dev