|
1 | | -# Backend Interview Starting Point |
2 | | - |
3 | | -This repo will serve as a starting point for your code challenge. Feel free to change anything in order to complete it: Change framework, other tests, new gems etc. |
4 | | - |
5 | | - |
6 | 1 | ## Local setup |
7 | 2 | 1. Install ruby: `$ rvm install 3.4.1` |
8 | 3 | 2. `$ cd .` or `$ cd <path_to_project>` to auto-create the rvm gemset |
9 | 4 | 3. Install bundler: `$ gem install bundler` |
10 | 5 | 4. Install the dependencies with bundler: `$ bundle install` |
11 | 6 |
|
12 | | -## Run CLI command to start the server |
13 | | -`$ bin/start` |
14 | | - |
15 | 7 | ## Run tests |
16 | 8 | `$ bundle exec rspec` |
17 | 9 |
|
18 | | -## Tools |
19 | | - |
| 10 | +## Run CLI command to start the server |
| 11 | +`$ bin/start` |
20 | 12 |
|
21 | | ---- |
22 | | -## Use |
23 | | -# Start the server: `$ bin/start` |
24 | | -# Choose a provider to call the endpoind, I choose Thunder Client in VS Code. (Postman, Insomnia) |
| 13 | +#### Choose a provider to call the endpoind, I choose [Thunder Client](https://www.thunderclient.com/) inside VS Code. (Postman, Insomnia) |
25 | 14 | `http://localhost:9292/api/closest_shops?lat=47.6&lon=-122.4` |
26 | | -# Should see a reponse similar to: |
| 15 | +#### Should see a reponse similar to: |
| 16 | + |
27 | 17 |
|
28 | 18 |
|
29 | | -# Also can test from terminal |
30 | | -'curl "http://localhost:9292/api/closest_shops?lat=47.6&lon=-122.4"' |
31 | | -'Coffee shops nearest (47.6, -122.4) by distance: |
| 19 | +#### It can be also tested using the terminal |
| 20 | +```curl "http://localhost:9292/api/closest_shops?lat=47.6&lon=-122.4"``` |
| 21 | +``` |
| 22 | +Coffee shops nearest (47.6, -122.4) by distance: |
32 | 23 |
|
33 | 24 | 0.0645 <--> Starbucks Seattle2 |
34 | 25 | 0.0861 <--> Starbucks Seattle |
35 | 26 | 10.0793 <--> Starbucks SF' |
| 27 | +``` |
36 | 28 |
|
| 29 | +### Disclaimers |
37 | 30 |
|
38 | | -## Disclaimer |
39 | | - |
40 | | -# Authentication is not taken into account |
41 | | -# I did not deploy it anywhere |
42 | | - |
43 | | -# I tought about setting up a DB, querying the endpoint to seed it and then seeding it periodically. |
44 | | -# But taking into the consideration the size of the csv file, the minimal number of requests I choose to prioritize always having the latest data and calling the endpoint through my CoffeeShopFinderServiceon each request |
| 31 | +- Authentication is not taken into account |
| 32 | +- I tought about setting up a DB, querying the endpoint to seed it and then seeding it periodically. |
| 33 | +- But taking into consideration the size of the csv file and the minimal number of requests I choose to prioritize always having the latest data and calling the endpoint through my CoffeeShopFinderServiceon on each request |
0 commit comments