ROR app to add books as an admin or browse books as a user
Admin credentials
user: admin@gmail.com
password: 313131
The administrator can add, delete, update books authors and publisher. The regular user can sign up or login and browse book.
Athentication using Devise.
Authorization using Cancancan
Application buit with Ruby on Rails
Get all available books
https://bookstore-0c0a.onrender.com/api/books
Get 1 book by id
https://bookstore-0c0a.onrender.com/api/book/:id
Post book (create book)
https://bookstore-0c0a.onrender.com/api/books
Put Update book
https://bookstore-0c0a.onrender.com/api/books/:id
Delete book
https://bookstore-0c0a.onrender.com/api/books/:id
Pagination
https://bookstore-0c0a.onrender.com/api/books?page=1&per_page=5
Filter books by Titles
Get
https://bookstore-0c0a.onrender.com/api/books/filter_title?title=norwegian
Filter by price range
Get
https://bookstore-0c0a.onrender.com/api/books/filter_price?min_price=1&max_price=10
Filter by author name
Get
https://bookstore-0c0a.onrender.com/api/books/filter_author?author=king
- Major languages: Ruby
- Frameworks: ROR
- Gems: devise, bigdecimal, will_paginate, cancancan,
To get a local copy up and running follow these simple example steps.
You need to have followings installed in your local machine:
- Ruby '3.1.2'
Postgresql
Rails 7
To setup the project in your local, in the repo page:
- Open terminal of path you want to install project and run this command:
git clone https://github.com/sjdev2212/bookstore-challenge.git
cd bookstore/
bundle install
bin/rails db:create
bin/rails db:migrate
- Run the following comands in your command line:
rails s
open any browser
type "localhost:3000"
enjoy the app
👤 Anibal Amoroso
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!