Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bruz/bookshelf-delivery-example
Hanami example app with multiple delivery mechanisms
https://github.com/bruz/bookshelf-delivery-example
Last synced: 3 months ago
JSON representation
Hanami example app with multiple delivery mechanisms
- Host: GitHub
- URL: https://github.com/bruz/bookshelf-delivery-example
- Owner: bruz
- License: mit
- Created: 2016-07-14T01:21:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-11T05:46:22.000Z (over 7 years ago)
- Last Synced: 2024-06-26T06:35:36.441Z (5 months ago)
- Language: Ruby
- Size: 63.5 KB
- Stars: 14
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-hanami - bookshelf-delivery-example - An example app with a web GUI, API and CLI using shared interactors. (Hanami Project List / Play/Pet projects)
README
This is an extension of the Bookshelf app featured in [Hanami's Getting Started Guide](http://hanamirb.org/guides/getting-started/), mainly as an exploration of taking an app's use cases and providing multiple delivery mechanisms around them: a browser UI, an API, and a command line interface. It's the first thing I've done with Hanami, so feedback on anything that doesn't seem to fit with the Hanami way of doing things will be happily received.
# Current status
[![Travis](https://img.shields.io/travis/bruz/bookshelf-delivery-example.svg?style=flat-square)](https://travis-ci.org/bruz/bookshelf-delivery-example) [![Gemnasium](https://img.shields.io/gemnasium/bruz/bookshelf-delivery-example.svg?style=flat-square)](https://gemnasium.com/bruz/bookshelf-delivery-example) [![Code Climate](https://img.shields.io/codeclimate/github/bruz/bookshelf-delivery-example.svg?style=flat-square)](https://codeclimate.com/github/bruz/bookshelf-delivery-example)
# Getting started
Prerequisites:
* Ruby 2.2 or 2.3
* PostgreSQLSetup:
git clone https://github.com/bruz/bookshelf-delivery-example.git
cd bruz/bookshelf-delivery-example
hanami db create
hanami db migrateUsing the CLI (doesn't require a running server):
./bin/bookshelf add "Hard-Boiled Wonderland and the End of the World" "Haruki Murakami"
Starting the server:
hanami server
The web UI will now be available at to browse at [http://localhost:2300](http://localhost:2300).
The REST-like API lives under /api/books, so for example you can do:
curl http://localhost:2300/api/books -X POST -d 'title=The Count of Monte Cristo&author=Alexander Dumas'
# License
This project is licensed under the [MIT Licence](https://github.com/bruz/bookshelf-delivery-example/blob/master/LICENSE).