Skip to content

braiso-22/TerraCambio

Repository files navigation

TerraCambio 🌍⚡️

A Kotlin Compose + Spring Boot API for TerraCambio. This repository contains a minimal, clean architecture-style setup (ports and adapters/hexagonal) for a Listing feature, plus Springdoc OpenAPI for interactive API docs 📑🔍


Recomendation

Open this project from Android Studio latest version for the best development experience, if not using Android Studio you can run the gradlew commands listed in the Build Commands


Structure

I created this project as a mono repo KMP project

The domain logic and its tests is in its own KMP module at Listing and then I have code for each target

Listing folders

🎯 Targets

This is a Kotlin Multiplatform project targeting: 📱 Android · 🍏 iOS · 🌐 Web · 💻 Desktop · 🖥️ Server (JVM)

  • /composeApp 🧩 — Shared UI code across Compose Multiplatform apps.

    • commonMain 🔄 — Code shared by all platforms.
    • Platform-specific folders (e.g. [iosMain], [jvmMain]) handle native integrations.
  • /iosApp 🍏 — Entry point for iOS app (needed even with Compose Multiplatform). Can also include SwiftUI code.

  • /shared 📦 — Business logic shared across all targets.

  • /server ⚙️ — Spring Boot API layer.


📖 API Documentation (Swagger UI)

Once the server is running, open: 👉 http://localhost:8080/swagger-ui/index.html

Provided by springdoc-openapi for exploring available controllers interactively 🎛️


Build commands

🎯 Run the tests

  • macOS/Linux 🐧

    ./gradlew :listing:jvmTest --rerun-tasks
  • Windows 🪟

    .\gradlew.bat :listing:jvmTest --rerun-tasks

▶️ Run Server

  • macOS/Linux 🐧

    ./gradlew :server:run
  • Windows 🪟

    .\gradlew.bat :server:run

📱 Run Android App

  • macOS/Linux 🐧

    ./gradlew :composeApp:assembleDebug
  • Windows 🪟

    .\gradlew.bat :composeApp:assembleDebug

💻 Run Desktop (JVM) App

  • macOS/Linux 🐧

    ./gradlew :composeApp:jvmRun -DmainClass=com.braiso_22.terracambio.MainKt --quiet
  • Windows 🪟

    .\gradlew.bat :composeApp:jvmRun -DmainClass=com.braiso_22.terracambio.MainKt --quiet

🌐 Run Web App

  1. Install Node.js 📦

  2. Build Kotlin/JS shared code

    • macOS/Linux 🐧

      ./gradlew :shared:jsBrowserDevelopmentLibraryDistribution
    • Windows 🪟

      .\gradlew.bat :shared:jsBrowserDevelopmentLibraryDistribution
  3. Run the web app 🚀

    npm install
    npm run start

🍏 Run iOS App

Open /iosApp in Xcode and run it directly ▶️


✨ Learn more about Kotlin Multiplatform