Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miguelargentina/wisboo-challenge-api
This is a challenge where the golas is to create an end point to list all products
https://github.com/miguelargentina/wisboo-challenge-api
Last synced: about 1 month ago
JSON representation
This is a challenge where the golas is to create an end point to list all products
- Host: GitHub
- URL: https://github.com/miguelargentina/wisboo-challenge-api
- Owner: MiguelArgentina
- Created: 2023-01-17T23:32:03.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-18T04:50:40.000Z (almost 2 years ago)
- Last Synced: 2024-11-16T15:29:49.432Z (about 2 months ago)
- Language: Ruby
- Size: 131 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![](https://img.shields.io/badge/tucu-software-red)
## Project: Coding challenge for Wisboo
## Features
- The challenge consists in creating an API with an endpoint that returns a list of products. The endpoint accepts this arguments: page, size, query and currency. All these are for visualizing and filtering products according to the user's needs.
- The json object returned must meet a specific format asked by the challenge. A Presenter is used to format the data.## Built With
- Ruby 3.0.3
- Rails 7.0.4## Prerequisites
- Ruby 3.0.3
- Rails 7.0.4
- Postgres: >=13## Getting Started
- Open your terminal - Windows: `Win + R`, then type `cmd` | Mac: `Command + space`, then type `Terminal`
- Navigate to a directory of your choosing using the `cd` command
- Run this command in your OS terminal: `git clone [email protected]:MiguelArgentina/wisboo-challenge-api.git` to get a copy of the project.
- Navigate to the project's directory using the `cd` command
- Install gems with: `bundle install`
- Setup database with:```
rails db:create
rails db:migrate
rails db:seed
```### Usage
* Start server with `rails server` and make sure you get this page when you visit `http://localhost:3000` in your browser:
![rails server.png](rails%20server.png)* Make a POST request to http://localhost:3000/api/v1/products/index with the following params:
```
page: the number of page to show
size: the number of products to show per page
query: test used to filter products by name
currency: the currency to filter products (USD EUR GBP)
```* If you don't have a software to perform requests (like Postman) you can use this cURL command. You can change the params to see the different results. This command is run in a different terminal than where the server is running:
```
curl -d "product[page]=1" -d "product[size]=10" -d "product[query]=test" -d "product[currency]=USD" http://localhost:3000/api/v1/products/index
```### Run tests
- Run `rails test -vc` from the command line to run all tests. The optional parameters will provide detailed information for each one
## Author
### Miguel Gomez
* GitHub: [@MiguelArgentina](https://github.com/MiguelArgentina)
* twitter - https://twitter.com/Qete_arg### Acknowledgments
- The challenge was proposed by Wisboo
### 🤝 Contributing
- Contributions, issues, and feature requests are welcome!
- Feel free to check the [issues page](https://github.com/MiguelArgentina/wisboo-challenge-api/issues).
### Show your support
Give a ⭐️ if you like this project!