Setup
Dieses Dokument beschreibt das lokale Setup fuer die AsphaltGhost App (Expo + Supabase + Mapbox) auf Windows.
Voraussetzungen
- Node.js 20.x (LTS)
- npm
- JDK 17
- Android Studio (inkl. SDK, Emulator, Platform-Tools)
- Supabase Projekt
- Mapbox Access Token
Projekt starten
- Repository klonen:
git clone --recurse-submodules git@github.com:AsphaltGhost/base-app.git
- In den Projektordner wechseln:
cd base-app
- Dependencies installieren:
npm install
.env.examplenach.envkopieren und Werte setzen:EXPO_PUBLIC_SUPABASE_URLEXPO_PUBLIC_SUPABASE_ANON_KEYEXPO_PUBLIC_MAPBOX_ACCESS_TOKEN
- Google Maps API Key (für Karten-Tab): In
app.jsonden Platzhalter ersetzen:- iOS:
expo.ios.config.googleMapsApiKey→ dein Key - Android:
expo.android.config.googleMaps.apiKey→ dein Key - Key erstellen: Google Cloud Console → APIs & Services → Credentials → API Key. APIs aktivieren: Maps SDK for Android, Maps SDK for iOS.
- Ohne gültigen Key bleibt die Karte blau/leer (nur „Google“ sichtbar).
- iOS:
Android Umgebungsvariablen (PowerShell)
$env:ANDROID_HOME="C:\Users\quent\AppData\Local\Android\Sdk"
$env:ANDROID_SDK_ROOT="C:\Users\quent\AppData\Local\Android\Sdk"
$env:Path="$env:ANDROID_HOME\platform-tools;$env:ANDROID_HOME\emulator;$env:Path"
Wenn Gradle das SDK nicht findet, in android/local.properties setzen:
sdk.dir=C:/Users/quent/AppData/Local/Android/Sdk
Dev Client Build (Mapbox erforderlich)
Mapbox benoetigt einen Dev Build (Expo Go reicht nicht).
- Android Dev Build bauen und installieren:
npx expo run:android
- Metro fuer Dev Client starten:
npx expo start --dev-client
Supabase Basis
Im SQL Editor in Reihenfolge ausfuehren:
supabase/migrations/0001_init_schema.sqlsupabase/migrations/0002_rls_policies.sqlsupabase/migrations/0003_storage_buckets.sqlsupabase/migrations/0004_spot_rating_aggregates_trigger.sqlsupabase/migrations/0005_profile_on_signup.sqlsupabase/migrations/0006_spot_moderation_policy.sqlsupabase/migrations/0007_mvp_auth_and_moderation_hardening.sqlsupabase/migrations/0008_moderation_policy_finalize.sql
Edge Function Deployment
- Supabase CLI login/link:
supabase loginsupabase link --project-ref <project-ref>
- Secret setzen:
supabase secrets set OPENAI_API_KEY=<key>
- Function deployen:
supabase functions deploy analyze-spot
Auth Redirects
In Supabase -> Authentication -> URL Configuration:
- Redirect URL:
asphaltghost://login - Optional fuer Dev:
exp+asphaltghost://**