Eco-Ed is an Expo/React Native learning app with:
- lesson + quiz flow
- gamified progress (XP, streaks, daily challenges)
- role-based navigation
- Supabase-backed cloud persistence
Install dependencies and start Expo:
npm install
npx expo startCreate .env from .env.example and set:
EXPO_PUBLIC_SUPABASE_URL=your-project-url
EXPO_PUBLIC_SUPABASE_ANON_KEY=your-anon-keyKeep EXPO_PUBLIC_API_BASE_URL empty if you want direct Supabase mode.
Then run supabase/schema.sql in Supabase SQL Editor.
Important:
- Enable Anonymous Sign-Ins in Supabase Auth (
Authentication -> Providers -> Anonymous) for the current app bootstrap flow. - The app resolves a Supabase user session, then syncs
user_progress(progress_map+gamification_state) automatically.
Open the app and go to Settings:
- check
Cloud Sync Enabled - check
Cloud Sync Status - confirm
Cloud User IDis populated
You can also use the Courses screen buttons:
Pull CloudPush Cloud
Set public env vars for each EAS environment you use:
eas env:create --name EXPO_PUBLIC_SUPABASE_URL --value "https://<project-ref>.supabase.co" --environment preview
eas env:create --name EXPO_PUBLIC_SUPABASE_ANON_KEY --value "<anon-key>" --environment preview
eas env:create --name EXPO_PUBLIC_SUPABASE_URL --value "https://<project-ref>.supabase.co" --environment production
eas env:create --name EXPO_PUBLIC_SUPABASE_ANON_KEY --value "<anon-key>" --environment productionThen build/update normally (npm run draft, npm run deploy, or eas build ...).
If no Supabase and no REST backend config is present:
- lessons load from local curriculum fallback
- progress persists only in device
AsyncStorage - no cross-device sync
If you want to test Teacher/Admin lesson editing without a backend or account:
- Set
EXPO_PUBLIC_ALLOW_LOCAL_ADMIN=true - The admin screen will use local AsyncStorage for create/edit/publish/delete
- Student views will read from the same local curriculum store
If Supabase auth is blocking your presentation, you can disable backend calls entirely:
- Set
EXPO_PUBLIC_DISABLE_BACKEND=true - The app runs fully on local data (curriculum + progress)
To verify your public (anon) keys can read published lessons, create a local .env from .env.example and run the included test script:
# install deps if needed
npm install
# run the test (environment variables loaded from your shell or .env via dotenv)
EXPO_PUBLIC_SUPABASE_URL="https://<project-ref>.supabase.co" \
EXPO_PUBLIC_SUPABASE_ANON_KEY="<anon-key>" \
node scripts/test-supabase-connection.jsIf the query returns published lessons, your anon key and RLS read policy are configured correctly.