Skip to main content

Quickstart

Get started with Greenhouse Admin in minutes. This guide will help you run the admin portal on your preferred platform.
Greenhouse Admin is a Web-first application. We recommend starting with the Web platform for the fastest setup experience.

Prerequisites

Before you begin, ensure you have the following installed:
  • JDK 11 or higher - Required for Gradle and Kotlin compilation
  • Git - To clone the repository
  • IDE - IntelliJ IDEA or Android Studio (recommended)
Make sure your JAVA_HOME environment variable is set correctly and points to JDK 11 or higher.

Running the web application

1

Clone the repository

git clone https://github.com/apptolast/greenhouse-admin.git
cd greenhouse-admin
2

Configure API endpoint

Create a local.properties file in the project root:
API_BASE_URL=https://your-api-endpoint.com/api/v1/
The API base URL should include the /api/v1/ suffix. This will be injected into the BuildKonfig configuration at compile time.
3

Run the development server

For WebAssembly (recommended for modern browsers):
./gradlew :composeApp:wasmJsBrowserDevelopmentRun
For JavaScript (legacy browser support):
./gradlew :composeApp:jsBrowserDevelopmentRun
On Windows, use gradlew.bat instead of ./gradlew
4

Access the application

Once the development server starts, open your browser to:
http://localhost:8080
You should see the Greenhouse Admin login screen with the dark theme and neon green accents.

Running on other platforms

Build and run the Android application:
./gradlew :composeApp:assembleDebug
Or use the run configuration in Android Studio’s toolbar.Requirements:
  • Android SDK with API 24+ (Android 7.0)
  • Android device or emulator

Project structure

Understand the codebase organization:
composeApp/src/
├── commonMain/          # Shared code for all platforms
│   └── kotlin/com/apptolast/greenhouse/admin/
│       ├── presentation/
│       │   ├── ui/                 # Compose UI screens
│       │   │   └── theme/          # Material 3 theme
│       │   └── viewmodel/          # ViewModels
│       ├── domain/
│       │   └── repository/         # Repository interfaces
│       ├── data/
│       │   ├── model/              # Data models
│       │   ├── remote/             # API services
│       │   └── repository/         # Repository implementations
│       ├── di/                     # Koin modules
│       └── util/                   # Utilities
├── androidMain/         # Android-specific code
├── iosMain/             # iOS-specific code
├── jvmMain/             # Desktop-specific code
├── jsMain/              # JavaScript target
└── wasmJsMain/          # WebAssembly target
The commonMain source set contains 90%+ of the application code. Platform-specific folders only contain platform initialization and native API calls.

Development workflow

Hot reload

Greenhouse Admin includes Compose Hot Reload for rapid iteration:
// Make changes to your Compose UI
@Composable
fun MyScreen() {
    Text("Updated content")  // Changes reflect immediately
}

Dependency injection

Use Koin to inject ViewModels in your Composables:
import org.koin.compose.viewmodel.koinViewModel

@Composable
fun DashboardScreen() {
    val viewModel: DashboardViewModel = koinViewModel()
    val state by viewModel.state.collectAsState()
    
    // Use state in your UI
}

Making API calls

ViewModels use repositories for data operations:
class ClientViewModel(
    private val repository: ClientRepository
) : ViewModel() {
    private val _clients = MutableStateFlow<List<Client>>(emptyList())
    val clients = _clients.asStateFlow()
    
    fun loadClients() {
        viewModelScope.launch {
            val result = repository.getClients()
            _clients.value = result
        }
    }
}

Updating dependencies

After changing JavaScript dependencies in build.gradle.kts, you must upgrade the Yarn lock files:
# For JavaScript target
./gradlew kotlinUpgradeYarnLock

# For WebAssembly target
./gradlew kotlinWasmUpgradeYarnLock

Next steps

Installation guide

Complete installation instructions for all platforms

Architecture

Deep dive into MVVM architecture and design patterns

API reference

Explore repository interfaces and data models

Development guide

Set up your development environment

Troubleshooting

Build fails with “JAVA_HOME not set”

Set your Java home environment variable:
export JAVA_HOME=/path/to/jdk-11

Web application doesn’t start

Ensure you’re using a modern browser that supports WebAssembly:
  • Chrome 119+
  • Firefox 120+
  • Safari 17+
  • Edge 119+
For older browsers, use the JavaScript target instead of Wasm.

API requests fail

Verify your local.properties file contains the correct API_BASE_URL and includes the /api/v1/ suffix.
For more detailed troubleshooting, check the GitHub Issues page.

Build docs developers (and LLMs) love