Adding a new lesson to Nexu is primarily a content task: you create three JSON files, run a seed script to push them to Firestore, and the existing frontend code picks them up automatically. No changes to React components or TypeScript types are needed for a standard lesson that uses the same block structure as Lesson 1.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Stivenz3/Nexu/llms.txt
Use this file to discover all available pages before exploring further.
Create the lesson JSON files
Create a new folder 1.
Based on the Lesson 1 structure:Set 2.
An array of block objects. Copy the structure from 3.
An array of all questions for the lesson. Inline questions reference their parent block via
firestore-seed/lesson_XX/ (replace XX with the two-digit lesson number, e.g. 02) and add three files inside it.1. lesson.json — lesson metadata
Based on the Lesson 1 structure:isActive: false while the content is still being drafted so the lesson does not appear in /ruta for learners.2. blocks.json — ordered block array
An array of block objects. Copy the structure from firestore-seed/lesson_01/blocks.json and update the IDs and content. The typical lesson uses 8 blocks: 1 video, 5 theory, 1 game, 1 exam.3. questions.json — inline and exam questions
An array of all questions for the lesson. Inline questions reference their parent block via blockRef; exam questions reference the exam block (b08_exam).ID naming conventions
| Type | Convention | Example |
|---|---|---|
| Lesson | lesson_NN_slug | lesson_02_control_temperaturas |
| Blocks | bNN_slug | b01_video, b02_modulo_a |
| Inline questions | q_pNi | q_p1i, q_p2i |
| Exam questions | q_eNN | q_e01, q_e15 |
Run the seed script
Coordinate with the team before running. The seed deletes and recreates the lesson in the shared Firestore project Expected output:If The seed script reads credentials via
nexu-156ce.isActive is false in lesson.json, the script also prints:applicationDefault() (from gcloud auth application-default login). If you see Could not load the default credentials, re-run gcloud auth application-default login first. For a full explanation of the three authentication layers, see the DESARROLLO_LECCIONES.md §7 in the repo.What the seed does NOT touch:- User accounts and
lessonProgressdocuments - Certificates already issued
- Firestore security rules
- Vercel hosting / frontend build
Frontend verification (no code changes needed for standard lessons)
The existing frontend components are already wired to handle any lesson that follows the Lesson 1 structure.
The only time you need to touch
| Component | Behaviour |
|---|---|
LearningPathPage | Automatically shows lessons with isActive: true, ordered by order. Lesson N+1 is locked until lesson N has status: 'passed'. |
LessonFlowPage | Renders each block using the registered block-type components (VideoBlockView, TheoryBlockView, GameBlockView). No changes needed for standard block types. |
LessonExamPage | Calls fetchExamQuestions, scores the exam, saves results via saveExamResult, and calls tryIssueCourseCertificateAfterLesson() on pass. No changes needed. |
src/types/lesson.ts is if the new lesson introduces new fields in a block’s content object that don’t exist in the current type definitions.Deploy Firestore rules if needed
If you changed Standard lessons using the existing block types do not require rule changes.
firestore.rules or firestore.indexes.json as part of this lesson (e.g. to add a new index), deploy them before testing:Test the full flow
Log in as a new user (or delete the
lessonProgress document for an existing user) and run through the entire lesson:- Navigate to
/ruta— the lesson should appear with the correct title and order - Click “Empezar” — the first block (
b01_video) should load - Complete the video block — the next block should unlock
- Work through all theory blocks, answering each inline question correctly
- Complete the game block
- Verify the exam block’s “Iniciar evaluación final” button is enabled
- Complete the exam with a score ≥ 70%
- Verify the certificate appears at
/certificado - Return to
/ruta— the lesson should show as completed and the next lesson (if any) should unlock
Checklist
Use this list as a PR checklist when delivering a new lesson:-
lesson.json,blocks.json,questions.jsoncreated infirestore-seed/lesson_XX/and validated against the official PDF -
lesson.isActive: trueandordervalue is correct relative to existing lessons - Seed run on
nexu-156ce(coordinated with team — see Step 2) - Full flow tested end-to-end with a new user: video → theory → game → exam → certificate
- Firestore rules deployed if
firestore.rulesor indexes were changed -
pnpm-lock.yamlupdated (pnpm install --lockfile-only) if any new npm dependencies were added topackage.json