Every time you finish a training session in KERN, the app compiles a complete snapshot of your performance — every exercise, every set, every weight — and sends it to the API. That record is what powers the progression hints you see the next time you open the same routine.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jaimegayo/KERNDOCUMENTATION/llms.txt
Use this file to discover all available pages before exploring further.
The WorkoutSession model
Each completed session is persisted as aWorkoutSession row in the database. The table schema is defined in models.py:
Session identity
id (primary key), user_id (foreign key to users), routine_name (string copy of the routine name at the time of the session), created_at (server timestamp).Performance data
duration_seconds (integer), total_volume (float — sum of kg × reps), steps (integer — from the step counter service), data_json (JSON — full exercise and series snapshot).The active workout screen
When you open a routine, KERN callsGET /routines/{routine_id}. The response includes historical data from your last session alongside the current exercise structure.
Each series object in the response carries four fields relevant to progression:
| Field | Type | Description |
|---|---|---|
anterior | string | Human-readable hint, e.g. "60kg x 10". Displayed in the UI. |
prev_kilos | float | Numeric weight from the last session. Pre-fills the input field. |
prev_reps | int | Numeric rep count from the last session. Pre-fills the input field. |
kilos / reps | int | Always sent as 0 — you enter new values during the session. |
Volume calculation
Total volume is the sum ofkilos × reps for every completed series in the session. The Android app (WorkoutActiveFragment) calculates this in real time via the ActiveExerciseAdapter.OnVolumenChangeListener callback and updates the header counter as you mark sets done.
The final value is included in the POST /workouts/finish payload as total_volume.
Finishing a session
When you tap “Finish workout”, the app callsPOST /workouts/finish with the WorkoutSessionCreate schema:
Only series where
isDone = true are included in data_json. Empty exercises (no completed series) are filtered out on the client before the request is sent.Rest timer
After you mark a set as complete, the rest timer activates automatically. It is managed byRoutineViewModel and displayed via a dialog in WorkoutActiveFragment. You can adjust the duration in 15-second increments using the +15 and -15 buttons, or reset it entirely. An audio tone plays when time runs out.
Historical matching logic
When loading a routine, KERN matches series from your last session to the current routine’s series using two strategies:Match by numSerie (primary)
The API builds a map of
numSerie → series data from the last session. For each current series, it looks up the same numSerie value in that map. This is the preferred path because series numbers survive routine edits.