3 KiB
3 KiB
Zed Workouts
A Django-based workout tracking web app optimized for mobile use. Track your gym sessions with template-based exercise generation and automatic history logging.
Project Structure
zed_workouts/
├── tracker/
│ ├── migrations/ # Database migrations
│ ├── templates/tracker/
│ │ └── index.html # Main workout tracking UI
│ ├── admin.py # Django admin configuration
│ ├── apps.py # App configuration
│ ├── models.py # Database models
│ ├── tests.py # Unit tests
│ ├── urls.py # App URL routing
│ └── views.py # View controllers
└── zed_workouts/
├── settings.py # Django settings
├── urls.py # Project URL routing
└── wsgi.py # WSGI entry point
Tech Stack
- Backend: Django 4.x (Python)
- Frontend: Vanilla JavaScript + Bootstrap 5
- Database: SQLite (default, easily swappable)
- Deployment: Docker
Data Models
Exercise
Stores available exercises with type and group categorization.
| Field | Type | Description |
|---|---|---|
| exercise | CharField | Exercise name (unique) |
| type | CharField | Muscle group (Chest, Back, Arms, etc.) |
| group | CharField | Priority (Primary, Secondary, Core) |
Workout (History)
Logs completed workout sets.
Template Models
Templates for each workout type: ChestTemplate, BackTemplate, LegsTemplate
| Field | Type | Description |
|---|---|---|
| date | DateField | Auto-set to creation date |
| group | CharField | Primary/Secondary/Core |
| type | CharField | Muscle group |
| exercise | CharField | Exercise name |
| set | IntegerField | Set number (1-4) |
| weight | DecimalField | Weight lifted |
| reps | IntegerField | Repetitions performed |
| notes | TextField | Optional notes |
Features
- Template Selection: Choose Chest, Back, or Legs workout
- Exercise Dropdowns: Primary, Secondary, Core categories
- Block Generation: Creates 4 sets per selected exercise
- Ad-hoc Exercises: Add individual exercises on the fly
- Workout Logging: Saves all completed sets to history
- Mobile Optimization: Hides non-essential columns, touch-friendly UI
Getting Started
Local Development
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# or .venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Run migrations
cd zed_workouts
python manage.py migrate
# Create superuser (optional, for admin)
python manage.py createsuperuser
# Start server
python manage.py runserver
Docker Deployment
docker-compose up --build
API Endpoints
| URL | View | Method | Description |
|---|---|---|---|
/ |
workout_tracker | GET/POST | Main tracker page |
Notes
- Data submitted via form POST as hidden input arrays
- Templates are pre-populated via JSON context
- Mobile view hides Group/Type columns to save space