|
1 | | -# mark-day |
| 1 | +# MarkDay Diary App |
| 2 | + |
| 3 | +MarkDay is a cross-platform diary and journaling application built with **Kotlin** and **Compose Multiplatform**. The application seamlessly targets **Android**, **Desktop (JVM)**, and **Web (Wasm)** from a unified codebase, maintaining consistency across platforms using Material Design 3. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Cross-Platform:** Write your diary on Android, Desktop, or directly in the browser. |
| 8 | +- **Unified UI:** Beautiful and consistent Material 3 interface across all devices, powered by Compose Multiplatform. |
| 9 | +- **Local Storage:** Fast and reliable text storage utilizing Room Multiplatform (SQLite) on Android, Desktop, and iOS. Web (Wasm) uses in-memory storage with browser localStorage for preferences. |
| 10 | +- **Rich Content:** Support for rich text and image rendering (via multiplatform-markdown-renderer and Coil). |
| 11 | +- **Sync & Backup (Android/Desktop JVM only):** Google Drive integration for seamless data backups and remote sync. Web (Wasm) support is not implemented yet. |
| 12 | + |
| 13 | +## Project Structure |
| 14 | + |
| 15 | +The codebase is organized into Gradle/Kotlin Multiplatform source sets under `composeApp/src`: |
| 16 | +- `commonMain/` – Core business logic, UI layer (Compose), Navigation, API, and DB interfaces. |
| 17 | +- `androidMain/` – Android-specific implementations (e.g., Ktor OkHttp client, Play Services Auth). |
| 18 | +- `jvmMain/` – Desktop entry point, Swing interop, and JVM implementations. |
| 19 | +- `wasmJsMain/` – WebAssembly implementations for browser deployment. |
| 20 | +- `nonWebMain/` – Shared implementations for non-web platforms (Android, Desktop), primarily dealing with local DB interactions using Room. |
| 21 | +- `iosMain/` – iOS-specific logic (currently suspended). |
| 22 | + |
| 23 | +## Prerequisites |
| 24 | + |
| 25 | +To build the MarkDay application, ensure you have the following installed and configured: |
| 26 | + |
| 27 | +- **Java Development Kit (JDK):** JDK 21+ recommended. |
| 28 | +- **Kotlin:** 2.0+ |
| 29 | +- **Android SDK:** Required for Android builds. |
| 30 | + |
| 31 | +## Configuration |
| 32 | + |
| 33 | +### Android Setup |
| 34 | +To build the Android application, you must configure the path to your Android SDK. If you haven't set the `ANDROID_HOME` environment variable, you can create a `local.properties` file in the root of the project. |
| 35 | + |
| 36 | +**Example `local.properties`:** |
| 37 | +```properties |
| 38 | +# Add this file to the project root |
| 39 | +sdk.dir=/path/to/your/android-sdk |
| 40 | +# On Windows, this might look like: sdk.dir=C\:\\Users\\Username\\AppData\\Local\\Android\\Sdk |
| 41 | +# On Linux/Codespaces: sdk.dir=/usr/lib/android-sdk |
| 42 | +``` |
| 43 | + |
| 44 | +### iOS Development |
| 45 | +> This setup ensures that iOS development remains suspended by default (saving build time and avoiding configuration issues on non-Mac environments) but can be easily re-enabled by setting `enableIos=true` in `gradle.properties` or passing `-PenableIos=true` as a command-line argument. |
| 46 | +
|
| 47 | +## Development |
| 48 | + |
| 49 | +### Running the Application |
| 50 | + |
| 51 | +- **Android:** |
| 52 | + ```sh |
| 53 | + ./gradlew installDebug |
| 54 | + ``` |
| 55 | +- **Desktop (JVM):** |
| 56 | + ```sh |
| 57 | + ./gradlew run |
| 58 | + ``` |
| 59 | +- **Web (Wasm):** |
| 60 | + ```sh |
| 61 | + ./gradlew wasmJsBrowserRun |
| 62 | + ``` |
| 63 | + |
| 64 | +### Building for Android (Debug) |
| 65 | +To build a debug APK for Android from the command line, run: |
| 66 | +```sh |
| 67 | +./gradlew assembleDebug |
| 68 | +``` |
| 69 | +Once the build completes successfully, the generated APK will be located at: |
| 70 | +`composeApp/build/outputs/apk/debug/composeApp-debug.apk` |
| 71 | + |
| 72 | +### Running Tests |
| 73 | +To run all multiplatform tests across configured targets: |
| 74 | +```sh |
| 75 | +./gradlew allTests |
| 76 | +``` |
| 77 | +Or to run tests for a specific platform (e.g., Desktop/JVM): |
| 78 | +```sh |
| 79 | +./gradlew composeApp:jvmTest |
| 80 | +``` |
0 commit comments