Compete with others and climb to the top of the leaderboard! 🚀
I wrote this Django app to store metabolic workouts and keep track of how my clients were performing.
- Sign up for an account
- View a workout in plain text
- Time how long it takes you to perform
- Upload your score
The backend then shows the top score, and, more importantly, your top score. That way you can keep track of what you've done in the past.
It's been surprisingly useful! You're welcome to use it!
Living Room Glacier (Level 4) is probably the hardest one! 😁
- Python
- Django
- Docker
- PostgreSQL
- Bulma for styling
First, set up environment variables:
cp docker-compose.override.yml.example docker-compose.override.yml
# then replace the values with working values
To spin up Django development server:
docker compose up -d --build
To spin down development server:
docker compose down
The database will need to be set up as well:
docker compose exec web python manage.py migrate
To create an admin user:
docker compose exec web python manage.py createsuperuser
To login to the Django admin, visit http://127.0.0.1:8000/backside/
Some functionality won't work unless you update the sites model at http://127.0.0.1:8000/backside/sites/site/1/change/
If you ever add or update the Django models, you'll need to instruct Django to update the database with migrations:
docker compose exec web python manage.py makemigrations
docker compose exec web python manage.py migrate
The build.js
file is used to build the TypeScript files. Bun bundles the files.
The bundler searches for files in the src
directory which end in index.ts
.
It builds them into the build
directory which is listed in the Django settings file as a static files directory.
To create a new file for a Django template:
- Create the new
index.ts
inside thesrc
directory corresponding to the Django template, e.g.,src/app/template/index.ts
- Build the file into the
build
directory withbun build-js
- Import the built file into your Django template, e.g.,
<script type="module" src="{% static 'app/template/index.js' %}">
This project is deployed on Heroku, but not configured to automatically deploy on pushes to GitHub. Instead, push directly to Heroku:
# authenticate Heroku CLI
heroku login
# set `heroku` as a remote repository
heroku git:remote -a lg-records
# push directly to Heroku
git push heroku master
The heroku.yml
file runs two commands in the release phase:
python manage.py migrate # untested
python manage.py collectstatic --noinput
If you need to run commands on the production server, check out heroku run
from the Heroku CLI.