CaptureYourLife is an AI-powered mobile app that transforms photos into stickers and avatars using real AI models. Built with Flutter (frontend) + FastAPI (backend) + Firebase + Replicate AI.
- Python 3.10+
- Flutter SDK (>=3.0.0)
- Dart SDK (>=3.0.0)
- Git
- A Replicate API account (https://replicate.com)
- A Firebase project
- Replicate API Token - Get from https://replicate.com/account
- Firebase Project Credentials - Create at https://firebase.google.com
cd CaptureYourLife/backend# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txt# Copy example to actual .env
cp .env.example .env
# Edit .env with your values
# - REPLICATE_API_TOKEN: Your Replicate API token
# - FIREBASE_PROJECT_ID: Your Firebase project ID
# - FIREBASE_PRIVATE_KEY: Your Firebase private key (JSON escaped)
# - FIREBASE_CLIENT_EMAIL: Your Firebase client email
# - SECRET_KEY: Generate a random secret keypython -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadThe backend will be available at http://localhost:8000
Once running, visit http://localhost:8000/docs for interactive API docs.
cd CaptureYourLife/frontendflutter pub get# Copy example to actual .env
cp .env.example .env
# Edit .env with your Firebase credentialsEdit lib/config/firebase_options.dart with your Firebase project details:
static FirebaseOptions get currentPlatform {
return FirebaseOptions(
apiKey: 'YOUR_FIREBASE_API_KEY',
appId: 'YOUR_FIREBASE_APP_ID',
messagingSenderId: 'YOUR_MESSAGING_SENDER_ID',
projectId: 'YOUR_PROJECT_ID',
storageBucket: 'YOUR_STORAGE_BUCKET',
);
}# Run on Android emulator
flutter run -d emulator-5554
# Run on iOS simulator
flutter run -d ios
# Run on connected device
flutter runCaptureYourLife/
βββ backend/
β βββ app/
β β βββ __init__.py
β β βββ main.py # FastAPI entry point
β β βββ config.py # Configuration
β β βββ models.py # Pydantic models
β β βββ dependencies.py # Firebase & Auth
β β βββ routes/
β β β βββ auth.py # Auth endpoints
β β β βββ images.py # Image upload
β β β βββ generation.py # AI generation
β β βββ services/
β β βββ ai_service.py # Replicate API
β β βββ firebase_service.py # Firebase ops
β βββ requirements.txt
β βββ .env.example
β βββ .gitignore
β
βββ frontend/
β βββ lib/
β β βββ main.dart # App entry point
β β βββ config/ # Configs
β β β βββ app_colors.dart
β β β βββ api_config.dart
β β β βββ firebase_options.dart
β β βββ pages/ # App screens
β β β βββ home_page.dart
β β β βββ camera_page.dart
β β β βββ editor_page.dart
β β β βββ preview_page.dart
β β β βββ gallery_page.dart
β β βββ components/ # Reusable widgets
β β β βββ primary_button.dart
β β β βββ loading_spinner.dart
β β β βββ image_picker_widget.dart
β β β βββ style_selector.dart
β β β βββ image_preview.dart
β β βββ services/ # Business logic
β β β βββ api_service.dart
β β β βββ auth_service.dart
β β β βββ image_service.dart
β β βββ providers/ # Riverpod state
β β β βββ auth_provider.dart
β β β βββ image_provider.dart
β β β βββ generation_provider.dart
β β βββ assets/
β β βββ images/
β β βββ icons/
β βββ pubspec.yaml
β βββ analysis_options.yaml
β βββ .env.example
β βββ .gitignore
β
βββ README.md
POST /auth/register- Register new userPOST /auth/login- Login user
POST /images/upload- Upload imageGET /images/{image_id}- Get image metadata
POST /generate/sticker- Generate stickerPOST /generate/avatar- Generate avatarGET /generate/history- Get user's generation history
# Register
curl -X POST "http://localhost:8000/auth/register" \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"test123","username":"testuser"}'
# Login
curl -X POST "http://localhost:8000/auth/login" \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"test123"}'
# Upload Image
curl -X POST "http://localhost:8000/images/upload" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@path/to/image.jpg"
# Generate Sticker
curl -X POST "http://localhost:8000/generate/sticker" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"image_id":"YOUR_IMAGE_ID","style":"sticker"}'# Run with debug output
flutter run -v
# Run tests
flutter test
# Build APK (Android)
flutter build apk
# Build IPA (iOS)
flutter build ios- Home Page - User sees menu with options
- Camera Page - User picks image from camera or gallery
- Editor Page - User selects generation type (sticker/avatar) and style
- Preview Page - User sees generated result
- Gallery Page - User views all past generations
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_PRIVATE_KEY=your-private-key
FIREBASE_CLIENT_EMAIL=your-email
REPLICATE_API_TOKEN=your-token
APP_NAME=CaptureYourLife
DEBUG=True
SECRET_KEY=your-secret-keyAPI_BASE_URL=http://localhost:8000
FIREBASE_API_KEY=your-key
FIREBASE_PROJECT_ID=your-project-id- β Android (API 21+)
- β iOS (12.0+)
- β Web (Chrome, Firefox, Safari)
- β Windows, macOS, Linux
- Port already in use: Change port in main.py or kill process on port 8000
- Firebase auth error: Check credentials in .env file
- Replicate API errors: Verify API token is correct and valid
- Image picker not working: Check permissions in AndroidManifest.xml or Info.plist
- API connection failed: Ensure backend is running and API_BASE_URL is correct
- Build errors: Run
flutter clean && flutter pub get
- FastAPI - Web framework
- Firebase Admin SDK - Database & auth
- Replicate - AI model API
- Pillow - Image processing
- Pydantic - Data validation
- Flutter - UI framework
- Riverpod - State management
- Dio - HTTP client
- Image Picker - Camera/Gallery access
- Firebase - Database & auth
- Set
DEBUG=Falsein .env - Generate strong
SECRET_KEY - Deploy to: Heroku, Railway, Render, or AWS
- Update Firebase security rules for production
- Build release APK:
flutter build apk --release - Build release IPA:
flutter build ios --release - Submit to Google Play / App Store
- β
Run backend:
python -m uvicorn app.main:app --reload - β
Run frontend:
flutter run - β Test auth flow (register/login)
- β Test image upload & generation
- β Test UI navigation
- π Customize colors in
lib/config/app_colors.dart - π Add more generation styles in
ai_service.py - π Implement social media sharing
For issues or questions:
- Check the troubleshooting section
- Review API docs at
http://localhost:8000/docs - Check Flutter logs:
flutter logs - Review backend logs in terminal
Happy Creating! π