What is this?
It comes preconfigured for ease of project setup, testing, integration, and deployment. Check out a blog post about some of the ideas behind it.
How do I use it?
There are two paths:
You could clone this repository, replace all occurrences of "
Goody" both within files and in filenames in a case-sensitive fashion, delete the
git init, and be ready to go.
However, as the software upon which this project depends is constantly being updated, you might want to use Goody as a reference as you initialize your project from the latest dependencies.
In either case, this project's commit messages contain information about the steps that were run as part of the initialization process.
This project recommends using the asdf version manager to manage programming language dependencies. The
bin/setup script uses asdf to install Elixir, Phoenix, Node.js, and Elm onto your machine in an isolated fashion, so there is no need to install these particular tools yourself.
Installing Node.js via asdf validates the downloaded package against the Node.js release team's OpenPGP signatures. This requires the presence of the
On macOS, run the following to obtain this dependency:
brew install gpg
For other platforms, please see the asdf-nodejs requirements instructions.
This project recommends using direnv to automatically source environment variables into shell sessions.
On macOS, it can be installed with:
brew install direnv
Please see the direnv installation instructions for other platforms.
All users will need to follow the direnv setup instructions to add it to their shell.
Once asdf and direnv are both installed and set up according to the above, execute the following to set up this project:
This script will:
- Create a
.tool-versionsfile for use by asdf from the dependency versions specified in the Heroku buildpack configuration files
- Install or update asdf plugins for Erlang, Elixir, and Node.js
- Install Erlang, Elixir, Node.js, and npm
- Create and allow a sample
- Install server-side and client-side dependencies
- Set up the database
- Install pre-commit and configure commit message linting (on macOS)
- Set up Heroku staging and production remotes (you will need Heroku project access for this step to succeed)
Run all of the checks performed by Heroku CI with:
Run only the Elixir tests, including the full-stack feature tests, with:
# Run tests a single time mix test # Run tests on every file change mix test.watch
Run only the Elm tests with:
# Ensure you are in the assets directory cd assets # Run tests a single time elm-test # Run tests on every file change elm-test --watch
Run the Phoenix server with:
localhost:4000 in your browser.
The project uses code formatters wherever possible. It eschews custom formatter configuration, deferring to established community defaults. Formatting is checked by CI and the
bin/test-all script. Please see the following links and your editor documentation to configure automatic formatting on file save.
This project follows the Conventional Commits style of structuring Git commit messages.
Please see the pre-commit installation instructions for other platforms. Once installed, run the following to configure commit message linting:
pre-commit install --hook-type commit-msg
This project uses a Heroku Pipeline, so there should never be a need to deploy directly to staging or production. The workflow goes as follows:
- Review apps are automatically created for each GitHub pull request.
- Staging is automatically deployed upon each merge to
master, following a successful Heroku CI test.
- Staging can be promoted to production with:
heroku pipelines:promote -r staging
Staging can be viewed by visiting https://staging-goody.herokuapp.com.