(This README is for the back-end version of our web-application. To visit the front-end repo, please click here.)
According to the USPS, 15.9 million people moved amidst the COVID-19 pandemic.
Not all of these moves were permanent.
Predicting future socioeconomic changes and continuing turmoil relating to COVID-19, the authors of this web application sought to create an app that helps users to make smarter choices concerning moves with the hope that users can find a match of their personality and lifestyle with a city that fits them best.
Finding the ideal match benefits both the person and the city, leading to pride and investment in the communities of that city.
Thought experiment: What would be the impact of a city filled with people that love their city?
Find My City is a city finding app which allows users to search and sort cities by criteria they find most important. We believe that finding the right city is important for people, cities, and the world.
This is our attempt at solving this problem.
- Getting Started
- Running the tests
- DB Schema
- API Services Used
- Endpoints
- Technologies Used
- Versioning
- Visit a Live Version of this Web App
- Authors
To run the web application on your local machine, you can fork and clone down the repo and follow the installation instructions below.
First you'll need to:
bundle install
Next we install Figaro.
bundle exec figaro install
Figaro allows us to discretely place our API keys inside of our local files. Only you'll be able to see this file, which helps for keeping API keys secret.
Once you have Figaro installed, verify that you have an application.yml
file in your config
folder. The directory of the application.yml
file should be config/application.yml
. For more documentation on Figaro, please see here.
Congratulations! Basic setup is now complete.
Although this app utilizes two API services, we will only need to register for the OpenWeather API service. Here's the link to register for the API key. Please be advised: Though you may receive your API key immediately, it may take a few hours for the key to be activated.
Once you have your key, go to your config/application.yml
file and follow this convention:
WEATHER_API_KEY: 'copy_paste_your_api_key_here'
That should take care of getting your weather API service!
Now we create the database by running the following command in your terminal
rails db{:drop,:create,:migrate}
And that should be all you need to finish installation!
To run this application you will need Ruby 2.7.2 and Rails 5.2.6
RSpec testing suite is utilized for testing this application.
- Run the RSpec suite to ensure everything is passing as expected
bundle exec rspec
The following is a depiction of the Database Schema
- City
- City Search. Find one city based on city name and state initials search. This also returns a list of city scores if available, else the population of the city.
GET https://helpmefindmycity-api.herokuapp.com/api/v1/city?city=#{city}&state_initials=#{state}
- City Favorites. Get list of user favorite cities.
GET https://helpmefindmycity-api.herokuapp.com/api/v1/users/#{user_id}/favorites
- City Add Favorite Add a city to user's favorite list.
POST https://helpmefindmycity-api.herokuapp.com/api/v1/favorites
- City Delete Favorite Delete a city from a user's favorite list.
DELETE https://helpmefindmycity-api.herokuapp.com/api/v1/favorites/#{favorite_id}
- City Search. Find one city based on city name and state initials search. This also returns a list of city scores if available, else the population of the city.
- User
- User Register Register a User
POST https://helpmefindmycity-api.herokuapp.com/api/v1/users
- User Register Register a User
- Weather
- Weather Information Get the weather for a specific day
GET https://helpmefindmycity-api.herokuapp.com/api/v1/weather
- Weather Information Get the weather for a specific day
- Ruby
- Rails
- RSpec
- JavaScript
- HTML
- CSS
- Bootstrap
- PostgreSQL
- factory_bot_rails
- faker
- faraday
- bcrypt
- bootstrap
- shoulda-matchers
- figaro
- capybara
- Ruby 2.7.2
- Rails 5.2.6