This project is collection of config / gems / tools for quickstart developing Rails API follow JSON API spec. No test framework is included, you should add it by yourself, your choice ! :)
- rbenv
latest
- ruby
>= 3.0.1
- postgres
latest
- docker
latest
(If you want to run with Docker)
- Clone the repo
git clone https://github.com/pandabamboo90/rails-json-api
- Run setup to prepare database
cd rails-json-api bin/setup
- Start the server
rails s
- Clone the repo
git clone https://github.com/pandabamboo90/rails-json-api
- Open
entrypoint.sh
and change CONTAINER_TYPE value to "SETUP", this will help you setup DB/migrations/seed data and run the project 1st time# entrypoint.sh CONTAINER_TYPE=SETUP
- Build the image and run container
docker-compose build docker-compose up
- At this point your project is ready and should be up & running. Open
entrypoint.sh
and change CONTAINER_TYPE value to "WEB" for later to speed up the boot time# entrypoint.sh CONTAINER_TYPE=WEB
Gem | Info |
---|---|
devise | A flexible authentication solution for Rails based on Warden |
devise_token_auth | Simple, multi-client and secure token-based authentication for Rails. |
Gem | Info |
---|---|
rolify | Very simple Roles library without any authorization enforcement supporting scope on resource object |
action_policy | Authorization framework for Ruby and Rails applications. Composable, extensible and performant |
Gem | Info |
---|---|
shrine | Toolkit for handling file uploads in Ruby. |
Gem | Info |
---|---|
discard | A simple ActiveRecord mixin to add conventions for flagging records as discarded. |
Gem | Info |
---|---|
oj | A fast JSON parser and Object marshaller as a Ruby gem. |
jsonapi-serializer | A fast JSON:API serializer for Ruby Objects. |
jsonapi.rb | transform a JSONAPI document into a flat dictionary that can be used to update an ActiveRecord::Base model. |
Gem | Info |
---|---|
rails_semantic_logger | Scalable, next generation enterprise logging for Ruby. |
Gem | Info |
---|---|
validates_overlap | Ideal solution for booking applications where you want to make sure, that one place can be booked only once in specific time period. |
validates_timeliness | Date and time validation plugin for ActiveModel and Rails. |
Gem | Info |
---|---|
letter_opener | Preview mail in the browser instead of sending. |
Gem | Info |
---|---|
goldiloader | Wouldn't it be awesome if ActiveRecord didn't make you think about eager loading and it just did the "right" thing by default? With Goldiloader it can! |
Gem | Info |
---|---|
faker | A library for generating fake data such as names, addresses, and phone numbers. |
seedbank | Seedbank allows you to structure your Rails seed data instead of having it all dumped into one large file. |
Gem | Info |
---|---|
capistrano | A deployment automation tool built on Ruby, Rake, and SSH. |
capistrano-db-tasks | Add database AND assets tasks to capistrano to a Rails project. It only works with capistrano 3 |
Gem | Info |
---|---|
standard | Ruby style guide, linter, and formatter |
Ransack attempts to follow semantic versioning in the format of x.y.z
, where:
x
stands for a major version (new features that are not backward-compatible).
y
stands for a minor version (new features that are backward-compatible).
z
stands for a patch (bug fixes).
In other words: Major.Minor.Patch.
Feel free to use this template for your next JSON-API project. Good luck, have fun !