Skip to content

Commit 4b67add

Browse files
committed
feat: add initial Docusaurus setup with configuration, documentation structure, and deployment workflow
1 parent 9bec2f8 commit 4b67add

18 files changed

Lines changed: 19242 additions & 0 deletions

.github/workflows/deploy.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy Docusaurus to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
name: Build Site
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: npm
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Build documentation
36+
run: npm run build
37+
38+
- name: Setup Pages
39+
uses: actions/configure-pages@v5
40+
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: build
45+
46+
deploy:
47+
name: Deploy to GitHub Pages
48+
runs-on: ubuntu-latest
49+
needs: build
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
steps:
54+
- name: Deploy
55+
id: deployment
56+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
build
3+
.docusaurus
4+
*.log

README.md

624 Bytes
Binary file not shown.

docs/architecture.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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

docs/database.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# Database
6+
7+
## Uebersicht
8+
9+
PostgreSQL Schema liegt in Supabase, Migrationen im Repo unter `supabase/migrations/`.
10+
11+
Haupttabellen:
12+
13+
- `profiles`
14+
- `spots`
15+
- `spot_ratings`
16+
- `posts`
17+
- `post_likes`
18+
- `comments`
19+
- `moderators`
20+
21+
## Migration Reihenfolge
22+
23+
1. `0001_init_schema.sql`
24+
2. `0002_rls_policies.sql`
25+
3. `0003_storage_buckets.sql`
26+
4. `0004_spot_rating_aggregates_trigger.sql`
27+
5. `0005_profile_on_signup.sql`
28+
6. `0006_spot_moderation_policy.sql`
29+
7. `0007_mvp_auth_and_moderation_hardening.sql`
30+
8. `0008_moderation_policy_finalize.sql`
31+
32+
## RLS / Rollen
33+
34+
- Alle Kern-Tabellen haben RLS aktiv.
35+
- User koennen eigenen Content erstellen.
36+
- Spot-Moderation erfolgt ueber `moderators`.
37+
- Nicht-moderierte Spots sind `pending`.
38+
39+
## Wichtige Trigger/Funktionen
40+
41+
- `handle_new_user_profile()`:
42+
- erstellt Profil nach Signup automatisch
43+
- `refresh_spot_rating_stats(...)` + Trigger:
44+
- synchronisiert `avg_rating` und `rating_count` in `spots`
45+
46+
## Storage Buckets
47+
48+
- `spot-photos` (public)
49+
- `post-photos` (public)
50+
- `avatars` (public)
51+
52+
## Edge Functions
53+
54+
- `analyze-spot`
55+
- Input: `imageBase64`
56+
- Output: `surface`, `size`, `description`, `obstacles`
57+
58+
## Betriebsnotiz
59+
60+
Nach jeder neuen Migration:
61+
62+
- SQL in Supabase ausfuehren
63+
- bei Policy-Aenderungen Spot- und Feed-Flows kurz smoke-testen

docs/decisions.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
sidebar_position: 7
3+
---
4+
5+
# Decisions (ADR Light)
6+
7+
Dieses Dokument haelt wichtige Architekturentscheidungen fest.
8+
9+
---
10+
11+
## D-001: Expo Router statt manuelle Navigation
12+
13+
- Status: Accepted
14+
- Kontext: Schnelle MVP-Iteration mit file-based routing.
15+
- Entscheidung: Expo Router als Routing-Standard.
16+
- Konsequenz: Routenstruktur direkt im `app/` Ordner.
17+
18+
## D-002: Supabase als Full-Backend
19+
20+
- Status: Accepted
21+
- Kontext: Auth + DB + Storage + Edge Functions aus einer Hand.
22+
- Entscheidung: Supabase fuer MVP Kern.
23+
- Konsequenz: RLS muss sauber gepflegt werden.
24+
25+
## D-003: Mapbox als Karten-Stack
26+
27+
- Status: Accepted
28+
- Kontext: Auto-Community braucht starke Kartenfunktion.
29+
- Entscheidung: `@rnmapbox/maps` mit Dev Client.
30+
- Konsequenz: Kein Expo Go-only Workflow fuer Kartenfeatures.
31+
32+
## D-004: Moderation via DB-Rolle (moderators Tabelle)
33+
34+
- Status: Accepted
35+
- Kontext: Pending Spot Freigabe darf nicht offen fuer alle sein.
36+
- Entscheidung: Moderation role-basiert per `moderators` Tabelle und RLS.
37+
- Konsequenz: mindestens ein Moderator muss in DB vorhanden sein.
38+
39+
## D-005: KI Spot Analyse via Supabase Edge Function
40+
41+
- Status: Accepted
42+
- Kontext: Feature 6 als Differenzierung im MVP.
43+
- Entscheidung: `analyze-spot` Edge Function ruft OpenAI Vision auf.
44+
- Konsequenz: Secret Management (`OPENAI_API_KEY`) erforderlich.
45+
46+
## D-006: Auth Session in Secure Store
47+
48+
- Status: Accepted
49+
- Kontext: Mobile Token-Persistenz sicherer als AsyncStorage.
50+
- Entscheidung: Supabase Auth Storage Adapter auf `expo-secure-store`.
51+
- Konsequenz: Native Dependency und Dev Build erforderlich.

