- Install pipenv
- Install dependencies:
pipenv install --dev
- Install the pre-commit hooks:
pipenv run pre-commit install
- Install MySQL 8+
- Login to MySQL and run the one-time setup for local dev:
source db_setup_local.sql
- Login to MySQL and run the one-time setup for testing:
source db_setup_test.sql
- Run tests:
bin/test.sh
- Run app:
bin/local.sh
Short notes on decisions that were made so they can be discussed or revisted later. I expect some themes to emerge: simple, well-documented, low learning curve.
- Selected pipenv to manage dependencies and virtual environments. It popped up in search results, was similar to tools I've used before (npm, bundler), and was easy to get started with.
- Selected CherryPy because it's been around awhile, has lots of documentation, was easy to get running, and my webhost WebFaction (affiliate link) had an auto-installer for it.
- Selected pytest as test framework because CherryPy already has a built-in test helper that uses it.
- Selected black as a code auto-formatter because it's easy and avoids excessive time spent worrying about formatting and formatting rules.
- Selected Jinja2 as a template engine since it seems to be the most popular.
- Selected MySQL because it's still the most popular DB and my webhost supports it.
- Selected SQLAlchemy because it's popular and cwkingjr did some initial investigation ("loosened it")
- There's probably a "more correct" mechanism for managing environment variables, but stuffing them in shell scripts makes them explicit and easy to manage.
- I decided to skip testing that the html rendered by a template exactly matched what I expected. This seemed excessive for now. I might revisit it later. If I do, I may aim for image-comparison tests.
https://github.com/psf/black/tree/stable https://pre-commit.com/