Dilbert Viewer
A simple comic viewer for Dilbert by Scott Adams, hosted on Heroku here. It uses the third-party Rust Buildpack with the Heroku PostgreSQL add-on for caching.
Instructions
Run the script cache_init.sql
at the beginning to create the required tables in the cache:
heroku pg:psql -a dilbert-viewer -f cache_init.sql
Local Testing
Setup
The Heroku CLI is used to locally run the code as specified in the Procfile. To install the Heroku CLI, please refer to Heroku's installation guide for recommended installation options.
Running
-
Build the project in release mode:
cargo build --release
-
Set the required environment variables and run the viewer locally with the Heroku CLI:
DATABASE_URL=$(heroku config:get DATABASE_URL -a dilbert-viewer) heroku local web
For Contributing
pre-commit is used for managing hooks that run before each commit, to ensure code quality and run some basic tests. Thus, this needs to be set up only when one intends to commit changes to git.
-
[Optional] Create a virtual environment for Python.
-
Install pre-commit, either globally or locally in the virtual environment:
pip install pre-commit
-
Install pre-commit hooks:
pre-commit install
NOTE: You need to be inside the virtual environment where you installed pre-commit every time you commit. However, this is not required if you have installed it globally.