Skip to content

TallerWebSolutions/flow_climate

Repository files navigation

Maintainability Test Coverage FlowClimateBuild sponsored by Taller

# Flow Climate

Bringing the management to the next level.

Have the ultimate management tools in your hands!

Using:

  • Sendgrid to send emails
  • Rollbar to monitor production errors
  • RSpec as test framework
  • Fabrication as factory for specs
  • Faker to generate fake data

How to build the environment

  • Install PostgreSQL v. 13.3

  • Install ImageMagick brew install imagemagick or apt install imagemagick

  • Configure pgsql

    • Start postgresql
      • Example on macOS (brew instalation): pg_ctl -D /usr/local/var/postgres start
    • psql postgres
    • run CREATE USER postgres SUPERUSER;
    • run CREATE DATABASE postgres WITH OWNER postgres;
    • run \password postgres and define postgres as user password;
  • Check config/database.yml for further information

  • You may need to install the lipq-dev on Linux environments

    • sudo apt install postgresql libpq-dev
  • Install rvm or rbenv - the main development team is using rvm

  • If you choose rvm then - Install the correct version (the examples will use the ruby-3.2.2)

    • rvm install ruby-3.2.2
      • Create the gemset to the project under the correct version
    • In the project folder run:
    • rvm use 3.2.2@flow_climate --create
    • gem install bundler
    • bundle install
    • copy the application.yml.example to application.yml
  • In the project folder run:

    • rake db:create
    • rake db:migrate
    • RAILS_ENV=test rake db:migrate
  • CI/CD: Github actions

  • The build relies on rspec and rubocop success

  • In the project folder you should be able to run and check the output of:

    • rspec
    • rubocop -A
  • Run console: rails c

  • Run server: rails s

** Local debugging for Visual Studio Code See this article

Build frontend environment

Always run build for spa components.

cd app/spa
npm run build

Troubleshoot

fe_sendauth: no password supplied

When syncing production database this error may occur. Check the following:

  • /var/lib/pgsql/data/pg_hba.conf (may be another path in your OS) is set to use md5 in local and 127.0.0.1/32
  • You have a postgres user with the same name as your OS user and all privileges.
  • You have a password file in your home directory. https://www.postgresql.org/docs/current/libpq-pgpass.html