FastCodeGen is a powerful IntelliJ IDEA / Android Studio plugin that accelerates Kotlin development by automatically generating boilerplate code for ViewModels, Repositories, Compose Screens, and complete features following clean architecture principles.
- Jetpack Compose Screen Generation - Automatically create complete Compose screens
- Navigation Integration - Built-in support for multiple navigation types:
- None - Simple screen without navigation
- Simple - Using
composableRoutefor standard navigation - Type-Safe - Using
composableSafeTypewith@Serializable
- Navigation Parameters - Define and inject navigation parameters automatically
- ViewModel Integration - Auto-wire ViewModels with state collection
- Browse & Auto-Detect - Click π to browse files and auto-detect package paths
- Dynamic Imports - All imports are now based on your configuration
- Navigation Utilities - Configure
composableRouteandcomposableSafeTypepaths - Validation - Settings are validated before code generation
- Modular Panel System - Clean separation of UI components
- Generation Manager - Centralized business logic
- 80% Code Reduction - Main dialog simplified from 800+ to ~150 lines
- StringUtils - Built-in utilities for case conversion
- Include Load Method - Optional
load()method for ViewModel initialization - Optional Repository Methods - Methods, parameters, and return types can be empty
- Improved Validation - Better error messages and validation
- Enhanced UX - Settings button in dialog, help menu, documentation access
Generate complete ViewModel with:
- State sealed class (Idle, Loading, Success, Error)
- Event sealed class (optional)
- UIState data class (optional, with Refreshable support)
- Intent sealed class
- ViewModel class with proper configuration
- Optional
load()method for initialization
Generate repository with:
- Repository interface with custom methods
- Repository implementation with HttpClient support (optional)
- Flow-based async operations
- Fully optional methods, parameters, and return types
Generate Jetpack Compose screen with:
- Complete Composable function structure
- Navigation parameter support (Simple or Type-Safe)
- Optional ViewModel integration with state collection
- Navigation back support
- LaunchedEffect for initialization
- State handling (Loading, Success, Error, Idle)
Generate complete feature including:
- Compose Screen (optional)
- ViewModel State components (optional)
- Repository components (optional)
- Organized folder structure
- Proper imports and dependencies
- β Generate Screen - Create Jetpack Compose screen
- β Generate ViewModel - Include ViewModel State files
- β Generate Repository - Include Repository files
- β Enable Events - Add event handling to ViewModel
- β Enable Refresh - Add refresh capability
- β Enable UIState - Include UI state management
- β Include Load Method - Add initialization method to ViewModel
- β Navigation Type - Choose navigation approach (None/Simple/Type-Safe)
- β Navigation Parameters - Define parameters for type-safe navigation
- β Use Cases - Specify use case dependencies
- β HTTP Client - Include Ktor HttpClient in repository
- β Custom Methods - Define repository methods with optional params and return types
-
Install the Plugin
- Open Settings β Plugins β Marketplace
- Search for "FastCodeGen"
- Click Install and restart IDE
-
Configure Settings (One-time setup)
- Right-click on any package β New β FastCodeGen
- Click βοΈ Settings button
- Configure all required paths:
- Click π next to each field
- Browse to your base class file (e.g.,
AppViewModel.kt) - Plugin auto-detects the full package path
- Click OK to save
-
Start Generating!
- Right-click on target package
- Select New β FastCodeGen
- Choose generation type and configure options
- Open Settings/Preferences β Plugins
- Search for "FastCodeGen"
- Click Install
- Restart IDE
- Download the plugin
.zipfrom releases - Settings/Preferences β Plugins β βοΈ β Install Plugin from Disk
- Select the downloaded file
- Restart IDE
Example: Create a Login Feature with Screen, ViewModel, and Repository
- Right-click on your feature package
- Select New β FastCodeGen
- Select Full Feature
- Click Next β
- Configure:
Feature Name: Login Generation Options: β Generate Screen β Generate ViewModel β Generate Repository Screen Configuration: β Has Navigation Back Navigation Type: Type-Safe Parameters: - email: String - fromSignup: Boolean ViewModel Configuration: β Enable Events β Enable Refresh β Enable UIState β Include Load Method Use Cases: AuthenticationUseCase Repository Configuration: β Needs HttpClient Methods: - login(email: String, password: String) β Flow<User> - validateSession() β Flow<Boolean> - Click Generate
Generated Structure:
login/
βββ ui/
β βββ LoginScreen.kt
βββ viewmodel/
β βββ state/
β β βββ LoginState.kt
β β βββ LoginEvent.kt
β β βββ LoginUIState.kt
β β βββ LoginIntent.kt
β βββ LoginViewModel.kt
βββ domain/
β βββ repo/
β βββ LoginRepo.kt
βββ data/
βββ repo/
βββ LoginRepoImpl.kt
Generation Type: Screen
Feature Name: Profile
β
Has Navigation Back
Navigation Type: Simple
Generation Type: ViewModel State
Feature Name: Dashboard
β
Enable Events
β
Include Load Method
Use Cases: GetStatsUseCase
Generation Type: Repository
Feature Name: User
β
Needs HttpClient
Methods:
- getUser(id: String) β Flow<User>
- updateProfile(user: User) β Flow<Unit>
- IntelliJ IDEA 2024.2+ or Android Studio Koala+
- Kotlin plugin enabled
- Kotlin project with standard source structure
- Base classes configured in settings
- Jetpack Compose (optional, for screen generation)
- Navigation Compose (optional, for navigation features)
Configure the full package paths for:
| Setting | Description | Example |
|---|---|---|
| AppViewModel | Your base ViewModel class | com.myapp.core.viewmodel.AppViewModel |
| ViewModelConfig | Configuration class | com.myapp.core.viewmodel.ViewModelConfig |
| BaseState | Base state interface | com.myapp.core.viewmodel.BaseState |
| BaseEvent | Base event interface | com.myapp.core.viewmodel.BaseEvent |
| BaseUIState | Base UI state interface | com.myapp.core.viewmodel.BaseUIState |
| Refreshable | Refreshable interface | com.myapp.core.viewmodel.Refreshable |
| BaseIntent | Base intent interface | com.myapp.core.viewmodel.BaseIntent |
| Setting | Description | Example |
|---|---|---|
| composableRoute | Function for simple navigation | com.myapp.core.utilities.composableRoute |
| composableSafeType | Function for type-safe navigation | com.myapp.core.utilities.composableSafeType |
| Setting | Description | Example |
|---|---|---|
| Koin Module | Dependency injection module | org.koin.core.module.Module |
package com.myapp.profile.ui
import androidx.compose.runtime.*
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.myapp.profile.viewmodel.ProfileIntent
import com.myapp.profile.viewmodel.ProfileViewModel
import com.myapp.profile.viewmodel.state.ProfileState
import org.koin.androidx.compose.koinViewModel
@Composable
fun ProfileScreen(
userId: String,
fromSettings: Boolean,
navigationBack: () -> Unit,
viewModel: ProfileViewModel = koinViewModel()
) {
val state by viewModel.state.collectAsStateWithLifecycle()
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
LaunchedEffect(Unit) {
viewModel.handleIntent(ProfileIntent.LoadProfile(userId))
}
when (val currentState = state) {
is ProfileState.Loading -> LoadingContent()
is ProfileState.Success -> ProfileContent(
data = currentState.data,
uiState = uiState,
onIntent = viewModel::handleIntent
)
is ProfileState.Error -> ErrorContent(
message = currentState.message,
onRetry = { viewModel.handleIntent(ProfileIntent.LoadProfile(userId)) }
)
ProfileState.Idle -> IdleContent()
}
}package com.myapp.login.viewmodel
import com.myapp.core.viewmodel.AppViewModel
import com.myapp.core.viewmodel.ViewModelConfig
import com.myapp.login.viewmodel.state.LoginIntent
import com.myapp.login.viewmodel.state.LoginState
import com.myapp.login.viewmodel.state.LoginEvent
import com.myapp.login.viewmodel.state.LoginUIState
class LoginViewModel(
private val authenticationUseCase: AuthenticationUseCase
) : AppViewModel<LoginState, LoginEvent, LoginUIState, LoginIntent>(
initialState = LoginState.Idle,
initialUIState = LoginUIState(),
config = ViewModelConfig(
enableRefresh = true,
enableEvents = true
)
) {
init {
loadLogin()
}
override fun handleIntent(intent: LoginIntent) {
when (intent) {
is LoginIntent.ClearState -> setState(LoginState.Idle)
is LoginIntent.LoadLogin -> loadLogin()
is LoginIntent.RefreshRequest -> refreshRequest { loadLogin() }
}
}
override fun createErrorState(message: String): LoginState {
return LoginState.Error(message)
}
override fun createErrorEvent(message: String): LoginEvent {
return LoginEvent.Error(message)
}
private fun loadLogin() {
launch {
setState(LoginState.Loading)
// TODO: Implement
}
}
}// Interface
package com.myapp.user.domain.repo
import kotlinx.coroutines.flow.Flow
interface UserRepo {
fun getUser(userId: String): Flow<User>
fun updateUser(user: User): Flow<Unit>
fun deleteUser(userId: String): Flow<Boolean>
}
// Implementation
package com.myapp.user.data.repo
import com.myapp.user.domain.repo.UserRepo
import io.ktor.client.HttpClient
import kotlinx.coroutines.flow.Flow
class UserRepoImpl(
private val httpClient: HttpClient,
) : UserRepo {
override fun getUser(userId: String): Flow<User> {
TODO("Not yet implemented")
}
override fun updateUser(user: User): Flow<Unit> {
TODO("Not yet implemented")
}
override fun deleteUser(userId: String): Flow<Boolean> {
TODO("Not yet implemented")
}
}- β‘ Save Time - Generate complete features in seconds
- π― Consistency - Follow best practices automatically
- π§ Customizable - Adapt to your project structure
- π¦ Clean Code - Well-organized, maintainable output
- π¨ Modern Stack - Built for Compose and modern Android
- π Standardization - Same code structure across team
- π Onboarding - New developers start faster
- π Productivity - Focus on business logic, not boilerplate
- β Quality - Reduce human error
Solution:
- Ensure all required fields are filled
- Click OK (not Cancel)
- Restart IDE if needed
Solution:
- Verify settings paths are correct using βοΈ button
- Check that base classes exist in your project
- Ensure Kotlin plugin is enabled
- For screens, verify Compose dependencies are added
Solution:
- Check minimum IDE version (2024.2+)
- Verify Kotlin plugin is enabled
- Try: File β Invalidate Caches β Restart
Solution:
- Ensure Jetpack Compose dependencies are in build.gradle
- Verify navigation utilities paths in settings
- Check that
composableRouteorcomposableSafeTypeexist
Solution:
- For Simple navigation: Configure
composableRoutepath - For Type-Safe navigation: Configure
composableSafeTypepath - Ensure navigation utility functions match your project structure
Access comprehensive documentation from the plugin:
- π README - This getting started guide
- π User Guide - Detailed tutorials and examples
- β‘ Quick Reference - Cheat sheet for quick lookup
- π§ Implementation Steps - Setup instructions
- π Plugin Summary - Feature overview
- π Complete Index - All documentation
Click the π Help button in the dialog to access these resources.
- β¨ Screen Generation - Full Jetpack Compose screen generation with navigation
- π§ Navigation Integration - Support for None, Simple, and Type-Safe navigation
- π Type-Safe Navigation - Automatic parameter injection with
@Serializable - π― ViewModel Integration - Auto-wire ViewModels with screens
- π¨ Refactored UI into modular panel system
- π§ Introduced
GenerationManagerfor centralized logic - π¦ 80% code reduction in main dialog (800+ β ~150 lines)
- π οΈ Added
StringUtilsutility (toCamelCase, toPascalCase, toSnakeCase)
- β¨ Comprehensive settings dialog with browse buttons
- π Auto-detect package paths from selected files
- π§ Dynamic imports based on user configuration
- π§ Navigation utilities configuration
- β Settings validation before generation
- π§ Fixed file chooser implementation
- β Include Load Method - Optional initialization in ViewModels
- π Optional repository methods (fully supports empty methods)
- π¨ Enhanced
FeatureGeneratorwith optional Screen creation - π Improved parameter injection in screen generation
- π Enhanced documentation system
- βοΈ Settings button in main dialog
- π Better validation and error messages
- Fixed file chooser behavior in settings dialog
- Improved path detection and validation
- Enhanced error handling in generation process
- π Initial release
- ViewModel State generation
- Repository generation
- Full Feature generation
- K2 Compiler Support
Found a bug or have a feature request?
- π Report Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π§ Email: alialfayed.official@gmail.com
Copyright Β© 2024-2025 Ali Al-Shahat Ali
- GitHub: alfayedoficial/FastCodeGen
- LinkedIn: alfayedoficial
- Email: alialfayed.official@gmail.com
Made with β€οΈ by Ali Al-Shahat Ali
Accelerate your Kotlin development with FastCodeGen
β Star us on GitHub | π¬ Join the Discussion | π Report Issues