TECHNICAL DOCUMENTATION
Architecture & Implementation Details
Technology Stack
Framework
Flutter 3.10+ (Dart SDK ^3.10.4)
State Management
Riverpod 3 with @riverpod code generation
Navigation
GoRouter with deep linking support
Data Models
Freezed for immutable models + JSON serialization
Backend
Firebase (Firestore, Storage, Auth, Remote Config)
AI
Google Gemini via Firebase AI SDK
Monetization
RevenueCat (purchases_flutter)
Localization
Flutter intl with ARB files (EN/DE)
AI Integration Details
Recipe Generation
The app uses Google Gemini 2.5 Flash Lite via the Firebase AI SDK for recipe generation. User inputs (text, voice transcription, or image) are sent to the model with a structured prompt that returns JSON matching our Recipe model.
Image Generation
After a recipe is saved, an async background process generates a visual using Gemini's Imagen 3 integration. The generated image is compressed, uploaded to Firebase Storage, and the recipe document is updated with the image URL.
Magic Edit
Users can modify existing recipes using natural language. The current recipe JSON is sent along with the modification request, and Gemini returns an updated recipe preserving unchanged fields.
RevenueCat Integration
SliceLense uses RevenueCat for subscription management, providing a unified API for both iOS App Store and Google Play billing.
Subscription Tiers
Paywall Display
The app uses RevenueCat's pre-built paywall UI (purchases_ui_flutter)
for a native, optimized purchase experience. Paywalls are triggered when users
hit their usage limits.
Usage Limit Enforcement
Limits are enforced at multiple intervals (weekly for Free/Expert, daily/weekly/monthly for Pro) via Firebase Remote Config. When users hit a limit, a usage limit dialog appears with tier-appropriate upgrade options. Free users see both Expert Pack and Pro options, while Expert Pack users see the Pro upgrade path.
Real-Time Data Flow
Recipe data flows through Firestore streams, combined with RxDart for complex reactive state management. This enables real-time updates across the app when recipes are created, modified, or deleted.
Security & Privacy
- Anonymous Authentication: Users are auto-signed in with Firebase Anonymous Auth — no email or password required.
- Data Isolation: Each user's recipes are stored under their unique UID in Firestore with security rules preventing cross-user access.
- HTTPS Only: All communication with Firebase and Gemini APIs uses encrypted connections.
- No Payment Data: RevenueCat handles all billing through Apple/Google — we never see payment details.
- Voice Data: Voice input is transcribed in real-time and not stored after recipe creation.