This app exposes six different endpoints to an imaginary Front End which allows users to get weather forecasts for road-trip destinations. The app allows users to see the current weather as well as the forecasted weather at the destination, at their ETA.
- Expose an API that aggregates data from multiple external APIs
- Expose an API that requires an authentication token
- Expose an API for CRUD functionality
- Research, select, and consume an API based on your needs as a developer
- Ruby Version 2.7.4
- Rails Version 5.2.8
- bcryt
- capybara
- faraday
- figaro
- jsonapi-serializer
- launchy
- pry
- rspec_junit_formatter
- rspec
- shoulda-matchers
- securerandom
- simplecov
- vcr
- webmock
- Clone this repository: On your local machine open a terminal session and enter the following commands for SSH or HTTPS to clone the repositiory.
- using ssh key
$ git clone [email protected]:johnny-bowman/sweater-weather.git
- using https
$ git clone https://github.com/johnny-bowman/sweater-weather.git
Once cloned, you'll have a new local copy in the directory you ran the clone command in.
- Change to the project directory:
In terminal, use$cd
to navigate to the backend Application project directory.
$ cd sweater_weather
- Install required Gems utilizing Bundler:
In terminal, use Bundler to install any missing Gems. If Bundler is not installed, first run the following command.
$ gem install bundler
If Bundler is already installed or after it has been installed, run the following command.
$ bundle install
- There should be be verbose text diplayed of the installation process that looks similar to below. (this is not an actual copy of what will be output).
Click to see example!
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 13.0.6
Using concurrent-ruby 1.1.10
...
...
...
Using simplecov_json_formatter 0.1.4
Using simplecov 0.21.2
Using spring 2.1.1
Using spring-watcher-listen 2.0.1
Using standard 1.12.1
Bundle complete! 23 Gemfile dependencies, 94 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
- If there are any errors, verify that bundler, Rails, and your ruby environment are correctly setup.
- Figaro installation
- Follow the figaro installation with the docs and get your api keys. Add all keys to your newly created
config/application.yml
file and add it to your.gitignore
file if it wasn't automatically created. Be sure to read the all the docs for a deeper undestanding of the app and how to properly use the endpoints.
$ bundle exec figaro install
- Database Migration
Before using the web application you will need to setup your databases locally by running the following command
$ rails db:{:drop,:create,:migrate}
- Startup and Access
Finally, in order to use the web app you will have to start the server locally and access the app through a web browser.
- Start server
$ rails s
- Open web browser and visit link http://localhost:3000
At this point you should be able to access the endpoints with postman.
Click to see example!
Prefix Verb URI Pattern Controller#Action
api_v1_weather GET /api/v1/weather(.:format) api/v1/forecast#index
api_v1_backgrounds GET /api/v1/backgrounds(.:format) api/v1/backgrounds#index
api_v1_book_search GET /api/v1/book-search(.:format) api/v1/book_search#index
api_v1_users POST /api/v1/users(.:format) api/v1/users#create
api_v1_sessions POST /api/v1/sessions(.:format) api/v1/sessions#create
api_v1_trip POST /api/v1/trip(.:format) api/v1/trip#create
Johnny Bowman (he/him) |
This project follows the all-contributors specification.