|
| 1 | +# JSONAPI.rb :electric_plug: |
| 2 | + |
| 3 | +So you say you need [JSON:API](https://jsonapi.org/) support in your API... |
| 4 | + |
| 5 | +> - hey how did your hackathon go? |
| 6 | +> - not too bad, we got Babel set up |
| 7 | +> - yep… |
| 8 | +> - yep. |
| 9 | +> |
| 10 | +>— [I Am Devloper](https://twitter.com/iamdevloper/status/787969734918668289) |
| 11 | +
|
| 12 | +Here are some _codes_ to help you build your next JSON:API compliable application |
| 13 | +easier and faster. |
| 14 | + |
| 15 | +## But why? |
| 16 | + |
| 17 | +It's quite a hassle to setup a Ruby web application to use and follow the |
| 18 | +JSON:API specifications. |
| 19 | + |
| 20 | +The idea is simple, JSONAPI.rb offers a bunch of modules/mixins/glue, |
| 21 | +add them to your controllers, call some methods, _profit_! |
| 22 | + |
| 23 | +Main goals: |
| 24 | + * No _magic_ please |
| 25 | + * No DSLs please |
| 26 | + * Less code, less maintenance |
| 27 | + * Good docs and test coverage |
| 28 | + * Keep it up-to-date (or at least tell people this is for _grabs_) |
| 29 | + |
| 30 | +## But how? |
| 31 | + |
| 32 | +Mainly by leveraging [Fast JSON API](https://github.com/Netflix/fast_jsonapi) |
| 33 | +and [Ransack](https://github.com/activerecord-hackery/ransack). |
| 34 | + |
| 35 | +Thanks to everyone who worked on these amazing projects! |
| 36 | + |
| 37 | +## Installation |
| 38 | + |
| 39 | +Add this line to your application's Gemfile: |
| 40 | + |
| 41 | +```ruby |
| 42 | +gem 'jsonapi.rb' |
| 43 | +``` |
| 44 | + |
| 45 | +And then execute: |
| 46 | + |
| 47 | + $ bundle |
| 48 | + |
| 49 | +Or install it yourself as: |
| 50 | + |
| 51 | + $ gem install jsonapi.rb |
| 52 | + |
| 53 | +## Usage |
| 54 | + |
| 55 | +TODO: Write usage instructions here |
| 56 | + |
| 57 | +## Development |
| 58 | + |
| 59 | +After checking out the repo, run `bundle` to install dependencies. |
| 60 | + |
| 61 | +Then, run `rake spec` to run the tests. |
| 62 | + |
| 63 | +To install this gem onto your local machine, run `bundle exec rake install`. |
| 64 | + |
| 65 | +To release a new version, update the version number in `version.rb`, and then |
| 66 | +run `bundle exec rake release`, which will create a git tag for the version, |
| 67 | +push git commits and tags, and push the `.gem` file to |
| 68 | +[rubygems.org](https://rubygems.org). |
| 69 | + |
| 70 | +## Contributing |
| 71 | + |
| 72 | +Bug reports and pull requests are welcome on GitHub at |
| 73 | +https://github.com/stas/jsonapi.rb |
| 74 | + |
| 75 | +This project is intended to be a safe, welcoming space for collaboration, and |
| 76 | +contributors are expected to adhere to the |
| 77 | +[Contributor Covenant](http://contributor-covenant.org) code of conduct. |
| 78 | + |
| 79 | +## License |
| 80 | + |
| 81 | +The gem is available as open source under the terms of the |
| 82 | +[MIT License](https://opensource.org/licenses/MIT). |
0 commit comments