Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
popescualexandru9 authored Jan 28, 2025
1 parent 500d69d commit 7657760
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,33 @@
# Backend Interview Starting Point

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.


## Local setup
1. Install ruby: `$ rvm install 3.4.1`
2. `$ cd .` or `$ cd <path_to_project>` to auto-create the rvm gemset
3. Install bundler: `$ gem install bundler`
4. Install the dependencies with bundler: `$ bundle install`

## Run CLI command to start the server
`$ bin/start`

## Run tests
`$ bundle exec rspec`

## Tools

## Run CLI command to start the server
`$ bin/start`

---
## Use
# Start the server: `$ bin/start`
# Choose a provider to call the endpoind, I choose Thunder Client in VS Code. (Postman, Insomnia)
#### Choose a provider to call the endpoind, I choose [Thunder Client](https://www.thunderclient.com/) inside VS Code. (Postman, Insomnia)
`http://localhost:9292/api/closest_shops?lat=47.6&lon=-122.4`
# Should see a reponse similar to:
#### Should see a reponse similar to:
![image](https://github.com/user-attachments/assets/7b3f7d83-4b94-4e7a-b2c0-ad2452a09f84)


# Also can test from terminal
'curl "http://localhost:9292/api/closest_shops?lat=47.6&lon=-122.4"'
'Coffee shops nearest (47.6, -122.4) by distance:
#### It can be also tested using the terminal
```curl "http://localhost:9292/api/closest_shops?lat=47.6&lon=-122.4"```
```
Coffee shops nearest (47.6, -122.4) by distance:
0.0645 <--> Starbucks Seattle2
0.0861 <--> Starbucks Seattle
10.0793 <--> Starbucks SF'
```

### Disclaimers

## Disclaimer

# Authentication is not taken into account
# I did not deploy it anywhere

# I tought about setting up a DB, querying the endpoint to seed it and then seeding it periodically.
# 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
- Authentication is not taken into account
- I tought about setting up a DB, querying the endpoint to seed it and then seeding it periodically.
- 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 comments on commit 7657760

Please sign in to comment.