109 lines
No EOL
3 KiB
Markdown
109 lines
No EOL
3 KiB
Markdown
# 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
|
|
|
|
1. **Template Selection**: Choose Chest, Back, or Legs workout
|
|
2. **Exercise Dropdowns**: Primary, Secondary, Core categories
|
|
3. **Block Generation**: Creates 4 sets per selected exercise
|
|
4. **Ad-hoc Exercises**: Add individual exercises on the fly
|
|
5. **Workout Logging**: Saves all completed sets to history
|
|
6. **Mobile Optimization**: Hides non-essential columns, touch-friendly UI
|
|
|
|
## Getting Started
|
|
|
|
### Local Development
|
|
|
|
```bash
|
|
# 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
|
|
|
|
```bash
|
|
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 |