# Flow Climate
Bringing the management to the next level.
Have the ultimate management tools in your hands!
- Sendgrid to send emails
- Rollbar to monitor production errors
- RSpec as test framework
- Fabrication as factory for specs
- Faker to generate fake data
- Devise for authentication
- Rubocop for linting
- PostgreSQL
- React
- GraphQL
- Material UI - https://v5-0-6.mui.com/customization/default-theme/
-
Install PostgreSQL v. 13.3
-
Install ImageMagick
brew install imagemagick
orapt install imagemagick
-
Configure pgsql
- Start postgresql
- Example on macOS (brew instalation):
pg_ctl -D /usr/local/var/postgres start
- Example on macOS (brew instalation):
- psql postgres
- run
CREATE USER postgres SUPERUSER;
- run
CREATE DATABASE postgres WITH OWNER postgres;
- run
\password postgres
and define postgres as user password;
- Start postgresql
-
Check
config/database.yml
for further information -
You may need to install the
lipq-dev
on Linux environmentssudo 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
- Check Github Actions
-
The build relies on
rspec
andrubocop
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
Always run build for spa components.
cd app/spa
npm run build
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
Generate a new token at https://id.atlassian.com/manage-profile/security/api-tokens
Update the corresponding Jira::JiraAccount with the new token in the field api_token
docker compose up
docker compose down
docker compose exec web bash
docker compose exec db psql -U postgres -d flowcontrol_development
heroku pg:backups:capture --app flowclimateapp
- to capture the databaseheroku pg:backups:download --app flowclimateapp
- to download the databasedocker compose down
- to stop the development environmentdocker compose up -d db
- to start the database containerdocker compose exec db dropdb -U postgres flowcontrol_development --if-exists
- to drop the databasedocker compose exec db createdb -U postgres flowcontrol_development
- to create the databasedocker compose cp latest.dump db:/tmp/latest.dump
- to copy the dump to the containerdocker compose exec db pg_restore -U postgres -d flowcontrol_development /tmp/latest.dump
- to restore the databasedocker compose up -d
- to start the development environmentdocker compose run web rails db:migrate
- to run and apply pending migrations