-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Zahid edited this page May 10, 2025
·
1 revision
This page explains how the Compose for Desktop Wizard works and how its components interact.
The wizard is a static web application built with HTML/CSS/JavaScript that:
- Takes user input via a web form
- Generates a customized project structure
- Creates a ZIP file for download
No server-side processing is required, making it easy to host on GitHub Pages.
docs
βββ index.html
βββ js
βΒ Β βββ gradleFiles.js
βΒ Β βββ script.js
βΒ Β βββ templateFiles.js
βΒ Β βββ themeFiles.js
βΒ Β βββ utils.js
βββ styles.css
- Provides form for project configuration
- Handles user interaction
- Shows loading state during generation
- Orchestrates the generation process
- Manages form submission
- Assembles the final ZIP file
- Provides helper functions for file operations
- Handles text and binary file fetching from GitHub
- Manages error handling
- Contains functions for generating customized source files
- Handles variable replacement in templates
- Creates parameterized files like
build.gradle.kts
,Main.kt
, etc.
- Manages Gradle wrapper files
- Fetches binary JAR files and configuration
- Handles Material Design 3 theme files
- Manages color, typography, and theme configurations
- User Input: User fills out form with project parameters
- Form Submission: event handler captures form data
-
Project Structure Creation:
- Creates folder hierarchy in memory
- Adds files with parameters replaced
-
Template Customization:
- Injects user options into templates
- Adds selected dependencies
-
File Fetching:
- Fetches static files from GitHub repository
- Fetches binary files like Gradle wrapper JAR
-
ZIP Generation:
- Creates ZIP file in memory using JSZip
- Offers download to user
- JSZip: For in-browser ZIP file creation
- FileSaver.js: For offering file downloads to users
- GitHub Pages: For hosting the static website
- GitHub Raw Content: For fetching template files
The generated project follows MVVM architecture with:
-
View Layer: Compose UI components in
App.kt
-
ViewModel Layer: State management in
MainViewModel.kt
-
Model Layer: Data models in
Models.kt
-
Dependency Injection: Koin setup in
AppModule.kt
-
Local Storage: Database functionality in
Database.kt
π¦ Generator | π Wiki Home | π» Repository | π Report Issue
Β© 2025 Compose for Desktop Wizard | Licensed under Apache 2.0 | Made with β€οΈ for the Kotlin/Desktop Developer Community