ComuniTEA’s data model is the backbone of every interaction in the app. At its center sits theDocumentation 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.
Pictograma interface — a lightweight object that carries an emoji, a label, a category, and optional pointers to audio and image assets. Pictograms flow from the static board data in features/tablero/data/tablero.ts through the sentence-strip UI, the vocabulary module (VOCABULARY tree), the Zustand stores, and ultimately into Supabase’s sentence_log table when a child plays a constructed phrase. Understanding this model makes it possible to reason about any screen in the app.
Pictograma Interface
The Pictograma is the atomic unit of communication in ComuniTEA. Every item on the AAC board — foods, emotions, actions, people, requests — is represented as a Pictograma.
Unique identifier for the pictogram within the app. Used as the primary key for audio lookup (
getAudioAssets) unless audioAssetKey overrides it, and as the value stored in sentence_log.pictogram_ids when a phrase is saved to Supabase.Unicode emoji rendered as the pictogram’s visual representation on the board. Used as a fallback when no
imageUri is present.Human-readable display text shown beneath the pictogram on the board, and spoken by the TTS engine when the pictogram is tapped in isolation.
The category key this pictogram belongs to (e.g.,
'frutas', 'emociones', 'personas'). Used to group pictograms in the board grid and to filter custom pictograms from Supabase via category_key.Marks a pictogram as a favourite so it can be surfaced in a quick-access row. Defaults to
false in the pic() helper.Optional override for the key used to look up the pre-recorded MP3 file in
getAudioAssets(voice). When omitted, the pictogram’s id is used as the key. This allows an id and its audio file name to differ — for example id: 'auto' maps to audio key 'carro', and id: 'fresa' maps to 'fresas'.Optional URI pointing to a remote or local image — used for custom photo pictograms (the “Mi mundo en fotos” feature) and for people pictograms that display a child’s actual photo. When set, this image is rendered in place of the emoji.
pic() Factory Helper
To avoid constructing Pictograma objects manually, the pic() helper takes positional arguments and omits optional keys when they are undefined or empty strings:
getPictogramAudioKey()
When the audio player needs to resolve which MP3 to play for a given pictogram, it calls this function:
getAudioAssets(voiceProfile) from constants/AudioAssets.ts to retrieve the correct bundled audio asset for the active voice profile.
Subcategoria Interface
A Subcategoria groups related pictograms and maps them to a parent category. The full board is made up of ALL_SUBCATS, an array of Subcategoria objects covering seven default categories.
Unique identifier for the subcategory (e.g.,
'frutas', 'emociones').Display name shown on the subcategory selector tile (e.g.,
'Frutas', 'Emociones').Emoji used as the subcategory’s icon on the grid (e.g.,
'🍎', '😊').Links the subcategory to its parent category. Currently mirrors
id for the default board but is distinct to support future multi-level hierarchies.The ordered list of pictograms displayed when this subcategory is selected on the board.
Default Subcategory Catalog (ALL_SUBCATS)
The static board includes seven default subcategories:
id | nombre | Emoji | Pictogram count |
|---|---|---|---|
frutas | Frutas | 🍎 | 5 |
comida | Comida | 🍽️ | 5 |
juguetes | Juguetes | 🧸 | 4 |
verduras | Verduras | 🥕 | 3 |
golosinas | Golosinas | 🍬 | 3 |
actividades | Actividades | 🎮 | 4 |
emociones | Emociones | 😊 | 4 |
Fixed Communication Rows
Two arrays are pinned to the board at all times and cannot be hidden. They cover the most frequent communicative functions for a child using AAC.PERSONAS_ROW
Displays the child’s key people. Designed to be extended with custom imageUri entries from child_profiles.important_people.
PETICIONES_ROW
Provides the five core communicative functions — requesting, refusing, liking, expressing pain, and asking for help:
Voice and Vocabulary Types
VoiceProfile
Defined in constants/AudioAssets.ts. Controls which set of bundled MP3 recordings is loaded when the app plays pictogram audio.
useSettingsStore (see Stores). getAudioAssets(profile) returns a Record<string, any> mapping pictogram IDs to their corresponding audio assets for the selected voice.
VocabLevel
The vocabulary level gates which items appear in the vocabulary module. Each level is a superset in complexity, not just in size.
| Level | Description |
|---|---|
BASICO | Core words (YO, QUIERO, NO…), top-priority categories (emociones, comida, baño, jugar, dormir, ropa). Designed for children with minimal or no verbal language. |
INTERMEDIO | Adds números, colores, personas, lugares, higiene, mi día — extends vocabulary with two-word combinations. |
AVANZADO | Adds full conversational frames (yo quiero, me gusta, ¿podemos hablar?), escola agenda, verbos, and emergency phrases. |
Vocabulary Module Types
The vocabulary feature uses a separate, richer type tree to support multi-level category navigation.Stable identifier used for co-occurrence tracking and deep linking. Must match
AUDIO_ASSETS keys when the item is a leaf node to be spoken.Display text shown on the vocabulary chip (always uppercase in the static data).
Emoji rendered on the chip alongside the label.
Optional hex color used to tint the chip background — applied to top-level categories to create a colour-coded grid.
Override for the text passed to the TTS engine. When absent,
label is used. Useful for items like 'ME LLAMO...' where the spoken form differs from the visual label.Child items. When present, tapping the item opens a sub-panel rather than adding the item to the sentence strip. Navigation supports a maximum depth of 2 levels.
Vocabulary Utility Functions
findItemById is used by the co-occurrence suggestion system (Phase 2) to look up items by ID anywhere in the vocabulary tree. flattenItems is used when presenting a subcategory’s contents as a flat grid, collapsing any intermediate sub-category nodes.Route Types
All Expo Router routes are centralised intypes/routes.ts to prevent typos and enable IDE auto-complete.
Dynamic Route Helpers
For routes with URL segments, typed helper functions buildHref values:
AsyncStorage Keys (STORAGE_KEYS)
All persistent client-side state uses the keys defined in lib/storage/keys.ts. These are the canonical strings passed to AsyncStorage.getItem / AsyncStorage.setItem across the app and its Zustand persist middleware adapters.
| Key | Raw string | Purpose |
|---|---|---|
VOICE_PREFERENCE | user_voice_preference | Active VoiceProfile — read by settingsStore |
PARENTAL_PIN | parental_pin | 4-digit PIN protecting parental settings |
ELEVEN_CREDITS | eleven_credits | Remaining ElevenLabs TTS credits |
SHOW_KEYBOARD | show_keyboard | Whether the free-text keyboard is shown |
IMAGE_OVERRIDES | image_overrides | Map of pictogram id → custom local image URI |
ONBOARDING_COMPLETED | onboarding_completed | Guards the onboarding flow |
PICTOGRAM_CACHE_META | pictogram_cache_meta | Metadata for the offline pictogram image cache |
OFFLINE_QUEUE | offline_event_queue | Events queued for Supabase upload when offline |
DISABLED_PICTOGRAMS | disabled_pictograms | Pictogram IDs hidden by the parent |
ACTIVE_ENVIRONMENT | active_environment | Current environment context (casa / escuela…) |
CONSENT_ACCEPTED | consent_accepted_at | ISO timestamp of privacy consent acceptance |
PREFERRED_ACTIVITIES | preferred_activities | Child’s preferred activity IDs |
IMPORTANT_PEOPLE | important_people | JSON array of people pictogram configs |
TUTORIAL_COMPLETED | comunitea_tutorial_completed | Main tutorial completion flag |
TUTORIAL_BASIC_COMPLETED | comunitea_tutorial_basic_completed | Basic tutorial completion flag |
EJERCICIOS_G3 | comunitea_ejercicios_g3 | Serialised EjercicioG3State |
EJERCICIOS_G3_COMPLETADOS | ejercicios_g3_completados | 'true' when the full G3 path is complete |
EJERCICIOS_G2 | comunitea_ejercicios_g2 | Serialised EjerciciosG2State |