Transform your code into beautiful poetry with AI β¨
Download β’ Features β’ Demo β’ Installation β’ Architecture β’ Tech Stack
Code Poetry is a mobile application that transforms your code into beautiful, artistic poetry using AI. Whether you're a developer looking to celebrate your craft or someone who wants to see code from a different perspective, Code Poetry bridges the gap between logic and emotion.
Developers spend thousands of hours writing elegant code, but it's often:
- Treated as purely functional, not artistic
- Never celebrated beyond "it works"
- Disconnected from emotional expression
Code Poetry analyzes your code and generates beautiful poetry in multiple styles:
- Haiku - Minimalist 5-7-5 syllable poems
- Sonnet - Classical 14-line structured verses
- Free Verse - Creative, flowing expressions
- Cyberpunk - Futuristic, edgy tech-noir poetry
Get the latest Android APK directly:
- Powered by Google's Gemini AI
- Context-aware poem generation
- Multiple programming languages supported
- Smart code analysis before generation
- 4 distinct poetry styles with unique aesthetics
- Swipeable style selector with live previews
- Custom gradients for each style
- Example poems to guide selection
- Email/Password authentication
- Google Sign-In integration
- Guest mode for quick access
- Seamless guest-to-user conversion
- Local storage with Hive for offline access
- Cloud sync with Firestore for logged-in users
- Automatic backup and restore
- Cross-device synchronization
- Typewriter effect for poem reveal
- Smooth page transitions
- Gradient background animations
- Haptic feedback throughout
- Guest Mode: 3 poems total
- Free Tier: 5 poems per day
- Pro Tier: Unlimited poems (ready for monetization)
- Share poems via system share sheet
- Save favorites to gallery
- Filter poems by style
- Dark/Light theme support
- Responsive design (mobile & web)
Launch β Onboarding β Auth β Home β Create Poem
β
Code Input
β
Style Selection
β
Poem Display
β
Share / Save / Regenerate
- Flutter SDK (3.0 or higher)
- Dart SDK (3.0 or higher)
- Android Studio / VS Code with Flutter extensions
- Firebase account
- Google Cloud account (for Gemini API)
git clone https://github.com/yourusername/code-poetry.git
cd code-poetryflutter pub getCreate a .env file in the project root:
# Gemini AI API Key
GEMINI_API_KEY=your_gemini_api_key_here
# Firebase Configuration (optional for additional configs)
FIREBASE_API_KEY=your_firebase_key_hereGet Gemini API Key:
- Visit Google AI Studio
- Click "Create API Key"
- Copy key to
.envfile
- Go to Firebase Console
- Click "Add Project"
- Follow the setup wizard
For Android:
flutterfire configureManual Setup:
- Download
google-services.json - Place in
android/app/
For iOS:
- Download
GoogleService-Info.plist - Place in
ios/Runner/
In Firebase Console:
-
Authentication
- Enable Email/Password
- Enable Google Sign-In
- Enable Anonymous (for Guest mode)
-
Firestore Database
- Create database in test mode (for development)
- Set up security rules (see Security Rules)
# Run on connected device
flutter run
# Run on specific device
flutter run -d <device-id>
# Run on Chrome (web)
flutter run -d chrome
# Run with hot reload
flutter run --hotβββββββββββββββββββββββββββββββββββββββββββββββ
β USER INTERFACE β
β (Views & Widgets) β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βββββββββββββββββββΌββββββββββββββββββββββββββββ
β VIEW MODELS β
β (Business Logic & State Management) β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βββββββββββββββββββΌββββββββββββββββββββββββββββ
β REPOSITORIES β
β (Data Coordination Layer) β
βββββββ¬βββββββββββββββββββββββ¬βββββββββββββββββ
β β
βββββββΌββββββββββ ββββββββββΌβββββββββββββββ
β SERVICES β β LOCAL STORAGE β
β - API β β - Hive β
β - Auth β β - SharedPreferences β
β - Storage β β - Firestore β
βββββββββββββββββ βββββββββββββββββββββββββ
lib/
βββ main.dart # App entry point
β
βββ core/ # Core app configurations
β βββ constants/
β β βββ app_colors.dart # Color system
β β βββ app_strings.dart # All UI text
β β βββ api_constants.dart # API endpoints
β β
β βββ theme/
β β βββ app_theme.dart # Theme configuration
β β βββ text_styles.dart # Typography system
β β
β βββ services/
β βββ api_service.dart # Gemini AI integration
β βββ auth_service.dart # Firebase Auth wrapper
β βββ storage_service.dart # Hive + Firestore
β βββ connectivity_service.dart # Network monitoring
β
βββ models/ # Data models
β βββ poem_model.dart
β βββ user_model.dart
β βββ poetry_style_model.dart
β
βββ repositories/ # Data layer
β βββ poem_repository.dart
β βββ auth_repository.dart
β
βββ viewmodels/ # Business logic
β βββ auth_viewmodel.dart
β βββ poem_generator_viewmodel.dart
β βββ gallery_viewmodel.dart
β βββ home_viewmodel.dart
β βββ settings_viewmodel.dart
β
βββ views/ # UI layer
βββ screens/
β βββ splash_screen.dart
β βββ onboarding/
β βββ auth/
β βββ home/
β βββ code_input/
β βββ style_selector/
β βββ poem_display/
β βββ gallery/
β βββ profile/
β βββ settings/
β
βββ widgets/
βββ common/ # Reusable widgets
β βββ custom_button.dart
β βββ custom_text_field.dart
β βββ loading_indicator.dart
β βββ error_view.dart
β βββ empty_state.dart
β
βββ [feature-specific widgets]
Provider is used for state management with the following structure:
MultiProvider(
providers: [
// Services (singleton)
Provider<ApiService>(...),
Provider<StorageService>(...),
// ViewModels (state notifiers)
ChangeNotifierProvider<AuthViewModel>(...),
ChangeNotifierProvider<PoemGeneratorViewModel>(...),
// ... other ViewModels
],
child: MyApp(),
)- Flutter 3.0+ - Cross-platform UI framework
- Dart 3.0+ - Programming language
- Provider - Lightweight state management solution
- Firebase Authentication - User authentication
- Cloud Firestore - NoSQL cloud database
- Google Gemini AI - AI-powered poetry generation
- Hive - Fast, lightweight NoSQL database
- SharedPreferences - Key-value storage
dependencies:
# Core
flutter:
sdk: flutter
provider: ^6.1.1
# Firebase
firebase_core: ^2.24.2
firebase_auth: ^4.16.0
cloud_firestore: ^4.14.0
google_sign_in: ^6.2.1
# Networking
http: ^1.1.0
dio: ^5.4.0
# Storage
hive: ^2.2.3
hive_flutter: ^1.1.0
shared_preferences: ^2.2.2
# UI/Animations
flutter_animate: ^4.3.0
lottie: ^3.0.0
shimmer: ^3.0.0
# Utilities
flutter_dotenv: ^5.1.0
connectivity_plus: ^5.0.2
share_plus: ^7.2.1
uuid: ^4.3.3
intl: ^0.19.0
# Code Display
flutter_highlight: ^0.7.0Firestore Rules (firestore.rules):
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users collection
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
// User's poems subcollection
match /poems/{poemId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}
}Authentication Rules:
- Email/Password: Enabled
- Google Sign-In: Enabled
- Anonymous: Enabled
The app uses different configurations for development and production:
Development:
// Uses test Firebase project
// Gemini API with rate limiting
// Debug mode enabledProduction:
// Uses production Firebase project
// Full Gemini API access
// Release mode optimizationsPrimary Colors:
Primary Gradient: #667EEA β #764BA2 (Purple-Blue)
Secondary Gradient: #4FACFE β #00F2FE (Cyan)
Accent Gradient: #F093FB β #F5576C (Pink-Orange)
Success Gradient: #43E97B β #38F9D7 (Green)Semantic Colors:
Success: #43E97B
Error: #FF6A88
Warning: #FEE140
Info: #4FACFEDark Theme:
Background: #0A0E27
Surface: #1A1F3A
Text Primary: #FFFFFF
Text Secondary: #B8B8D1Font Families:
- UI Text: System Default (San Francisco / Roboto)
- Code: JetBrains Mono (Monospace)
- Poetry: Spectral (Serif, Italic)
Type Scale:
H1: 32px, Bold
H2: 28px, Bold
H3: 24px, Semibold
H4: 20px, Semibold
Body Large: 16px, Regular
Body Medium: 14px, Regular
Body Small: 12px, Regular
# Run all tests
flutter test
# Run specific test file
flutter test test/viewmodels/poem_generator_viewmodel_test.dart
# Run with coverage
flutter test --coveragetest/
βββ unit/
β βββ models/
β βββ repositories/
β βββ services/
βββ widget/
β βββ common/
βββ integration/
βββ poem_generation_flow_test.dart
- Unit Tests: ViewModels, Repositories, Services
- Widget Tests: Common widgets, Custom components
- Integration Tests: Full user flows
| Platform | Status | Notes |
|---|---|---|
| Android | β Full Support | Minimum SDK: 21 (Android 5.0) |
| iOS | β Full Support | Minimum: iOS 12.0 |
| Web | β Full Support | Chrome, Safari, Firefox, Edge |
| macOS | π Experimental | Desktop support via Flutter |
| Windows | π Experimental | Desktop support via Flutter |
| Linux | π Experimental | Desktop support via Flutter |
# Build release APK
flutter build apk --release
# Build App Bundle (recommended)
flutter build appbundle --releaseLocation: build/app/outputs/bundle/release/app-release.aab
# Build for iOS
flutter build ios --release
# Create archive in Xcode
open ios/Runner.xcworkspace
# Product β Archive β Distribute# Build web version
flutter build web --release
# Deploy to Firebase Hosting
firebase deploy --only hostingWeb Build Location: build/web/
- β
Environment variables (
.env) - β Never committed to version control
- β
.gitignoreconfigured properly
- β Firebase Auth with secure tokens
- β Password hashing handled by Firebase
- β OAuth 2.0 for Google Sign-In
- β User data isolated by Firebase rules
- β Local encryption with Hive
- β HTTPS for all network requests
- β Input validation on all forms
- β Rate limiting for API calls
- β Error messages don't expose sensitive info
- β Secure storage for user credentials
- Lazy loading for poems list
- Image caching
- Debounced search
- Efficient state management
- Code splitting for web
- App startup: < 2 seconds
- Poem generation: 3-5 seconds (AI dependent)
- Screen transitions: 60 FPS
- Memory usage: < 150 MB
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Effective Dart guidelines
- Use
dart formatbefore committing - Write meaningful commit messages
- Add tests for new features
- Update README if needed
- Add/update tests
- Ensure all tests pass
- Update documentation
- Request review from maintainers
- Occasional timeout on slow networks (AI generation)
- Theme transition animation needs smoothing
- iOS keyboard overlap on small devices (rare)
See Issues for full list.
- More poetry styles (Limerick, Ballad)
- Voice narration of poems
- Export poems as images
- Social features (share to feed)
- Payment integration (Pro tier)
- Custom AI model fine-tuning
- Collaborative poems
- Code review poetry integration
- VS Code extension
- Community gallery
- Poetry competitions
- NFT minting of poems
- Multi-language UI support
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Code Poetry
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
Your Name
- GitHub: DevKorrir
- LinkedIn: Aldo Kipyegon
- Twitter: @AldoKipyegon
- Email: kipyegonaldo@gmail.com
- Google Gemini AI - For powerful AI capabilities
- Firebase - For backend infrastructure
- Flutter Team - For amazing framework
- Font Awesome - For icons
- Unsplash - For sample images
- Open Source Community - For inspiration and support
Need help? Here's how to get support:
- π§ Email: kipyegonaldo@gmail.com
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
If you found this project helpful, please consider giving it a β!






