|
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 | | -## Local setup |
7 | | -1. Install ruby: `$ rvm install 3.4.1` |
8 | | -2. `$ cd .` or `$ cd <path_to_project>` to auto-create the rvm gemset |
9 | | -3. Install bundler: `$ gem install bundler` |
10 | | -4. Install the dependencies with bundler: `$ bundle install` |
11 | | - |
12 | | -## Run CLI command to start the server |
| 1 | +<details> |
| 2 | + <summary><i>Local setup</i></summary> |
| 3 | + 1. Install ruby: `$ rvm install 3.4.1` |
| 4 | + 2. `$ cd .` or `$ cd <path_to_project>` to auto-create the rvm gemset |
| 5 | + 3. Install bundler: `$ gem install bundler` |
| 6 | + 4. Install the dependencies with bundler: `$ bundle install` |
| 7 | +</details> |
| 8 | + |
| 9 | +# Usage |
| 10 | +#### Run CLI command to start the server |
13 | 11 | `$ bin/start` |
14 | 12 |
|
15 | | -## Run tests |
16 | | -`$ bundle exec rspec` |
17 | | - |
18 | | -## Tools |
19 | | - |
20 | | - |
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 | +## Run tests |
| 30 | +`$ bundle exec rspec` |
37 | 31 |
|
38 | | -## Disclaimer |
39 | | - |
40 | | -# Authentication is not taken into account |
41 | | -# I did not deploy it anywhere |
| 32 | +### Disclaimers |
42 | 33 |
|
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 |
| 34 | +- I thought about setting up a DB, querying the endpoint to seed it and then seeding it periodically. |
| 35 | +- 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 CoffeeShopFinderService on each request." |
0 commit comments