|
| 1 | +--- |
| 2 | +sidebar_position: 3 |
| 3 | +--- |
| 4 | + |
| 5 | +# Architecture |
| 6 | + |
| 7 | +## High-Level |
| 8 | + |
| 9 | +AsphaltGhost ist eine mobile Expo App mit Supabase als Backend. |
| 10 | + |
| 11 | +- Frontend: Expo Router + React Native + TypeScript |
| 12 | +- Backend: Supabase (Auth, Postgres, Storage, Edge Functions) |
| 13 | +- Maps: Mapbox (`@rnmapbox/maps`) |
| 14 | +- Data Fetching: React Query |
| 15 | +- Local State: Zustand |
| 16 | + |
| 17 | +## App Routing |
| 18 | + |
| 19 | +Routenstruktur (vereinfacht): |
| 20 | + |
| 21 | +- `app/_layout.tsx` - Root Layout, Auth Guard, Provider |
| 22 | +- `app/(auth)/login.tsx`, `app/(auth)/register.tsx` |
| 23 | +- `app/(tabs)/map.tsx` |
| 24 | +- `app/(tabs)/submit.tsx` |
| 25 | +- `app/(tabs)/feed.tsx` |
| 26 | +- `app/(tabs)/profile.tsx` |
| 27 | +- `app/spot/[id].tsx` |
| 28 | +- `app/post/[id].tsx` |
| 29 | +- `app/profile/[id].tsx` |
| 30 | +- `app/create-post.tsx` |
| 31 | +- `app/moderation.tsx` |
| 32 | +- `app/pick-location.tsx` |
| 33 | + |
| 34 | +## Data Layer |
| 35 | + |
| 36 | +API Layer in `src/api/` kapselt Supabase Zugriff: |
| 37 | + |
| 38 | +- `auth.ts` - Login/Register/Signout |
| 39 | +- `spots.ts` - Spot CRUD, Ratings, Comments, AI-Analyze Call |
| 40 | +- `posts.ts` - Feed, Create Post, Likes, Post Comments |
| 41 | +- `profiles.ts` - Profil und Moderator-Status |
| 42 | + |
| 43 | +Hooks in `src/hooks/` kapseln Query/Mutation Logik (React Query): |
| 44 | + |
| 45 | +- `useSpots`, `useSpotDetail`, `useSubmitSpot` |
| 46 | +- `usePosts`, `useProfile`, `useModeration` |
| 47 | + |
| 48 | +## Security Model |
| 49 | + |
| 50 | +- RLS auf allen Haupttabellen aktiv |
| 51 | +- Owner-basierte Policies fuer User-Content |
| 52 | +- Moderation ueber `moderators` Tabelle und spezielle Spots-Policies |
| 53 | + |
| 54 | +## Native Integration |
| 55 | + |
| 56 | +- Mapbox wird appweit in `src/lib/mapbox.ts` initialisiert |
| 57 | +- Supabase Session wird ueber `expo-secure-store` persistiert (`src/lib/supabase.ts`) |
| 58 | + |
| 59 | +## Non-Goals (MVP) |
| 60 | + |
| 61 | +- Keine komplexe Rollenverwaltung ausser Moderation |
| 62 | +- Kein umfassendes Analytics/Telemetry Setup |
| 63 | +- Kein Production-grade Admin Panel ausser Basis-Moderation-View |
0 commit comments