The directions below get you to a point where you can run the app with a test-seeded database.
If you see a spot in the docs that's confusing or could be improved, please pay it forward by making a pull request!
- Fork the Repo: Go to https://github.com/DARIAEngineering/dcaf_case_management and hit the
forkbutton up in the top right. - Clone the repo to your machine: Copy the URL for your fork and run:
git clone YOUR_FORK_URLto pull it down to your local system. Change into the repo directory withcd dcaf_case_management. - Add the Daria repo as a remote:
git remote add upstream https://github.com/DARIAEngineering/dcaf_case_management. This will let you update when the source repo changes by running the commandgit pull upstream main.
We've dockerized the app, to manage the dependencies and save us some headache. We recommend this route for beginners or anyone who prefers docker.
If you've got Docker installed already, you can be up and running with three commands:
docker compose builddocker compose run --rm web rails db:drop db:create db:migrate db:seed # to populate the databasedocker compose up
The last command will take a moment and should print a number of things. When it's ready to go, it should say something like:
web_1 | [1] * Listening on tcp://0.0.0.0:3000
This runs the app on http://localhost:3000 and you can hit it like a regular rails server. The first time you view a page will
take a minute or two for resources to compile and load, but it should eventually load. You can log in with the user test@example.com and the password AbortionsAreAHumanRight1.
Any errors will show up in your terminal in the window you are running the up command in.
If you prefer to run directly on you machine, here are our general directions. You may need to adapt them to your machine. Beginners may find the docker setup easier.
- Install:
- Git, python2, & openssl-dev
- Ubuntu:
sudo apt install git python2 openssl libssl-dev - Mac:
brew install git python2 openssl
- Make sure you have a ruby version manager installed; we recommend either rbenv or rvm.
- Install our version of Ruby!
rbenv installorrvm install $(cat .ruby-version)should do the trick, depending on what you're using.
- Set up a node verion manager; we recommend nvm.
- Install our version of node with
nvm install. - Install Yarn locally (
brew install yarn, or the setup instructions).
We use Postgres around these parts. Installation will differ based on your OS.
-
Install Postgres
- MacOS:
brew install postgres - Ubuntu: install
postgresql,libpq-dev, andpostgresql-client - Other linux instructions (server and developer libraries needed)
- Set the daemon to run automatically, if needed
- MacOS:
-
Configure Postgres
- Setup your user; the suggested password is
postgresif you only use this machine for development purposessudo -u postgres createuser -P -s `whoami` - Set your env variables:
echo "POSTGRES_USER=`whoami`" >>.env echo "POSTGRES_PASSWORD=postgres" >>.env
- Setup your user; the suggested password is
- Run the command
gem install bundler && bundle installto install dependencies, includingrails. - Install JS packages:
yarn install - Run the command
rails db:create db:migrate db:seedto set up the database and populate it with some test data.
- Run the command
bin/devto start the rails server - You are officially ready to go! Navigate your browser to
http://localhost:3000. You can log in with the usertest@example.comand the passwordAbortionsAreAHumanRight1.