Skip to content

Conversation

@feragusper
Copy link
Owner

Description

This PR introduces full Web support for SmokeAnalytics using Kotlin Multiplatform (Compose for Web) and Firebase Hosting.
It includes the complete setup for building, configuring, and deploying the web application to both staging and production environments.

The PR also establishes a clean and reproducible deployment workflow using GitHub Actions with manual environment selection.


Motivation and Context

Until now, SmokeAnalytics only supported Android.
This change adds first-class Web support, enabling:

  • A shared domain-driven architecture across Android and Web
  • Firebase Authentication (Google Sign-In) on Web
  • Public hosting via Firebase Hosting (no paid infra)
  • Environment parity between staging and production

The goal is to align Web with the existing mobile setup while keeping:

  • secrets out of the repository
  • builds reproducible
  • deployments explicit and manual

Related Issue: N/A (infrastructure / platform expansion)


Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Minor change / Task
  • Documentation update

Note: This is a large infrastructural change that introduces a new platform (Web).


How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual tests
  • Other

Manual / Integration testing performed:

  • Local Web build via jsBrowserDevelopmentRun
  • Production Web bundle via jsBrowserProductionWebpack
  • Firebase Hosting Emulator (staging + prod)
  • Google Sign-In flow on Web (staging & prod Firebase projects)
  • Environment switching using -Psmoke.env=staging|prod
  • End-to-end deploy to Firebase Hosting (manual)

Repro steps:

./gradlew :apps:web:prepareFirebaseHosting -Psmoke.env=staging
firebase emulators:start --only hosting:staging

./gradlew :apps:web:prepareFirebaseHosting -Psmoke.env=prod
firebase emulators:start --only hosting:prod

Screenshots (if applicable)

N/A (infrastructure-focused PR)


Checklist

  • My code follows the project’s coding style.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation as needed (inline / configuration).
  • My changes do not produce any new warnings.
  • I have added tests that prove my fix or feature works. (tracked separately)
  • All new and existing tests pass locally.
  • Any dependent changes have been merged and published in downstream modules.

Additional Context

Key points of this PR:

  • Kotlin Multiplatform Web (Compose HTML)
  • Shared domain & data layers reused on Web
  • Firebase Web initialization via BuildKonfig
  • Environment-based config (staging / prod)
  • Firebase Hosting with multiple targets
  • Manual GitHub Actions deploy workflow
  • No secrets committed (Firebase API keys treated per Firebase’s public model)
  • Mobile setup remains unchanged

This PR lays the foundation for future Web features and analytics dashboards.

@feragusper feragusper added this to the 0.4 milestone Jan 4, 2026
@feragusper feragusper requested a review from Copilot January 4, 2026 10:21
@feragusper feragusper self-assigned this Jan 4, 2026
@feragusper feragusper added the enhancement New feature or request label Jan 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces comprehensive web support for SmokeAnalytics using Kotlin Multiplatform and Compose for Web. The implementation enables the application to run on web browsers with Firebase Hosting deployment for both staging and production environments, while maintaining feature parity with the existing Android application through shared domain logic.

Key changes include:

  • Migration to Kotlin Multiplatform architecture with shared domain layers
  • Web-specific presentation layers using Compose for Web
  • Firebase Web SDK integration with environment-based configuration
  • Gradle version upgrade and dependency management updates

Reviewed changes

Copilot reviewed 165 out of 251 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
settings.gradle.kts Added web app module and split presentation/data modules by platform (mobile/web)
gradle.properties Enabled experimental JS canvas support for Compose Web
gradle/libs.versions.toml Updated dependencies including Compose Multiplatform, Kotlin, and Firebase libraries
gradle/wrapper/gradle-wrapper.properties Upgraded Gradle from 8.11.1 to 8.14.3
firebase.json Configured Firebase Hosting with staging and production targets
.firebaserc Defined Firebase project mappings for environment-based deployments
libraries/architecture/domain/ Migrated to KMP with kotlinx-datetime replacing java.time
libraries/smokes/domain/ Converted to KMP with kotlinx-datetime and Instant-based APIs
libraries/authentication/domain/ Converted to KMP removing javax.inject dependency
libraries/smokes/data/mobile/ Android-specific Firestore implementation using Instant
libraries/smokes/data/web/ Web Firestore implementation using GitLive Firebase SDK
features/*/presentation/web/ Web presentation layers for all features (Home, History, Stats, Settings, Auth)
apps/web/ Web application entry point with BuildKonfig-based Firebase configuration
buildSrc/ Updated build conventions for KMP and Kover 0.9.2 compatibility
Comments suppressed due to low confidence (2)

gradle/libs.versions.toml:1

  • Duplicate dependency declaration on line 55. The same dependency libs.identity.googleid is already declared on line 54. Remove this duplicate entry.
# Versions

apps/web/src/jsMain/kotlin/com/feragusper/smokeanalytics/FirebaseWebInit.kt:1

  • Remove commented-out code containing hardcoded Firebase credentials. This creates unnecessary clutter and could lead to confusion about which configuration is active.
package com.feragusper.smokeanalytics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +2
import kotlinx.kover.gradle.plugin.dsl.KoverProjectExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure the Kover API changes are compatible across all projects. The migration from koverReport to kover.reports represents a breaking change in the Kover plugin API. Verify all modules build successfully with these changes.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Jan 4, 2026

@feragusper I've opened a new pull request, #110, to work on those changes. Once the pull request is ready, I'll request review from you.

@feragusper feragusper force-pushed the feature/dependenciesUpgrade branch from 1e3430f to 785ac8b Compare January 5, 2026 11:15
@feragusper feragusper merged commit 5ed1f3a into master Jan 5, 2026
1 check passed
@feragusper feragusper deleted the feature/dependenciesUpgrade branch January 5, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants