Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roman-developer/api-dog
Public API to get dogs names and images
https://github.com/roman-developer/api-dog
activejob api faraday rails-api rails7 rake-task ruby-on-rails sidekiq swagger
Last synced: 4 days ago
JSON representation
Public API to get dogs names and images
- Host: GitHub
- URL: https://github.com/roman-developer/api-dog
- Owner: roman-developer
- Created: 2023-06-26T15:24:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-26T15:28:31.000Z (over 1 year ago)
- Last Synced: 2024-11-07T03:55:03.374Z (about 2 months ago)
- Topics: activejob, api, faraday, rails-api, rails7, rake-task, ruby-on-rails, sidekiq, swagger
- Language: Ruby
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
## API Dogs
Api Dogs is an example project of API mode in Rails.
## Motivation
I have been motivated to build this application because I wanted to build an example project in Ruby on Rails API mode. This project is part of a Code Challenge where we have had the mission to import some data (dogs `images` and `names`) in our local database from an external Dogs API (https://dog.ceo/api/breeds/image/random) and create an endpoint to display the information. The import has been processed in a scheduled task that runs every day.
## Tech/framework used
Built with [Ruby on Rails](https://rubyonrails.org/).
- Ruby version: 3.1.2p20
- Rails version: 7.0.3Database:
- SqliteFrontend:
- No FE, data exposed in JSON format.## Application screenshots
- Example of successfull requests:
[![Captura-de-Pantalla-2023-06-26-a-las-13-03-32.png](https://i.postimg.cc/4dbJwNPy/Captura-de-Pantalla-2023-06-26-a-las-13-03-32.png)](https://postimg.cc/jw20STGY)
[![Captura-de-Pantalla-2023-06-26-a-las-17-20-37.png](https://i.postimg.cc/VkwtVh9V/Captura-de-Pantalla-2023-06-26-a-las-17-20-37.png)](https://postimg.cc/GHM9Bq5F)
## Installation
1. Install [Ruby on Rails](https://edgeguides.rubyonrails.org/getting_started.html#creating-a-new-rails-project-installing-rails)
2. Clone this repository.
3. Database set up:
- Create the database `rails db:create`
- Run migrations `rails db:migrate`
- Run seeds `rails db:seed`## Test
- `rspec spec/`
## Run
- Execute: `rails server`
- Access to http://localhost:3000/api-docs/index.html to see swagger information API
- Example of request:
```
curl -X 'GET' \
'http://localhost:3000/api/v1/dogs' \
-H 'accept: */*'
```