Beaver Dam Analogues (BDAs) are one low cost, 'cheap and cheerful' technique used in beaver-assisted restoration to mimic natural beaver dams, promote beaver to work in particular areas, and accelerate recovery of incised channels.
BDA-Explorer enables users to add BDA their projects to a map, and browse other BDA projects.
Clone the repository by running git clone https://github.com/OregonStateUniversity/bda-explorer.git
into a directory of your choice.
Change into the cloned git repository directory and run bundle install
to install
the required gems and Rails version.
This is required to build pg
, one of the gems used in the app; the gem will print
a compilation error and instructions for installing a PostgreSQL client library on
your system, if one is not found.
A role with the current user’s name must created with psql
with SUPERUSER,
CREATEDB, CREATEROLE, and LOGIN privileges. Create the database with ./bin/rails db:setup
.
On Ubuntu 20.04, a LoadError
may be thrown involving the libffi
library. This library can be installed by running
wget http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi8_3.4.2-1ubuntu5_amd64.deb
sudo dpkg -i ./libffi8_3.4.2-1ubuntu5_amd64.deb
Run ./bin/rails db:migrate
to update the database schema.
Obtain a copy of the development.key and/or production.key files (ask a developer).
Run tests with rake
or rspec
to ensure the development environment is working properly.
With PostgreSQL running, run the server locally with ./bin/rails server
.
By default, users have the 'public' role, which gives them standard CRUD permissions for projects they make. Users can be given the 'admin' role from the console, which gives them CRUD permissions for all projects, including projects they did not create, and CRUD permissions for organizations, which normal users do not have.
A user can be given the 'admin' role by running @user.update_attribute(:role, 'admin')
, where @user
is the user record you want to give permissions to.
If you have a Heroku account registered as a contributor for the bda-explorer and bda-explorer-staging apps, you can push changes from your local git repository to the live/test version of the website.
Add the production and staging environments as remote tracked repositories to your local git repository.
Add the production environment by running git remote add production https://git.heroku.com/bda-explorer.git
.
Add the staging environment by running git remote add staging https://git.heroku.com/bda-explorer-staging.git
.
Push your current version of master
by running git push production master
.
For a feature branch to be tested on staging, run git push --force staging <BRANCH>:master
, where <BRANCH>
is the name of the feature branch. The feature branch should not be missing migrations present on the current build of staging.
© 2022 Gatlin Cooper, Chris Miraflor, Nathan Struhs, Yong Bakos. All rights reserved.