Skip to content

Social Media Share - helps you share content to all your connected social at once.

License

Notifications You must be signed in to change notification settings

jerryOkafor/SMShare

Repository files navigation

SM Share (👷🔧️WIP👷⛏)

kotlin-version Build SMS Share codecov

Get it on Google Play Store Get it on App Store

SMShare is a Kotlin Multiplatform project targeting Android, iOS, Web, Desktop. The UI of SMSahre is written completely in Jetpack Compose and shareed accross iOS, Android and Desktop.

  • /composeApp is for code that will be shared across your Compose Multiplatform applications.
  • /iosApp contains iOS applications.
  • /core - Contains the core components of the codebase as shown below:
    • /common - App Common code [WIP]
    • /config - App Config [WIP]
    • /datbase - Database integration using Room + SQLite
    • /datastore - Datastore intgration using Jetpack Datastoreandkotinx.serialization`
    • /doomain Contains the usecases [WIP]
    • /model - UI models / domain models used in the app
    • /network - Network integreation using ktor and kotlin.serialization
    • /rpc - RPC integration using kotlinx.rpc [WIP]

Sample

Android, iOS and Desktop screenshot sample

More samples

Android

iOS

Desktop

Building

You will require the following rools to build and run SMSahre

  • Android SAndroid Studio Jellyfish | 2023.3.1 or higher
  • Java 17 installed
  • Xcode Version > 15.4
Android

Using Android Studio

Open the KMP project using Android Studio, select the composeApp run configuration and click on run.

Using Fleet

Fleet uses Smart Mode to detect and configure the Android run configuration for you.You can modify in the Run Json file

Using Command line

To run the Android app, use the command below or select the composeApp configuration on Android Studio and click on run.

Desktop

Using Fleet

Fleet uses Smart Mode to detect and configure the Android run configuration for you.You can modify in the Run Json file

Using Command line

./gradlew desktopRun -DmainClass=com.jerryokafor.smshare.MainKt --quiet
iOS

Using XCode

Open iosApp/iosApp.xcworkspace from Xcode and run. Note: You need to have run pod install from the iOSApp directory app

Using Fleet

Fleet uses Smart mode to configure iOS run configuration for you. You can modify in the Run Json file

Server

Using Fleet

Fleet uses Smart mode to detect and configure the various run configurations for you for iOS, Android, Desktop and Server. Ensure the You have Xcode, Android Studio, iOS Simulator, Android Emulator all installed or Physical iphone and Android Devices plugged in.

From Command Line

To run the server code, you can run the gradle command below:

./gradlew :server:run

Open: http://0.0.0.0:8080/ or http://localhost:8080/ to see the response from the server.

To access server from your Android device, run adb reverse tcp:8080 tcp:8080 and then access the app on http://<PC IP>:8080/

Testing Locally from your phone, run the following command:

Android

Ensure yuor android phone is connected and adb is running, then run

adb reverse tcp:8080 tcp:8080

Then open http://localhost:8080 from your android phone to test. You can now also use this in the base url of your api requests for Android.

iOS

For iOS, you can follow this guide : How to open a localhost website on iPhone / iOS

UI Testing

Android Emulator test

./gradlew :composeApp:connectedAndroidTest

iOS Simulator

./gradlew :composeApp:iosSimulatorArm64Test

Desktop

./gradlew :composeApp:desktopTest

Wasm (headless browser)

./gradlew :composeApp:wasmJsTest

Code Style (Todo)

Code Quality

Ensure Code Quality before submitting PR

./gradlew detekt ktlintCheck 

Generate Detekt baseline

./gradlew detektProjectBaseline  

Generate Ktlint Baseline

ktlint -F --baseline=config/ktlint/baseline.xml

or Using Gradle command

./gradlew ktlintFormatBaseline

Todo

  • Add KtLint and Detekt
  • Add Detekt
  • Add Kover
  • Add Codecov
  • Add Code style to readme
  • Add Contributors section
  • Add License section
  • Add Room KMP database
  • Add Datastore

Reference

Contributions

If you've found an error in this sample, please file an issue.

Patches are encouraged and may be submitted by forking this project and submitting a pull request.Since this project is still in its very early stages, if your change is substantial, please raise an issue first to discuss it.

License

The MIT License (MIT)

Copyright (c) 2024 SMShare Projects

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.