Letzte Aktualisierung: 2025-12-16
Firebase Projekt: "kids-ai-train"
├── ParentsDash (iOS + Android + Web)
├── Alanko App (iOS + Android)
└── Lianko App (iOS + Android)
https://console.firebase.google.com/
- Klick: "Projekt hinzufügen"
- Name:
kids-ai-train - Google Analytics: Optional (empfohlen: Ja)
- Warten bis Projekt erstellt ist
- Firebase Console → Projekt
kids-ai-train - Klick: "App hinzufügen"
- Plattformen:
- Android:
com.devshift.kidsai.parent - iOS:
com.devshift.kidsai.parent - Web:
Kids AI Parent Dashboard
- Android:
- Firebase Console → Projekt
kids-ai-train - Klick: "App hinzufügen"
- Plattformen:
- Android:
com.devshift.kidsai.alanko - iOS:
com.devshift.kidsai.alanko
- Android:
- Firebase Console → Projekt
kids-ai-train - Klick: "App hinzufügen"
- Plattformen:
- Android:
com.devshift.kidsai.lianko - iOS:
com.devshift.kidsai.lianko
- Android:
- Firebase Console → Projekteinstellungen → Deine Apps
- Android-App auswählen
google-services.jsonherunterladen- Datei in
android/app/ablegen
- Firebase Console → Projekteinstellungen → Deine Apps
- iOS-App auswählen
GoogleService-Info.plistherunterladen- Datei in
ios/Runner/ablegen
- Firebase Console → Projekteinstellungen → Deine Apps
- Web-App auswählen
- Firebase-Konfiguration kopieren
- In
lib/firebase_options.darteinfügen
- Firebase Console → Authentication → Erste Schritte
- Anmeldemethoden aktivieren:
- ✅ E-Mail/Passwort (für Eltern)
- ✅ Anonym (für Kinder-Apps)
- Firebase Console → Firestore Database → Datenbank erstellen
- Modus: Produktionsmodus
- Standort:
europe-west3(Frankfurt)
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Parents Collection
match /parents/{parentId} {
// Nur der Parent selbst oder verknüpfte Co-Parents können lesen/schreiben
allow read, write: if request.auth != null &&
(request.auth.uid == parentId ||
resource.data.coParents[request.auth.uid] == true);
// Children Sub-Collection
match /children/{childId} {
allow read, write: if request.auth != null &&
(request.auth.uid == parentId ||
get(/databases/$(database)/documents/parents/$(parentId)).data.coParents[request.auth.uid] == true);
}
}
// Parent Codes - für Kinder-App Verknüpfung
// Kinder-Apps können Codes validieren (anonym)
match /parents/{parentId}/children/{childId} {
allow read: if request.auth != null &&
resource.data.parentCode != null;
}
// Children Activity Logs - Kinder-Apps schreiben hier
match /activity/{activityId} {
allow read: if request.auth != null;
allow write: if request.auth != null;
}
}
}/parents/{parentId}
├── email: "vater@example.com"
├── createdAt: timestamp
├── coParents: { ← Verknüpfte Elternteile
│ "mutterUserId": true
│ }
├── coParentCode: "XYZ123" ← Code für Elternteil-Einladung
├── coParentCodeExpiresAt: timestamp
│
└── /children/{childId}
├── name: "Max"
├── age: 8
├── parentCode: "K3M7XP" ← Code für Kind-App
├── parentCodeExpiresAt: timestamp
├── isLinked: true
├── linkedDeviceIds: ["device1", "device2"]
├── timeLimit: {...}
├── leaderboardConsent: {...}
├── accessibilitySettings: {
│ subtitlesEnabled: false,
│ subtitleLanguage: "de"
│ }
└── gameSettings: {...}
/activity/{activityId}
├── childId: "child123"
├── parentId: "parent456"
├── type: "game_completed"
├── gameId: "math_basics"
├── score: 85
├── duration: 300
├── timestamp: timestamp
dependencies:
firebase_core: ^3.8.1
firebase_auth: ^5.3.4
cloud_firestore: ^5.6.1import 'package:firebase_core/firebase_core.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}Automatische Konfiguration für alle Plattformen:
# FlutterFire CLI installieren
dart pub global activate flutterfire_cli
# Im App-Ordner ausführen
flutterfire configure --project=kids-ai-trainDies erstellt automatisch:
lib/firebase_options.dartandroid/app/google-services.jsonios/Runner/GoogleService-Info.plist
- Firebase für Web + iOS + Android konfigurieren
- E-Mail/Passwort Auth implementieren
- Parent-Dokument bei Registrierung erstellen
- Children CRUD implementieren
- Co-Parent Einladung implementieren
- Firebase für iOS + Android konfigurieren
- Anonymous Auth implementieren
- ParentCode-Validierung implementieren
- Activity-Logging implementieren
- Einstellungen von Firestore lesen
- Firebase für iOS + Android konfigurieren
- Anonymous Auth implementieren
- ParentCode-Validierung implementieren
- Activity-Logging implementieren
- Einstellungen von Firestore lesen
- ❌ Firebase API-Keys in öffentlichen Repos commiten
- ❌
google-services.json/GoogleService-Info.plistin Git pushen - ❌ Firestore-Regeln auf "allow read, write: if true" setzen
- ✅
.gitignoreprüfen (Config-Dateien ausschließen) - ✅ Sicherheitsregeln testen
- ✅ Offline-Persistenz aktivieren für Kinder-Apps
| Test | ParentsDash | Alanko | Lianko |
|---|---|---|---|
| Firebase initialisiert | [ ] | [ ] | [ ] |
| Auth funktioniert | [ ] | [ ] | [ ] |
| Firestore lesen | [ ] | [ ] | [ ] |
| Firestore schreiben | [ ] | [ ] | [ ] |
| Echtzeit-Sync | [ ] | [ ] | [ ] |
Die Cloud Functions für Push Notifications befinden sich im firebase/ Ordner.
cd firebase/functions
npm install
cd ..
firebase deploy --only functionsonActivityCreated- Notification bei Kind-AktivitätonChildUpdated- Notification bei Geräte-ÄnderungendailyReport- Tägliche Zusammenfassung (19:00 Uhr)sendTestNotification- Test-Endpoint
Siehe firebase/README.md für Details.
Bei Fragen: Issue auf GitHub erstellen oder User fragen.