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 ⭐!






