Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ElthonJohan/comunitea/llms.txt

Use this file to discover all available pages before exploring further.

When a child opens ComuniTEA for the first time — or whenever their profile’s vocabulary level is set — the app runs an interactive onboarding tutorial before routing to the main tablero. The tutorial is short, celebratory, and fully voiced: an animated avatar guide walks the child through the exact interactions they will use every day (tapping a category, tapping a pictogram, building a phrase), ensuring that first contact with the board feels safe and successful rather than overwhelming. The tutorial variant shown depends on the child’s assigned vocabulary level: BASICO (Group 3) gets a simpler drag-and-tap flow; INTERMEDIO and AVANZADO get the standard sentence-building flow.

Tutorial variants

Vocabulary LevelTutorial FlowState Hook
INTERMEDIO / AVANZADOExercise0 → Exercise1 → Exercise2 → Exercise3 → CelebrationScreenuseTutorialState
BASICOExercise0Basic → Exercise1Basic → Exercise2Basic → Exercise3Basic → CelebrationScreenuseTutorialBasicState
Completion is persisted independently for each variant using separate AsyncStorage keys (TUTORIAL_COMPLETED and TUTORIAL_BASIC_COMPLETED). The isTutorialDoneForLevel(level) utility checks the correct key for the child’s profile level.

Standard tutorial flow (Intermediate / Advanced)

1

Exercise 0 — Find the category

The avatar appears with a voice bubble saying: “¡Hola! Bienvenido a ComuniTEA. Vamos a jugar. Toca la categoría de ALIMENTOS para empezar.”A FingerIndicator animation pulses over the Alimentos category tile. If the child taps incorrectly, a FeedbackIncorrect flash appears and the voice says “Intenta otra vez.” A correct tap triggers FeedbackCorrect and the step advances.
2

Exercise 1 — Tap the pictogram

The jugo pictogram is shown in context. Voice: “Mira la imagen de jugo. El niño quiere el jugo. Toquemos el jugo.”The FingerIndicator guides the child to the correct pictogram. Completing this step fills the first tutorial star.
3

Exercise 2 — Make the choice independently

Two or three pictogram options are shown without the pointing finger. Voice: “¿Qué es lo que quieres? Toca el jugo.”This step tests unprompted pictogram selection. Completing it fills the second tutorial star.
4

Exercise 3 — Build a sentence

The sentence builder is shown in two sub-steps:
  • Step 3-1: Voice: “Muy bien. Toca yo quiero.” — child taps the Quiero petición card
  • Step 3-2: Voice: “Ahora toca el jugo.” — child taps the jugo pictogram
When both are complete, the completion voice plays: “Formamos la frase: Yo quiero jugo. ¡Excelente!” This fills the third tutorial star.
5

Celebration screen

CelebrationScreen fires a confetti animation and the playCelebrationNarration() audio plays: “¡Muy bien! Completaste el tutorial. Ya puedes usar la app para comunicarte.”completeTutorial() writes "true" to AsyncStorage, permanently marking the tutorial done. The app then navigates to the main tablero.

Basic tutorial flow (Group 3 / BASICO)

The basic tutorial uses simplified mechanics appropriate for children at PECS Phase I. Each exercise is driven by useTutorialBasicState and routed to the Exercise*Basic components.
1

Exercise 0 Basic — Tap the category

Voice: “¡Hola! Bienvenido a ComuniTEA. Vamos a jugar. Toca la categoría de ALIMENTOS para empezar.” Same as the standard tutorial — a large, single-target category tile. There is no incorrect feedback state at this step.
2

Exercise 1 Basic — Tap the apple

A large apple pictogram is presented. Voice: “Mira la manzana. Toquemos la manzana.” On success: “¡Muy bien, hemos tocado la manzana!” Completing this step fills 2 stars (starSlots: 2).
3

Exercise 2 Basic — Match the apple

The child sees two pictograms and must tap the matching apple. Voice: “Mira la manzana. Toca la misma manzana.” This is the first exercise in the basic flow with an error path (b_ex2_incorrect): on an incorrect tap the voice says “Intentemos otra vez.”
4

Exercise 3 Basic — Drag to mouth

Uses the DragDropArea component — the child drags the apple pictogram to a target zone. Voice: “Muy bien. Arrastremos la manzana. Llévala a la boca.” On completion: “¡Excelente, lo has logrado!”
5

Celebration

Voice: “¡Muy bien! Completaste el tutorial. Ya practicaste tocar, elegir y arrastrar.” completeTutorialBasic() writes "true" to TUTORIAL_BASIC_COMPLETED in AsyncStorage.

Tutorial state management

useTutorialState

Manages the step machine for the standard tutorial. The TutorialStep union type covers every named state in the flow:
export type TutorialStep =
  | 'ex0_base'    | 'ex0_correct'   | 'ex0_incorrect'
  | 'ex1_base'    | 'ex1_correct'   | 'ex1_incorrect'
  | 'ex2_base'    | 'ex2_correct'   | 'ex2_incorrect'
  | 'ex3_step1'   | 'ex3_step2'     | 'ex3_incorrect' | 'ex3_complete'
  | 'celebration';

