Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ jobs:
- name: Test
run: pnpm test
- name: Build
env:
NEXT_PUBLIC_GRAPHQL_URL: http://localhost:1337/graphql
STRAPI_API_TOKEN: ci-placeholder
run: pnpm build

lint-ios:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ terraform.tfstate.*
*.tfplan
**/.build/
.gradle/
# Android SDK path (machine-specific)
mobile/android/local.properties
22 changes: 22 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Android: Build only",
"type": "shell",
"command": "./gradlew",
"args": ["assembleDebug"],
"options": {
"cwd": "${workspaceFolder}/mobile/android",
"env": {}
},
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared",
"focus": true
},
"problemMatcher": []
}
]
}
5 changes: 5 additions & 0 deletions mobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ Native apps in same repo, outside Turborepo task graph.
- `android/`: Kotlin + Jetpack Compose

Both consume shared contracts/clients only.

## Local builds

- **iOS**: See [ios/README.md](ios/README.md) for building the app via Xcode or `xcodebuild` (scheme **ForgeMobileApp**, project in `ios/App/`).
- **Android**: See [android/README.md](android/README.md) for `./gradlew assembleDebug` and `installDebug`.
16 changes: 16 additions & 0 deletions mobile/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,19 @@
Native Kotlin + Jetpack Compose app. Outside Turborepo graph.

Integrates via ContentClient; implement using `packages/graphql` GraphQL types.

## Local build

From `mobile/android`:

```bash
./gradlew assembleDebug
```

The debug APK is written to `app/build/outputs/apk/debug/app-debug.apk`. To install and run on a connected device or emulator:

```bash
./gradlew installDebug
```

Requires a JDK (17+) and Android SDK; Android Studio or the command-line tools are sufficient.
23 changes: 22 additions & 1 deletion mobile/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,38 @@ android {
namespace = "com.forge.mobile"
compileSdk = 34

buildFeatures {
compose = true
}

defaultConfig {
applicationId = "com.forge.mobile"
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "0.0.1"
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.14"
}
}

dependencies {
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.activity:activity-compose:1.9.2")
implementation("androidx.compose.ui:ui:1.7.2")
implementation(platform("androidx.compose:compose-bom:2024.09.02"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.ui:ui-tooling-preview")
debugImplementation("androidx.compose.ui:ui-tooling")
}
20 changes: 20 additions & 0 deletions mobile/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:theme="@style/Theme.ForgeMobile">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.forge.mobile

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Theme.ForgeMobile {
StartupScreen()
}
}
}
}

@Composable
private fun StartupScreen() {
Surface(modifier = Modifier.fillMaxSize()) {
Text(
text = "Forge Android",
style = MaterialTheme.typography.headlineMedium,
fontSize = 24.sp,
)
}
}

@Preview(showBackground = true)
@Composable
private fun StartupScreenPreview() {
Theme.ForgeMobile {
StartupScreen()
}
}
23 changes: 23 additions & 0 deletions mobile/android/app/src/main/kotlin/com/forge/mobile/Theme.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.forge.mobile

import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color

private val LightColorScheme = lightColorScheme(
primary = Color(0xFF6200EE),
onPrimary = Color.White,
surface = Color.White,
onSurface = Color.Black,
)

object Theme {
@Composable
fun ForgeMobile(content: @Composable () -> Unit) {
MaterialTheme(
colorScheme = LightColorScheme,
content = content,
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#FFFFFF"
android:pathData="M0,0h108v108h-108z" />
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#6200EE"
android:pathData="M54,30 L78,30 L78,78 L54,78 Z M30,30 L54,30 L54,54 L30,54 Z" />
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
4 changes: 4 additions & 0 deletions mobile/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Forge</string>
</resources>
8 changes: 8 additions & 0 deletions mobile/android/app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.ForgeMobile" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/white</item>
<item name="android:windowLightStatusBar">true</item>
</style>
</resources>
2 changes: 1 addition & 1 deletion mobile/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("com.android.application") version "8.5.2" apply false
id("org.jetbrains.kotlin.android") version "1.9.25" apply false
id("org.jetbrains.kotlin.android") version "1.9.24" apply false
id("org.jlleitschuh.gradle.ktlint") version "12.1.1"
}

Expand Down
5 changes: 5 additions & 0 deletions mobile/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# AndroidX; required when using AndroidX/Compose dependencies
android.useAndroidX=true

# Optional: use non-transitive R classes (smaller builds, recommended for Compose)
android.nonTransitiveRClass=true
Loading
Loading