Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shftco/rails-api-boilerplate
Ruby on Rails API boilerplate
https://github.com/shftco/rails-api-boilerplate
boilerplate devise-auth doorkeeper rails rails-api rails-application rails-boilerplate ruby
Last synced: 10 days ago
JSON representation
Ruby on Rails API boilerplate
- Host: GitHub
- URL: https://github.com/shftco/rails-api-boilerplate
- Owner: shftco
- Created: 2022-02-11T15:26:46.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-07T15:44:24.000Z (about 2 years ago)
- Last Synced: 2025-01-14T11:46:07.971Z (16 days ago)
- Topics: boilerplate, devise-auth, doorkeeper, rails, rails-api, rails-application, rails-boilerplate, ruby
- Language: Ruby
- Homepage:
- Size: 334 KB
- Stars: 74
- Watchers: 5
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![build & test & quality](https://github.com/cousins-factory/rails-api-boilerplate/actions/workflows/main.yml/badge.svg?branch=main)
[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop)
![Ruby Version](https://img.shields.io/badge/ruby_version-3.1.2-blue.svg)
![Rails Version](https://img.shields.io/badge/rails_version-7.0.4-c52f24.svg)
[![Swagger documentation](https://img.shields.io/badge/swagger_documentation-84e92c.svg?&logo=swagger&logoColor=black)](docs/SWAGGER.md)# Rails API Boilerplate
![cover](docs/cover.png)# How to Works?
```mermaid
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
```# Documentations
- [Swagger](docs/SWAGGER.md)
- [Service generator](docs/SERVICE.md)
- [Contract generator](docs/CONTRACT.md)
- [Search & Filter & Sort](docs/RANSACK.md)# Installation
## Prerequisites
- [Ruby](https://rvm.io/)
- [PostgreSQL](https://www.postgresql.org/)
- [Redis](https://redis.io/)## Installation
- Install GEM dependencies:
```bash
bundle install
```- Create database, migrate tables and run the seed data:
```bash
rails db:create
rails db:migrate
rails db:seed
```- If you are setting up again, when you already have previous databases:
```bash
rails db:reset
```
`reset` is equivalent of `rails db:drop & rails db:setup`.- Run the server
```bash
./bin/dev
```