export function useTutorialState(): {
  currentStep: TutorialStep;
  setCurrentStep: (step: TutorialStep) => void;
  attempts: Record<string, number>;
  bumpAttempt: (exerciseKey: string) => void;
  /** 0–3: number of stars to show as filled in the header */
  starsFilled: number;
  completeTutorial: () => Promise<void>;
}
starsFilled is a derived value computed from currentStep: it starts at 0, increments to 1 after ex1_correct, 2 after ex2_correct, and 3 at ex3_complete / celebration.

useTutorialBasicState

Same pattern for the basic tutorial, using a separate TutorialStepBasic union:
export type TutorialStepBasic =
  | 'b_ex0_base'    | 'b_ex0_correct'
  | 'b_ex1_base'    | 'b_ex1_correct'
  | 'b_ex2_base'    | 'b_ex2_correct'  | 'b_ex2_incorrect'
  | 'b_ex3_base'    | 'b_ex3_correct'  | 'b_ex3_incorrect'
  | 'b_celebration';

export function useTutorialBasicState(): {
  currentStep: TutorialStepBasic;
  setCurrentStep: (step: TutorialStepBasic) => void;
  attempts: Record<string, number>;
  bumpAttempt: (exerciseKey: string) => void;
  starSlots: 2 | 3;
  starsFilled: number;
  completeTutorialBasic: () => Promise<void>;
}
The star system for the basic flow uses both starSlots (2 or 3) and starsFilled to reflect the variable exercise length. Note that the basic flow has no b_ex0_incorrect state — the first category tap in Exercise 0 Basic has no error path.

Interactive UI components

ComponentRole
TutorialAvatarAnimated character that reacts to correct/incorrect attempts with emoji expressions
VoiceBubbleAnimated speech bubble displaying the current instruction text
FingerIndicatorBouncing finger animation that points to the correct tap target during guided steps
FeedbackCorrectFull-screen green flash + checkmark shown after a correct tap
FeedbackIncorrectFull-screen red border flash shown after an incorrect tap
TutorialHeaderProgress bar with star slots reflecting starsFilled
TutorialStepGeneric wrapper managing the step transition animation
CelebrationScreenConfetti screen shown at tutorial completion
DragDropAreaDrag-and-drop zone used exclusively in Exercise 3 Basic

Voice in the tutorial (useTutorialVoice)

The useTutorialVoice hook coordinates tutorial audio. It prefers bundled MP3 clips from assets/audio/tutorial-g1-g2/ (standard) or assets/audio/tutorial-g3/ (basic), and falls back gracefully to on-device expo-speech TTS if a clip is missing or fails to load.
export function useTutorialVoice(): {
  speak: (text: string) => Promise<void>;
  speakWithDelay: (text: string, delayMs: number) => Promise<void>;
  speakBasicWithDelay: (text: string, delayMs?: number) => Promise<void>;
  /** Plays the bundled clip for a TutorialStep, or falls back to TTS. */
  speakForStep: (step: TutorialStep) => Promise<void>;
  /** Plays the bundled clip for a TutorialStepBasic, or falls back to TTS. */
  speakForBasicStep: (step: TutorialStepBasic) => Promise<void>;
  /** Plays the bundled celebration narration clip. */
  playCelebrationNarration: () => Promise<void>;
  stopAll: () => void;
}
TTS options differ by tutorial variant — the basic tutorial uses a slower rate (0.75) and slightly higher pitch (1.15) compared to the standard tutorial (rate: 0.85, pitch: 1.1) for clearer, more deliberate speech delivery to children with higher support needs. The complete set of TTS fallback scripts is exported from features/tutorial/data/voice/tutorial.ts:
export const TUTORIAL_STEP_SCRIPTS = {
  ex0_base:     '¡Hola! Bienvenido a ComuniTEA. Vamos a jugar. Toca la categoría de ALIMENTOS para empezar.',
  ex0_correct:  '¡Muy bien!',
  ex0_incorrect:'Intenta otra vez.',
  ex1_base:     'Mira la imagen de jugo. El niño quiere el jugo. Toquemos el jugo.',
  ex1_correct:  '¡Muy bien!',
  ex1_incorrect:'Intenta otra vez.',
  ex2_base:     '¿Qué es lo que quieres? Toca el jugo.',
  ex2_correct:  '¡Muy bien!',
  ex2_incorrect:'Intenta otra vez.',
  ex3_step1:    'Muy bien. Toca yo quiero.',
  ex3_step2:    'Ahora toca el jugo.',
  ex3_incorrect:'Intenta otra vez.',
  ex3_complete: 'Formamos la frase: Yo quiero jugo. ¡Excelente!',
} as const;

Re-running the tutorial

Once completed, the tutorial does not re-appear automatically. Caregivers can re-launch it at any time from the Settings screen. Tapping the re-run option clears the relevant AsyncStorage key (TUTORIAL_COMPLETED or TUTORIAL_BASIC_COMPLETED), which causes isTutorialDoneForLevel() to return false on the next app load, routing the child through the full tutorial sequence again.
Re-running the tutorial can be helpful after a long break or when introducing the app to a new caregiver or classroom aide. The child’s exercise progress and tablero favorites are not affected.

Build docs developers (and LLMs) love