docs/deployment.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# Deployment
6+
7+
## Zielbild
8+
9+
Kurzfristig: interne Android Beta (Dev Client / APK).
10+
Spaeter: Store-Release fuer Android und iOS via EAS.
11+
12+
## Lokaler Build (Android Dev)
13+
14+
- `npx expo run:android`
15+
- `npx expo start --dev-client`
16+
17+
## EAS Vorbereitung
18+
19+
1. EAS Login:
20+
- `eas login`
21+
2. Projekt konfigurieren:
22+
- `eas build:configure`
23+
3. Build Profile in `eas.json` pruefen:
24+
- `development`
25+
- `preview`
26+
- `production`
27+
28+
## EAS Build Beispiele
29+
30+
- Development:
31+
- `eas build --profile development --platform android`
32+
- Preview:
33+
- `eas build --profile preview --platform android`
34+
- Production:
35+
- `eas build --profile production --platform all`
36+
37+
## Supabase Deployment
38+
39+
### Migrationen
40+
41+
- per SQL Editor ausfuehren oder via Supabase CLI Workflow.
42+
43+
### Edge Function
44+
45+
1. Secret setzen:
46+
- `supabase secrets set OPENAI_API_KEY=<key>`
47+
2. Deploy:
48+
- `supabase functions deploy analyze-spot`
49+
50+
## GitHub Pages (docs-site)
51+
52+
Die Docusaurus Site wird ueber den Workflow `docs-site/.github/workflows/deploy.yml` bei Push auf `main` deployed.
53+
54+
Voraussetzungen im `documentation` Repo:
55+
56+
- `Settings -> Pages -> Build and deployment -> Source: GitHub Actions`
57+
- Schreibrechte fuer GitHub Actions (Standard fuer Repository Workflows)
58+
59+
## Go-Live Check vor Beta
60+
61+
- Auth Signup/Login laeuft
62+
- Map zeigt approved Spots
63+
- Submit erstellt pending Spot
64+
- Moderation kann pending -> approved/rejected setzen
65+
- Feed Create/Like/Comment laeuft
66+
- KI Analyse liefert verwertbare Felder

docs/design.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
5+
# Design
6+
7+
## Design Prinzip
8+
9+
Dark Purple Glass Minimalist.
10+
11+
Ziele:
12+
13+
- Fokus auf Karteninhalt
14+
- ruhige, dunkle Flaechen
15+
- klare Akzentfarbe fuer Actions
16+
17+
## Farb- und Theme-Grundlagen
18+
19+
Siehe `src/lib/theme.ts`:
20+
21+
- Hintergrund: `#0F0A1E`
22+
- Surface: `#171129`
23+
- Primary: `#6B21A8`
24+
- Accent: `#A855F7`
25+
- Text: `#F2EDFF`
26+
27+
## Map Design
28+
29+
Siehe `src/lib/mapbox.ts`:
30+
31+
- Map Style: `mapbox://styles/mapbox/navigation-night-v1`
32+
- Marker-Farben nach Spot-Type:
33+
- drift: `#7C3AED`
34+
- meet: `#3B82F6`
35+
- track: `#10B981`
36+
- parking: `#F59E0B`
37+
- other: `#6B7280`
38+
39+
## UI Konventionen
40+
41+
- Primaraktionen als volle Buttons mit Accent-Farbe
42+
- Sekundaeraktionen als Chips oder Outlined Buttons
43+
- Karten-Overlays mit transparenter Surface
44+
- Einheitliche Radius/Spacing Token aus `theme.ts`
45+
46+
## Komponentenstatus (MVP)
47+
48+
- Basis UI:
49+
- `src/components/ui/Button.tsx`
50+
- `src/components/ui/Input.tsx`
51+
- `src/components/ui/Screen.tsx`
52+
- Map:
53+
- `GhostMarker`
54+
- `SpotPreviewSheet`
55+
- Feed:
56+
- `PostCard`
57+
58+
## Noch offen nach MVP (spaeteres Polishing)
59+
60+
- einheitliche Skeleton-Loader
61+
- klarere Typografie-Hierarchie
62+
- haptisches Feedback bei Kerninteraktionen

0 commit comments

Comments
 (0)