Note
This branch is designed for partial customized projects. Running the customizer.sh
script doesn't rename any application module, instead it'll change all core
and feature
module namespaces, packages, and other related configurations accordingly.
and change your android and desktop application id and namespace in libs.versions.toml
file.
For full customization, please use the full-customizable
branch instead.
- Android: Native Android app with Jetpack Compose
- iOS: Native iOS app with SwiftUI integration
- Desktop: JVM-based desktop application
- Web: Kotlin/JS with Compose Web
- Shared Logic: Common business logic across all platforms
- Multi-Module Design: Organized, scalable architecture
- Clean Architecture: Separation of concerns with domain, data, and presentation layers
- Feature-First Modularization: Independent feature modules for better maintainability
- Shared UI Components: Reusable Compose Multiplatform components
- Platform-Specific Optimizations: Native capabilities while maximizing code sharing
- Gradle Kotlin DSL: Modern build configuration
- Version Catalogs: Centralized dependency management
- Type-Safe Accessors: Improved build script maintainability
- Custom Gradle Plugins: Streamlined build process
- Run Configurations: Pre-configured for all platforms
- Static Analysis: Detekt for code quality checks
- Code Formatting: Spotless integration
- Git Hooks: Automated pre-commit checks
- Style Guide Enforcement: Consistent coding standards
- Automated Testing: Unit and integration test setup
- GitHub Actions: Automated build and test workflows
- PR Checks: Automated pull request validation
- Fastlane Integration: Automated deployment for Android and iOS
- Dynamic Versioning: Automated version management
- Release Notes Generation: Automated changelog creation
- Design System: Consistent styling across platforms
- Theme Support: Light/dark mode compatibility
- UI Components: Pre-built, customizable widgets
- Resources Management: Efficient asset handling
- Accessibility: Built-in accessibility support
- DataStore Integration: Efficient local storage
- Network Layer: API client setup
- Caching Strategy: Optimized data caching
- Analytics Integration: Ready-to-use analytics setup
- Error Handling: Comprehensive error management
- Enhanced Directory Sync: Comprehensive sync system for all project components
- GitHub Actions Integration: Automated weekly sync workflow with PR generation
- Advanced Sync Script: Feature-rich bash script with safety measures
- Comprehensive Sync Coverage: Syncs the following components:
- Applications: cmp-android, cmp-desktop, cmp-ios, cmp-web
- Build System: build-logic
- Tools: fastlane, scripts
- Configuration: config, .github, .run
- Core Files: Gemfile, Gemfile.lock, ci-prepush scripts
- Safety Features: Automatic backups, error handling, and dry-run mode
- Change Validation: Smart detection of necessary updates
- Bash 4.0+
- Unix-like environment (macOS, Linux) or Git Bash on Windows
- Android Studio/IntelliJ IDEA
- Xcode (for iOS development)
- Node.js (for web development)
- Clone the Repository
git clone https://github.com/openMF/kmp-project-template.git
cd kmp-project-template
- Run the Customizer
./customizer.sh org.example.myapp MyKMPProject
- Build and Run
./gradlew build
- Version Generation: Supports git, Firebase, and Play Store-based versioning
- Release Notes Generation: Simple and full release notes generation
- CI/CD Integration: GitHub Actions and GitLab CI examples
- Best Practices: Securely manage sensitive data in CI/CD
- Automated Deployment: Firebase and Play Store deployment scripts
- Testing: Automated testing and deployment in staging environment
- Dependency Management: Keep Fastlane and plugins updated
- Staging Environment: Test deployment scripts in a staging environment
- Configuration: Update platform specific configurations in
fastlane-config
directory
# Basic sync
./sync-dirs.sh
# Dry run to preview changes
./sync-dirs.sh --dry-run
# Force sync without prompts
./sync-dirs.sh --force
# Both dry run and force mode
./sync-dirs.sh --dry-run --force
- Backup System: Automatic backup of existing files before modification
- Error Handling: Comprehensive error detection and recovery
- Progress Indication: Visual feedback during sync operations
- Logging: Detailed logs of all operations
- Dry Run Mode: Preview changes without applying them
- Force Mode: Non-interactive operation for automation
The repository includes an enhanced GitHub workflow (sync-dirs.yml
) that:
- Runs automatically every Monday at midnight UTC
- Supports manual triggering from GitHub Actions UI
- Creates detailed pull requests for review
- Includes comprehensive change logs
- Handles all sync components safely
- Maintains proper git history
- Go to your repository's Settings
- Navigate to Actions > General in the left sidebar
- Scroll down to Workflow permissions
- Enable the following permissions:
- β Select "Read and write permissions"
- β Check "Allow GitHub Actions to create and approve pull requests"
- Click "Save" to apply the changes
- Regular Syncs: Keep up with upstream changes through weekly automated syncs
- Review Changes: Always review generated PRs carefully
- Backup First: Use --dry-run before actual sync operations
- Conflict Resolution: Handle merge conflicts promptly
- Version Control: Maintain clean git history during syncs
core/
βββ analytics/ # Analytics and tracking
βββ common/ # Shared utilities and extensions
βββ data/ # Data layer implementation
βββ datastore/ # Local storage management
βββ domain/ # Business logic and use cases
βββ model/ # Data models and entities
βββ network/ # Network communication
βββ ui/ # Shared UI components
βββ designsystem/ # Design system components
feature/
βββ home/ # Home screen features
βββ profile/ # User profile management
βββ settings/ # App settings
cmp-android/ # Android app
cmp-ios/ # iOS app
cmp-desktop/ # Desktop app
cmp-web/ # Web app
cmp-shared/ # Shared code
cmp-navigation/ # Navigation components
graph TD
A[Project Root] --> B[buildLogic]
A --> C[core]
A --> D[feature]
A --> E[Platform Modules]
C --> C1[common]
C --> C2[model]
C --> C3[data]
C --> C4[network]
C --> C5[domain]
C --> C6[ui]
C --> C7[designsystem]
C --> C8[datastore]
D --> D1[home]
D --> D2[profile]
D --> D3[settings]
E --> E1[cmp-android]
E --> E2[cmp-ios]
E --> E3[cmp-desktop]
E --> E4[cmp-web]
E --> E5[cmp-shared]
E --> E6[cmp-navigation]
- Use the provided
sync-cmp-dirs.sh
script to sync specific CMP directories - Review changes before committing
- Push changes to your repository
- The GitHub workflow automatically syncs directories weekly
- Review and merge the generated pull requests
- Manual sync can be triggered from GitHub Actions
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a pull request
Documentation is a work in progress.
- Join our Slack channel
- Report issues on GitHub
- Track progress on Jira
This project is licensed under the Mozilla Public License 2.0.