This webapp was developed using the following tools, those are not required but can be a good baseline to start working in this project
sudo apt-get install -y ruby build-essential patch ruby-dev zlib1g-dev liblzma-dev
sudo apt-get install -y libpq-dev #PostgreSQL
sudo dnf install -y ruby ruby-devel gcc openssl-devel zlib-devel rpm-build libpq-devel g++
sudo dnf group install -y "C Development Tools and Libraries"
-
Ensure you have Ruby and NodeJS installed.
-
Install bundler gem:
sudo gem install bundler
-
Install all gem dependencies:
bundle install
-
Edit the secrets variables
-
If you are starting over:
# 1. create .env file cp .env.template .env # 2. create a key rake secret | tail -1 | cut -c1-32 > config/master.key
-
Then create a Credentials file using
rails credentials:edit
and add the following content:secret_key_base: xxxxxxxx google_key: xxxxxxxx api_user: xxxxxxxx api_pass: xxxxxxxx smtp: address: xxxxxx.xx.com domain: xxxxxxxxxx.com user_name: [email protected] password: xxxxxxxx
-
-
Start PostgreSQL DB (with docker)
docker run --name reg -p 5432:5432 \ -v ~/dev/data/reg:/var/lib/postgresql/data \ -e POSTGRES_PASSWORD=123456 -d postgres:13
- Initialize the db:
rails db:create rails db:schema:load rails db:seed # Optional - If you want to generate random data rails db:populate
-
Install yarn dependencies:
yarn install --check-files
-
You should be ready to go. Run the project.
rails server
-
You can login using admin account that was previously seed:
[email protected] / changeme
This project used RSPEC to run test. Set your environment first:
rails db:migrate RAILS_ENV=test
Run tests using: rspec
For more information please visit the official heroku page
-
Set the Buildpacks:
heroku buildpacks:clear heroku buildpacks:set heroku/nodejs heroku buildpacks:add heroku/ruby
-
Set environmental Variables (for PROD):
heroku config:set RAILS_MAX_THREADS=1 heroku config:set RAILS_MIN_THREADS=1 heroku config:set RAILS_ENV=production heroku config:set RAILS_MASTER_KEY=$(cat config/master.key) heroku config:set RAILS_SERVE_STATIC_FILES=true
-
Create the DB
heroku rake db:schema:load heroku rake db:seed
-
You will have an administrator account already configured. Login using the following credentials:
[email protected]:changeme
Update Gems
bundle update