- [Heds Up For Life!]
Clone the Git repo into a local folder:
git clone [email protected]:marcelhekking/hedsupforlife.git
With Docker, you can start a container in production mode.
The web Docker performs actions under GI 1024 (e.g., running collectstatic
). In the Docker files, a physical volume on the host is linked with folders inside Docker. To avoid permission errors:
- Create a public folder at the project level (next to
src
) - Create
staticfiles
andmediafiles
folders and run the following for both folders:
mkdir -p public/staticfiles && mkdir -p public/mediafiles
and execute the following make
command (https://www.gnu.org/software/make/):
make 1024
Go to the root of the project (hedsupforlife
) and first (only to be done once) build the dev container with:
sudo docker build -t hedsupforlife-web:latest -f Dockerfile .
Then start the container with:
make docker
and shut id down with:
make down
Install the frontend:
yarn install
Create a Python virtual environmnet will all dependencies specified in the pyproject.toml
installed:
uv sync
Create a database:
createdb hedsupforlife
Migrate the database and install a superuser. This is the admin as specified in base.py
.
make rebuild
Start the Django development server
make runserver
Pre-commit is a Python package to check code via git hooks before it ends up in a Git repo. Before committing, you need to install pre-commit. In the correct Python virtual environment, go to the root of the project (hedsupforlife
) and run:
pre-commit install
To test, you can check existing files with pre-commit:
pre-commit run --all-files
For modifying and effectively creating CSS and JS files, watchify
is used. Changes to CSS and JS are observed and converted into a minified bundle. This minified bundle is deployed to production.
The following Node.js applications must be installed:
- browserify
- watchify
- uglify-js
- browserify-css
All dependencies can be installed with the yarn install
command in the root of the project:
cd ~/../hedsupforlife$
yarn install
Start watchify to create a minified bundle 'on-the-fly':
cd ~/../hedsupforlife$
yarn run watchify