Project Myriad Development Guidelines
Project Myriad Development Guidelines
This document provides essential information for developers working on Project Myriad, a pure Android manga reader application built with modern Kotlin technologies. Following these guidelines ensures consistency, maintainability, and quality across the codebase.
Build and Configuration Instructions
Prerequisites
-
**Android Studio Jellyfish 2023.3.1** or newer - JDK 17 or higher (required for latest Kotlin features)
- Android SDK API 24-36 (full compatibility)
- Kotlin 2.2.20 with Compose compiler support
- Gradle 9.1.0 (automatically handled by wrapper)
Setting Up the Development Environment
- Clone the repository
git clone https://github.com/Heartless-Veteran/Project-Myriad.git cd Project-Myriad - Configure local properties (if needed for API keys)
cp local.properties.example local.properties - Open in Android Studio and sync project
- The project uses version catalogs for dependency management
- First sync may take several minutes to download dependencies
- Build and run on Android device/emulator
- Ensure device/emulator runs API 24+ for full compatibility
Running the Application
π Complete Guide: For detailed command-line build instructions, see the βCommand-Line Build Methodsβ section below.
Quick Development Commands
# Full clean build (takes 2-5 minutes first time)
./gradlew clean build
# Fast incremental build for development
./gradlew assembleDebug
# Install on connected device/emulator
./gradlew installDebug
# Run all tests
./gradlew test
# Run quality checks (lint, ktlint, detekt)
./gradlew check
Building a Release APK
# Generate a signed release APK
./gradlew assembleRelease
The APK will be generated at app/build/outputs/apk/release/app-release.apk.
Building an Android App Bundle (AAB) - Recommended for Play Store
# Generate a signed Android App Bundle for Google Play Store
./gradlew bundleRelease
The AAB will be generated at app/build/outputs/bundle/release/app-release.aab.
π Important: For production releases, see the complete guide in RELEASE_BUILD_GUIDE.md which covers:
- Version management and signing key setup
- Security best practices for release builds
- Google Play Store publishing process
Configuration Files
- Build Config:
build.gradle.ktscontains project-wide build configuration - App Config:
app/build.gradle.ktscontains app-specific build configuration - Settings:
settings.gradle.ktsdefines project structure - Gradle Properties:
gradle.propertiescontains build optimization settings
Testing Information
Test Framework
Project Myriad uses JUnit and MockK for unit testing. The test configuration is defined in the appβs build.gradle.kts file.
Running Tests
# Run all unit tests
./gradlew testDebugUnitTest
# Run instrumented tests (requires device/emulator)
./gradlew connectedDebugAndroidTest
Writing Tests
- Place unit tests in
app/src/test/kotlin/ - Place instrumented tests in
app/src/androidTest/kotlin/ - Follow AAA pattern (Arrange, Act, Assert)
- Use MockK for mocking dependencies
Kotlin Guidelines
Code Style
- Follow official Kotlin coding conventions
- Use meaningful variable and function names
- Keep functions small and focused on single responsibility
- Prefer immutability when possible
Architecture Guidelines
Project Myriad follows Clean Architecture principles with MVVM pattern:
app/src/main/kotlin/com/heartlessveteran/myriad/
βββ data/ # Data layer
β βββ database/ # Room database
β βββ repository/ # Repository implementations
β βββ di/ # Data dependency injection
βββ domain/ # Business logic layer
β βββ entities/ # Core entities
β βββ repository/ # Repository interfaces
β βββ models/ # Domain models (Result, etc.)
βββ ui/ # Presentation layer
β βββ screens/ # Compose screens
β βββ navigation/ # Navigation setup
β βββ theme/ # Material 3 theming
β βββ viewmodel/ # MVVM ViewModels
βββ di/ # Dependency injection modules
Dependency Injection
- Use Hilt for dependency injection
- Define modules in the
di/packages - Use
@HiltAndroidAppfor Application class - Use
@AndroidEntryPointfor Activities and ViewModels
Database Guidelines
- Use Room for local database
- Define entities in
domain/entities/ - Implement DAOs in
data/database/dao/ - Use Flow for reactive data streams
UI Guidelines
- Use Jetpack Compose for UI
- Follow Material 3 design guidelines
- Keep Composables small and focused
- Use ViewModels for state management
- Handle UI state with sealed classes
File Organization
Naming Conventions
- Use PascalCase for classes and interfaces
- Use camelCase for functions and variables
- Use UPPER_SNAKE_CASE for constants
- Add descriptive suffixes:
Activityfor activities (if any)ViewModelfor ViewModelsRepositoryfor repositoriesDaofor data access objectsScreenfor Compose screens
Package Structure
- Group by feature, not by type
- Keep related files close together
- Use consistent package naming across features
Performance Guidelines
Memory Management
- Avoid memory leaks by properly managing lifecycle
- Use weak references where appropriate
- Profile memory usage regularly
Database Performance
- Use appropriate database queries
- Implement proper indexing
- Use pagination for large datasets
- Cache frequently accessed data
UI Performance
- Optimize Compose recomposition
- Use LazyColumn/LazyRow for long lists
- Implement proper image caching with Coil
- Profile UI rendering performance
Command-Line Build Methods
For developers preferring command-line tools or CI/CD environments:
Prerequisites
- JDK 11+ (Java Development Kit)
- Android SDK with API levels 24-36
- Environment variables:
ANDROID_HOMEorANDROID_SDK_ROOTset to your Android SDK path
Build Commands
# Build debug APK (most common)
./gradlew assembleDebug
# Build release APK (requires signing configuration)
./gradlew assembleRelease
# Install debug APK on connected device
./gradlew installDebug
# Clean and rebuild
./gradlew clean build
# Run all tests
./gradlew test
# Generate test coverage report
./gradlew jacocoTestReport
Output locations:
- Debug APK:
app/build/outputs/apk/debug/app-debug.apk - Release APK:
app/build/outputs/apk/release/app-release.apk
Environment Verification
# Check Android SDK
echo $ANDROID_HOME
adb version
# Check Java version
java -version
# Verify Gradle
./gradlew --version
Testing Guidelines
Unit Testing
- Test business logic in isolation
- Mock external dependencies
- Aim for high code coverage
- Test edge cases and error conditions
Integration Testing
- Test component interactions
- Use test databases for data layer tests
- Verify proper dependency injection
UI Testing
- Test user interactions
- Verify UI state changes
- Use Compose testing APIs
- Test accessibility features
Code Quality
Linting and Static Analysis
# Run lint checks
./gradlew lintDebug
Code Review Guidelines
- Review for architectural consistency
- Check performance implications
- Verify proper error handling
- Ensure adequate test coverage
- Review security implications
Troubleshooting
Common Build Issues
- Gradle sync fails: Check Android Studio version and SDK installation
- Compose version conflicts: Verify Kotlin and Compose compiler versions
- Memory issues: Increase Gradle JVM heap size in
gradle.properties
Debugging
- Use Android Studio debugger
- Add logging with proper log levels
- Use network inspection tools
- Profile app performance regularly
Architecture Overview
Project Myriad follows Clean Architecture principles with MVVM pattern. For complete architectural details, design patterns, and implementation guidelines, see:
π Complete Architecture Documentation
Quick Reference
Module Structure:
app/src/main/kotlin/com/heartlessveteran/myriad/
βββ ui/ # Presentation Layer (Compose UI, ViewModels)
βββ domain/ # Business Logic Layer (Use Cases, Entities)
βββ data/ # Data Layer (Room, Repositories, Network)
βββ di/ # Dependency Injection Setup
Key Principles:
- Single Source of Truth (Room database)
- Unidirectional Data Flow (UI β ViewModel β Use Case β Repository)
- Separation of Concerns (Clear layer boundaries)
- Dependency Inversion (Abstractions over concretions)
Related Documentation
For additional technical information:
- Architecture Documentation - Complete architecture details and patterns
- Requirements Specification - Detailed technical requirements
- Contributing Guidelines - Development standards and contribution process
- Documentation Index - Complete documentation navigation guide
Contributing Guidelines
- Follow the established architecture patterns
- Write tests for new features
- Update documentation for significant changes
- Use meaningful commit messages
- Create focused pull requests