-
Install Mise
-
Install System dependencies
# Arch Linux Prerequisites sudo pacman -Sy --needed base-devel rust libffi libyaml openssl zlib \ postgresql-libs # PostgreSQL # Ubuntu Prerequisites apt-get install build-essential autoconf libssl-dev libyaml-dev zlib1g-dev libffi-dev libgmp-dev rustc sudo apt-get install -y libpq-dev # PostgreSQL # Fedora Prerequisites sudo dnf install -y autoconf gcc rust patch make bzip2 openssl-devel libyaml-devel libffi-devel readline-devel gdbm-devel ncurses-devel perl-FindBin
-
Ensure you have Ruby and NodeJS (with
yarn) installed.mise install -
Install bundler gem:
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:editand 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: xxxx@xxxxxxxx.com 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 # or using Podman podman run --name reg -p 5432:5432 -e POSTGRES_PASSWORD=123456 -d docker.io/library/postgres:18add in your
.envfile the following variables:DATABASE_URL=postgresql://postgres:123456@localhost:5432
- 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.
podman start reg && \ bin/rails server -
You can login using admin account that was previously seed:
admin@domain.com/changeme
This project used RSPEC to run test. Set your environment first:
bin/rails db:setup RAILS_ENV=testRun 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:
admin@domain.com:changeme
Update Gems
bundle update