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.

Getting ComuniTEA running locally takes only a handful of steps. The app is a standard Expo managed-workflow project — once you have Node.js, a Supabase project, and an emulator or physical device ready, you will have a fully functional dev build including the communication board, exercises, audio playback, and authentication. The only external service you need to start is Supabase; ElevenLabs TTS is optional because all pictogram audio ships as bundled MP3 files.
1
Install Prerequisites
2
Make sure the following tools are available on your machine before cloning:
3
  • Node.js 18 or laternodejs.org
  • npm (bundled with Node.js)
  • Expo CLI — install globally:
  • 4
    npm install -g expo-cli
    
    5
  • Android Emulator or iOS Simulator — set up via Android Studio / Xcode, or install Expo Go on a physical device for the fastest start.
  • 6
    On macOS, running npx expo start --ios will open the iOS Simulator automatically if Xcode Command Line Tools are installed.
    7
    Clone the Repository
    8
    git clone https://github.com/ElthonJohan/comunitea.git
    cd comunitea
    
    9
    Install Dependencies
    10
    npm install
    
    11
    This installs all JavaScript and native dependencies declared in package.json, including Expo SDK 57, React Native 0.86, Expo Router, Zustand, the Supabase JS client, and all audio/camera modules.
    12
    Create a Supabase Project
    13
  • Go to supabase.com and sign in (or create a free account).
  • Click New project and fill in a name and database password.
  • Once the project is provisioned, open Project Settings → API.
  • Copy two values you will need in the next step:
    • Project URL — looks like https://<your-project-ref>.supabase.co
    • anon / public key — the long JWT string under “Project API keys”
  • 14
    Configure Environment Variables
    15
    Create a .env.local file in the project root:
    16
    # .env.local
    EXPO_PUBLIC_SUPABASE_URL=https://<your-project-ref>.supabase.co
    EXPO_PUBLIC_SUPABASE_ANON_KEY=<your-anon-key>
    
    17
    These two variables are read directly by lib/supabase.ts, which initialises the Supabase client and stores the auth session in expo-secure-store:
    18
    // lib/supabase.ts
    import 'react-native-url-polyfill/auto';
    import * as SecureStore from 'expo-secure-store';
    import { createClient } from '@supabase/supabase-js';
    
    const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL;
    const supabaseAnonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY;
    
    if (!supabaseUrl || !supabaseAnonKey) {
        throw new Error(
            '[ComuniTEA] Faltan variables de entorno requeridas.\n' +
            'Asegúrate de que tu archivo .env tenga:\n' +
            '  EXPO_PUBLIC_SUPABASE_URL=https://<tu-proyecto>.supabase.co\n' +
            '  EXPO_PUBLIC_SUPABASE_ANON_KEY=<tu-anon-key>'
        );
    }
    
    const SecureStoreAdapter = {
        getItem: (key: string) => SecureStore.getItemAsync(key),
        setItem: (key: string, value: string) => SecureStore.setItemAsync(key, value),
        removeItem: (key: string) => SecureStore.deleteItemAsync(key),
    };
    
    export const supabase = createClient(supabaseUrl!, supabaseAnonKey!, {
        auth: {
            storage: SecureStoreAdapter,
            autoRefreshToken: true,
            persistSession: true,
            detectSessionInUrl: false,
        },
    });
    
    19
    Never commit .env.local to version control. It is already listed in .gitignore. The variables prefixed with EXPO_PUBLIC_ are inlined at build time and visible in the JS bundle — use only the public anon key here, never the service_role key.
    20
    Run Database Migrations
    21
    The database schema is split into an initial schema file and a series of numbered migration files. Apply them in order against your Supabase project using the Supabase CLI:
    22
    # Install the Supabase CLI (if not already installed)
    npm install -g supabase
    
    # Link to your remote project (paste your project ref when prompted)
    supabase link --project-ref <your-project-ref>
    
    # Push all migrations to the remote database
    supabase db push
    
    23
    The migrations in supabase/migrations/ are applied in timestamp order. Key schema objects they create include:
    24
    MigrationWhat it addsphase1_tasks_usage_level.sqlusage_stats table, task loggingphase4_custom_pictograms_category_key.sqlCustom pictogram storage referencesphase7_ai_expand_stat.sqlAI Magic Expand usage trackingphase8_sentence_log.sqlSentence strip history loggingparental_settings.sqlParental gate PIN and sensory configphase1_child_profiles.sqlChild profile, level, and onboarding statephase5_game_sublevel.sqlGame mode sub-level progressphase8_ai_engine.sqlAI adaptation and vocabulary suggestion tableschild_progress.sqlConsolidated progress tracking per child
    25
    If you prefer to apply migrations manually via the Supabase Studio SQL editor, open each file in supabase/migrations/ in ascending filename order and run the SQL directly.
    26
    Start the Development Server
    27
    npm run dev
    
    28
    This runs EXPO_NO_TELEMETRY=1 expo start. Scan the QR code with Expo Go, or press a for Android emulator / i for iOS Simulator.
    29
    If you encounter stale Metro bundler cache issues (common after audio asset changes), clear the cache:
    30
    npx expo start -c
    
    31
    You should land on the login screen. Create an account — Supabase email auth is enabled with enable_confirmations = false in the local config, so no email confirmation is required in development.
    32
    (Optional) Enable ElevenLabs TTS
    33
    For on-demand neural voice synthesis beyond the bundled MP3 files, deploy the elevenlabs-tts Supabase Edge Function and set the API key as a secret:
    34
    # Deploy the edge function
    supabase functions deploy elevenlabs-tts
    
    # Set the ElevenLabs API key as a Supabase secret
    supabase secrets set ELEVENLABS_API_KEY=<your-elevenlabs-api-key>
    
    35
    The function lives at supabase/functions/elevenlabs-tts/index.ts and is called by the app when the user requests TTS synthesis for a custom utterance.
    36
    ElevenLabs TTS is entirely optional for development and offline use. All pictogram audio — across all vocabulary categories (comida, emociones, jugar, social, colores, ropa, and many more) — is pre-generated and bundled in assets/audio/femenina/ and assets/audio/masculina/. The app plays these MP3 files locally without any network call, so the full communication board works without internet connectivity.

    Next Steps

    Once the dev server is running, complete the first-run flow: choose a voice profile (femenina or masculina), complete the onboarding wizard, and walk through the interactive tutorial. Then explore the communication board and try building a sentence with the pictogram strip.

    Build docs developers (and LLMs) love