This project is part of the Microverse curriculum!
Explore the docs »
Report Bug
·
Request Feature
This API matches dog care services (Dog sitting, walking, grooming, etc.) with different users! Many sellers can offer the same service, but who do you trust to care for your furry friend? Add those services you prefer to your favorites and easily keep track of them.
This is the final Capstone project of the Microverse Curriculum.
The documentation was built using raddocs, deployed in Heroku
Its only a back end, so you wont see anything! Check out the deployed app at Heroku
To get a local copy up and running follow these simple example steps.
Install RVM
Install gems with:
bundle install
Setup database with:
rails db:migrate
Start server with:
rails server
Install httpie Don't know where to start using httpie?
The following command will create an login a new user in the database, fill in your name, email and password
$ http :3000/signup name=Eduardo [email protected] password=foobar password_confirmation=foobar
Users Log in with their email and password
$ http :3000/login [email protected] password=foobar
Only Admins can register a service! We do this to guarantee all dog handlers have insurance and are properly identified.
To add services locally open a rails console and update the user you want to set as admin this way:
$ rails c
> User.find_by(email: '[email protected]').update(admin: true)
> exit
After that login the user and keep the auth_token safe!
$ http :3000/login [email protected] password=foobar
Finally we'll create a new service this way (paste the auth_token in the Authorization header)
$ http :3000/services name=grooming user_id=1 \
Authorization:'paste your auth token here'
To see all the services available
$ http :3000/services
Once you have seen the list of all services, choose and and replace the service id in :id too see its details.
$ http :3000/service/:id
To create a favorite login the user (admin or not) and keep the auth_token safe
$ http :3000/login [email protected] password=foobar
Now we'll enter the service_id and the Authentication header
$ http :3000/users/2/favorites service_id=1 \
Authorization:'yourtoken'
To see all your favorites you must log in, we'll use the same authentication steps as before
$ http :3000/users/2/favourites Authorization:'yourtoken'
to run the test:
rspec
This project was built using these technologies.
- Ruby
- Rails
- Rspec
- raddocs
- Rubocop
- VsCode
Eduardo Gutierrez - [email protected]
Project Link
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.