MoodGenie is an AI-powered mood journaling and companion app built using Flutter (frontend) and FastAPI + Gemini API (backend). It helps users reflect on their thoughts, get emotionally intelligent replies, and store their mood summaries locally using Hive.
π₯ Download MoodGenie App: Download APK
- π§ AI-generated emotional responses using Google Gemini API
- β¨ Auto-generated mood summaries stored locally on device
- π Local database using Hive (no internet needed for mood history)
- π± Shareable as APK, without the Play Store
- π Backend deployed via FastAPI on Render
- π¨ Beautiful UI with custom animations and Google Fonts
| Layer | Technology |
|---|---|
| Frontend | Flutter |
| Backend | FastAPI |
| AI Model | Google Gemini (gemini-2.0-flash-lite) |
| Local Storage | Hive |
Before you begin, ensure you have the following installed:
- Python 3.8+ - Download Python
- pip (Python package manager, comes with Python)
- Flutter SDK 3.8.0+ - Install Flutter
- Dart SDK (comes with Flutter)
- Android Studio (for Android development) or Xcode (for iOS development on macOS)
- A code editor like VS Code or Android Studio
- Google Gemini API Key - Get API Key
cd backend# On macOS/Linux
python3 -m venv venv
source venv/bin/activate
# On Windows
python -m venv venv
venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the backend directory:
touch .envAdd your Gemini API key to the .env file:
GEMINI_API_KEY=your_gemini_api_key_hereReplace your_gemini_api_key_here with your actual API key from Google AI Studio.
# Development mode with auto-reload
uvicorn main:app --reload
# Production mode
uvicorn main:app --host 0.0.0.0 --port 8000The backend API will be available at http://localhost:8000
POST /chat- Send user prompt and receive AI responseGET /summary- Get conversation summary when app closes
cd frontendflutter pub getOpen lib/screens/home_screen.dart and update the API URL if needed:
final url = Uri.parse('http://localhost:8000/chat'); // For local testing
// OR
final url = Uri.parse('https://moodgenie.onrender.com/chat'); // For productionEnsure the following assets are present in the assets/ directory:
app_icon.png- App launcher iconcloudy_animation.mp4- Background animation (optional)
flutter runcd ios
pod install
cd ..
flutter runflutter run -d chromeTo create a release APK:
flutter build apk --releaseThe APK will be located at: build/app/outputs/flutter-apk/app-release.apk
For split APKs per ABI (smaller file sizes):
flutter build apk --split-per-abiMoodGenie/
βββ backend/
β βββ main.py # FastAPI server
β βββ gemini_handler.py # Gemini AI integration
β βββ moodgenie_training_data.json # AI training context
β βββ requirements.txt # Python dependencies
β βββ .env # Environment variables (not tracked)
β βββ .gitignore
βββ frontend/
β βββ lib/
β β βββ main.dart # App entry point
β β βββ screens/
β β βββ splash_screen.dart # Welcome screen
β β βββ mainAppScreen.dart # Main navigation
β β βββ home_screen.dart # Chat interface
β β βββ history_screen.dart # Mood history
β βββ assets/
β β βββ app_icon.png # App icon
β β βββ cloudy_animation.mp4 # Background video
β βββ pubspec.yaml # Flutter dependencies
β βββ .gitignore
βββ README.md
-
Start the backend server:
cd backend uvicorn main:app --reload -
Test the chat endpoint:
curl -X POST http://localhost:8000/chat \ -H "Content-Type: application/json" \ -d '{"user_prompt": "I am feeling happy today!"}'
-
Test the summary endpoint:
curl http://localhost:8000/summary
- Ensure backend is running
- Launch the Flutter app
- Test conversation flow
- Check mood history storage
- Verify summary generation on app close
- Push your code to GitHub
- Connect your repository to Render
- Set environment variable:
GEMINI_API_KEY - Deploy with build command:
pip install -r requirements.txt - Start command:
uvicorn main:app --host 0.0.0.0 --port $PORT
- Android: Share the APK file directly
- iOS: Distribute via TestFlight or App Store
- Web: Deploy using
flutter build weband host on Firebase/Netlify/Vercel
Issue: ModuleNotFoundError: No module named 'fastapi'
Solution: Run pip install -r requirements.txt in the backend directory
Issue: google.generativeai.types.generation_types.BlockedPromptException
Solution: Check your API key and ensure it's valid
Issue: Failed to load asset
Solution: Run flutter pub get and verify assets in pubspec.yaml
Issue: Connection refused when testing
Solution: Ensure backend server is running and URL is correct in home_screen.dart
Issue: Build fails for iOS
Solution: Run cd ios && pod install && cd .. then try again
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available for educational purposes.
Aryan Varshney
- GitHub: @AryanV-Coder
- Google Gemini AI for the conversational intelligence
- Flutter team for the amazing framework
- FastAPI for the lightning-fast backend framework
- Hive for efficient local storage
If you encounter any issues or have questions, please:
- Check the Troubleshooting section
- Review existing issues on GitHub
- Create a new issue with detailed information
Happy Coding! π