Skip to content

A basic sample project to demonstrate the implementation of an API with Ruby on Rails and integrated React App with Redux

License

Notifications You must be signed in to change notification settings

gabrielrigon/weather_now

Repository files navigation

Weather Now

A simple app to query current weather, based on OpenWeatherMap.

Environment dependencies

  • Ruby = 2.6.3
  • Node >= 10.15.3
  • Yarn >= 1.16.0
  • PostgreSQL = 11.3

How to set up this project

  1. Clone this repo.
  2. Create a file named as master.key, which should be localized into /config folder.
  3. Duplicate the file database.yml.sample, localized on folder /config, name it as database.yml and insert your Postgres configuration.
  4. Duplicate the file .env.sample, localized on root path and name it as �.env.development, complete the parameters.
  5. Duplicate the file �env.js.sample, localized on folder �/app/javascript/src/config, name it as �env.js and complete the parameters.
  6. Install the dependencies following these commands:
  $ bundle
  $ yarn
  1. Create the database and tables:
  $ rails db:create db:migrate
  1. Enable development mode cache (check the result, if it was enabled):
  $ rails dev:cache

How to run (in development mode) this project

  1. After set up, you need to run webpack dev server (in another window):
  $ ./bin/webpack-dev-server
  1. Then, finally, run Rails server:
  $ rails s -p 3000 -b 0.0.0.0

Running tests

  1. Set up the project. (following the instructions on the "How to set up this project" section)
  2. Create the test database and tables:
  $ rails db:create db:migrate RAILS_ENV=test
  1. Run tests:
  $ bundle exec rspec

Extra information

About

A basic sample project to demonstrate the implementation of an API with Ruby on Rails and integrated React App with Redux

Topics

Resources

License

Stars

Watchers

Forks