How lorenzopietrangelo/openworkout-engine works
OpenWorkout Engine builds deterministic weekly workout plans from training days, muscle priorities, session limits, equipment, and experience level. The main workflow runs through either the web interface and REST API or the Python script: inputs are validated, the engine schedules muscles and selects exercises, then adjusts sets and returns JSON or CSV. The README also documents advanced muscle regions, supersets, and unilateral variants. Source excerpts show API orchestration and engine behavior; some README-described details are not independently traced through unsampled code.
Main entry points: service.py Plan and export service · app.py FastAPI app · main.py Python script · engine.py Planning and optimization
Components 11
User interfaces
- Web interface
frontend/app.js - Python script
main.py
REST API
- FastAPI app
api_wrapper/app.py - Catalog routes
api_wrapper/routers/catalogo.py - Plan routes
api_wrapper/routers/scheda.py - Request and response models
api_wrapper/schemas.py - Plan and export service
api_wrapper/service.py
Workout engine
- Planning and optimization
engine.py
Workout domain
- Exercise catalog
execises.py - Workout data model
exercise_model.py
Other components
- Trainee
Connections 19
- Trainee → Web interface: sets preferences
README.md - Web interface → FastAPI app: calls API
frontend/app.js - FastAPI app → Catalog routes: registers routes
api_wrapper/app.py - FastAPI app → Plan routes: registers routes
api_wrapper/app.py - FastAPI app → Web interface: serves interface
api_wrapper/app.py - Catalog routes → Plan and export service: loads catalog
api_wrapper/routers/catalogo.py - Catalog routes → Workout data model: uses enums
api_wrapper/routers/catalogo.py - Plan routes → Request and response models: validates and responds
api_wrapper/routers/scheda.py - Plan routes → Plan and export service: requests plan or CSV
api_wrapper/routers/scheda.py - Plan and export service → Planning and optimization: builds and optimizes
api_wrapper/service.py - Plan and export service → Exercise catalog: uses exercises
api_wrapper/service.py - Plan and export service → Request and response models: builds API output
api_wrapper/service.py - Planning and optimization → Exercise catalog: selects exercises
engine.py - Planning and optimization → Workout data model: uses workout types
engine.py - Exercise catalog → Workout data model: defines exercises
execises.py - Python script → Planning and optimization: builds and optimizes
main.py - Python script → Exercise catalog: uses exercises
main.py - Python script → Workout data model: sets input types
main.py - Trainee → Python script: configures inputs
README.md