Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion FloconAndroid/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
"java.configuration.updateBuildConfiguration": "automatic"
}
52 changes: 52 additions & 0 deletions FloconAndroid/AGENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Flocon Project Overview

Flocon is a modular, plugin-based framework built with **Kotlin Multiplatform (KMP)**. It provides a standardized way to integrate common cross-cutting concerns like networking, database access, datastores, and deep linking into applications.

## 🚀 Key Features

- **Modular Architecture**: Separate modules for different functionalities (network, database, etc.).
- **Plugin System**: Easily extensible with "no-op" variants for testing and modularity.
- **KMP Support**: Targets Android, iOS, JVM, and WasmJs.
- **Modern Tech Stack**: Uses Room 3, Ktor, OkHttp, gRPC, and Compose Multiplatform.

## 🛠 Technical Stack

- **Kotlin**: 2.1.0
- **Build System**: Gradle with Version Catalog (`libs.versions.toml`).
- **Dependency Injection**: Manual / Constructor injection (based on current exploration).
- **Asynchronous Programming**: Kotlin Coroutines & Flow.
- **Networking**: Ktor 3.x, OkHttp 4.x, gRPC 1.70.x.
- **Database**: Room 2.x & Room 3.0.0-alpha01.
- **UI**: Compose Multiplatform 1.9.0.

## 📂 Module Structure

- `:flocon`: Core library providing the plugin registration and context management.
- `:database`:
- `:database:core`: Abstractions for database providers.
- `:database:room` / `:database:room3`: Room-based implementations.
- `:network`:
- `:network:core`: Core networking abstractions.
- `:network:okhttp-interceptor` / `:network:ktor-interceptor`: Client-specific interceptors.
- `:grpc`:
- `:grpc-interceptor`: Interceptors for gRPC calls.
- `:datastores`: Modules for Typed DataStore integration.
- `:deeplinks`: Abstractions and implementations for handling deep links.

## 🧩 Core Concepts

### Plugins
Flocon operates on a plugin-based architecture. Modules typically provide a "Core" or implementation module and a "No-Op" module. The No-Op modules allow the app to compile and run without the actual implementation, which is useful for specialized builds or testing.

### Interceptors
For networking and gRPC, Flocon uses an interceptor-based approach to hook into the communication pipeline of standard libraries (OkHttp, Ktor, gRPC).

## 📖 Development Guidelines

- **Multiplatform First**: Always consider KMP compatibility when adding new features or modules.
- **Modularity**: Keep modules focused and avoid circular dependencies.
- **Naming Conventions**: Follow the `io.github.openflocon.flocon` package naming structure.
- **Version Catalog**: All dependency versions must be managed in `gradle/libs.versions.toml`.

---
*Created by Antigravity AI to assist in project understanding.*
125 changes: 125 additions & 0 deletions FloconAndroid/database/core-no-op/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.library)
alias(libs.plugins.vanniktech.maven.publish)
}

kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "11"
}
}
}

jvm()

iosX64()
iosArm64()
iosSimulatorArm64()

wasmJs {
moduleName = "flocon_database_core_no_op"
browser()
binaries.executable()
}

sourceSets {
val commonMain by getting {
dependencies {
implementation(project(":flocon"))
implementation(libs.jetbrains.kotlinx.coroutines.core.fixed)
}
}

val androidMain by getting {
dependencies {
}
}

val jvmMain by getting {
dependencies {
}
}

val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val wasmJsMain by getting
val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
}
}
}

android {
namespace = "io.github.openflocon.flocon.database.core.noop"
compileSdk = 36

defaultConfig {
minSdk = 23

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

mavenPublishing {
publishToMavenCentral(automaticRelease = true)

if (project.hasProperty("signing.required") && project.property("signing.required") == "false") {
// Skip signing
} else {
signAllPublications()
}

coordinates(
groupId = project.property("floconGroupId") as String,
artifactId = "flocon-database-core-no-op",
version = System.getenv("PROJECT_VERSION_NAME") ?: project.property("floconVersion") as String
)

pom {
name = "Flocon Database Core No-Op"
description = project.property("floconDescription") as String
inceptionYear = "2025"
url = "https://github.com/openflocon/Flocon"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "openflocon"
name = "Open Flocon"
url = "https://github.com/openflocon"
}
}
scm {
url = "https://github.com/openflocon/Flocon"
connection = "scm:git:git://github.com/openflocon/Flocon.git"
developerConnection = "scm:git:ssh://git@github.com/openflocon/Flocon.git"
}
}
}
132 changes: 132 additions & 0 deletions FloconAndroid/database/core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.library)
alias(libs.plugins.vanniktech.maven.publish)
alias(libs.plugins.kotlin.serialization)
}

kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "11"
}
}
}

jvm()

iosX64()
iosArm64()
iosSimulatorArm64()

wasmJs {
moduleName = "flocon_database_core"
browser()
binaries.executable()
}

sourceSets {
val commonMain by getting {
dependencies {
api(project(":flocon"))

implementation(libs.jetbrains.kotlinx.coroutines.core.fixed)
implementation(libs.kotlinx.serialization.json)
}
}

val androidMain by getting {
dependencies {
}
}

val jvmMain by getting {
dependencies {
implementation(libs.sqlite.jdbc)
}
}

val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val wasmJsMain by getting
val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
dependencies {
implementation(libs.androidx.sqlite.bundled)
}
}
}
}

android {
namespace = "io.github.openflocon.flocon.database.core"
compileSdk = 36

defaultConfig {
minSdk = 23

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

mavenPublishing {
publishToMavenCentral(automaticRelease = true)

if (project.hasProperty("signing.required") && project.property("signing.required") == "false") {
// Skip signing
} else {
signAllPublications()
}

coordinates(
groupId = project.property("floconGroupId") as String,
artifactId = "flocon-database-core",
version = System.getenv("PROJECT_VERSION_NAME") ?: project.property("floconVersion") as String
)

pom {
name = "Flocon Database Core"
description = project.property("floconDescription") as String
inceptionYear = "2025"
url = "https://github.com/openflocon/Flocon"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "openflocon"
name = "Open Flocon"
url = "https://github.com/openflocon"
}
}
scm {
url = "https://github.com/openflocon/Flocon"
connection = "scm:git:git://github.com/openflocon/Flocon.git"
developerConnection = "scm:git:ssh://git@github.com/openflocon/Flocon.git"
}
}
}
Loading