An app for creating Choose Your Own Adventure stories
With Docker
cp config/database.yml.example-docker config/database.yml
touch config/master.key
# This is a gitignored file which acts as the key to the encrypted/commited `config/credentials.yml` file.
# Copy/paste the password into the new config file:
# https://viget.1password.com/vaults/all/allitems/546kllhiv5ehtdsn2rhvt4q56y
If you're building the docker containers for the first time, or if you know a dependency has been added (eg: ruby gem / node package), run this:
docker compose build
Once the containers have been built, starting the app is just:
docker compose up
# And a shortcut for rebuilding containers while spinning them up at the same time:
docker compose up --build
docker compose run --rm app bundle exec rake db:migrate
docker compose run --rm app bundle exec rake db:seed
# Set up the test database
docker compose run --rm -e RAILS_ENV=test app rake db:create db:migrate
# Run specs
docker-compose run --rm app rspec
Running Locally
- If you have
asdf
installed,.tool-versions
is set up for Ruby, Node, and Yarn versions. - PostgreSQL
- version 11.x
- can be installed with homebrew
cp config/database.yml.example config/database.yml
touch config/master.key
# This is a gitignored file which acts as the key to the encrypted/commited `config/credentials.yml` file.
# Copy/paste the password into the new config file:
# https://viget.1password.com/vaults/all/allitems/546kllhiv5ehtdsn2rhvt4q56y
If you don't have Bundler installed for Ruby:
gem install bundler -v 1.17.3
Install dependencies:
# Install Ruby gems:
bundle install
# Install JS packages:
yarn install
rake db:create db:migrate db:seed
./bin/rails s
If you're updating CSS or JS, start webpacker to enable hot reloading:
./bin/webpack-dev-server
Then open http://localhost:3000 with your favorite internet browser.
rspec
To deploy:
bundle exec cap production deploy
- We're using a "rebase and merge" workflow for a linear commit history.