Manual Installation
Clone the repo
- Clone the repo
git clone https://github.com/rhino-project/rhino-project-template.git
Postgres
Versions:
- PostgreSQL: 15 or newer
OSX
This assumes you have Homebrew installed.
- Install postgres
brew install postgresql
WSL2 on Windows
This assumes you are using Ubuntu 20
- Install postgres
sudo apt install postgresql postgresql-contrib libpq-dev
- Start postgres
sudo service postgresql start
- Setup postgres user
sudo -u postgres createuser -s -i -d -r -l -w <<username>>
sudo -u postgres psql -c "ALTER ROLE <<username>> WITH PASSWORD '<<password>>';"
Ruby and Node
Versions:
- Ruby: 3.3.4
- Node: 20.14.0
RVM (Ruby) and NVM (Node)
- Install rvm
curl -sSL https://get.rvm.io | bash -s stable --ruby=3.3.4
- As per rvm instructions on completion to start using RVM you need to run
source $HOME/.rvm/scripts/rvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
- Install node 20.14.0,
nvm install v20.14.0
Asdf (Ruby and Node)
-
Install asdf https://asdf-vm.com/guide/getting-started.html
-
Install plugins from
.tool-versions
in the root of the project
asdf install
Launch the application
- Create the environment file
rails rhino:dev:setup
and select 'n' when asked if you are installing for docker.
env.sample
is provided as an example. You can manually copy this to .env
and modify the values as needed
- Install gem and node dependencies
bundle install
npm install
- Create and load the database
rails db:setup
- Run the rails server
rails s
- Run the client development server
npm start
Updating the production model data
The static copy of the data model is automatically updated with the rhino vite plugin. The data model can be manually updated with:
rails rhino:open_api_export
Customization
The data model driving the UI is loaded from src/models/index.js in production or or dynamically from the server at /api/info/openapi in development (by default http://localhost:3000/api/info/openapi). See Updating the production models for further instructions on export.