KERN’s onboarding flow is linear by design: register to get a token, complete the quiz to generate a routine, then start training. The steps below walk you through the full sequence using real API calls. Every protected endpoint requires theDocumentation 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.
Authorization: Bearer <token> header returned in step 1.
All examples below target the production API hosted on Vercel. Replace the base URL with
http://localhost:8002 if you are running the backend locally.Register and get your access token
Send a If the username or email is already taken, the API returns
POST /register request with your username, email, and password. The API hashes the password with SHA-256, creates a user record, and returns a signed JWT immediately — no separate login step needed.HTTP 400 with "El usuario o email ya existe".Complete the fitness quiz
Send a
POST /users/complete-quiz with your chosen routine type. This sets has_completed_quiz to true on your user record and triggers automatic routine generation: the backend reads ROUTINE_CONFIGS for the selected type, queries exercises_gym_id.json to select one exercise per movement pattern, and writes RoutineExercise rows to the database.Available routine values:| Value | Exercises generated |
|---|---|
"Full Body" | 5 exercises — horizontal push, vertical pull, squat, vertical push, hip hinge |
"PPL (Push Pull Leg)" | 8 exercises — chest, upper chest, shoulders, back (vertical + horizontal), biceps, quads, hamstrings |
"Torso-Pierna" | 6 exercises — chest (two patterns), back (two patterns), squat, hip hinge |
Fetch your generated routine
Retrieve all routines for the authenticated user with Note the routine
GET /users/my-routines. The response is an array of routine objects, each containing its id, name, creation timestamp, and a list of exercises with their default series (three sets at 0 kg × 10 reps).id — you will use it to start a workout in the next step.Start a workout and view historical suggestions
Before recording a session, fetch the detailed routine view with
GET /routines/{id}. This endpoint enriches each series with data from your most recent WorkoutSession for that routine: prev_kilos and prev_reps are numeric values for pre-filling input fields; anterior is a human-readable string (e.g. "60.0kg x 8") shown as a visual suggestion.Finish the workout and save your session
When all exercises are done, send The session is now saved to
POST /workouts/finish. Include the routine name, duration in seconds, total volume (kilograms × repetitions summed across all completed sets), step count recorded by the device sensor, and a data_json snapshot of every exercise and series.The data_json array becomes the source of truth for prev_kilos and prev_reps in all future sessions for this routine.workout_sessions. The next time you call GET /routines/7, each series will reflect the kilos and reps you just submitted.What’s next
Architecture
Understand how the FastAPI backend, Android client, and PostgreSQL schema fit together.
API reference
Full endpoint documentation including avatar updates, username changes, and workout history.