• Stars
    star
    123
  • Rank 290,145 (Top 6 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created almost 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in Kotlin with Jetpack Compose and a backed in Kotlin hosted on AppEngine.

Conferences4Hall

Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in Kotlin with Jetpack Compose and a backed in Kotlin hosted on AppEngine.

Backend Features

Mobile Features

  • Select your conference
  • Conference schedule
  • Bookmarking of talks
  • Speaker page with biography, socials and talks
  • Networking space which privacy respect from mobile to mobile
  • Partners with description, socials, jobs and location
  • Event page with socials, location, menus, q&a and code of conduct
  • Scan your event ticket
  • Enjoy your conference!

Build With

  • Kotlin - First class and official programming language for Android development
  • Jetpack Compose - Modern toolkit for building native UI
  • Accompanist - Collection of extension libraries for Jetpack Compose
  • Coil - Media management and image loading framework for Android
  • ViewModel - Stores UI-related data that isn't destroyed on UI changes
  • Navigation Compose - Allow users to navigate across, into, and back out from the different pieces of content within your app
  • Swift - First class and official programming language for iOS development
  • SwiftUI - Build apps across all Apple platforms with Swift
  • Kotlin Coroutines - Light-weight threads
  • kotlinx.serialization - Kotlin Multiplatform / multi format serialization
  • SQLDelight - Generates typesafe Kotlin APIs from SQL
  • Okio - A modern I/O library for Android, Java, and Kotlin Multiplatform
  • Multiplatform Settings - Kotlin Multiplatform library for saving simple key-value data
  • ktor - Client to make HTTP request and HTTP server routing
  • Firestore - JVM client to make request on Firestore
  • Storage - JVM client to make request on Storage

Architecture

Kotlin Multiplatform project where :androidApp and :iosApp share the same codebase for the business logic (with :shared module). :backend and :shared modules share the same models due to :models module and avoid any errors in the parsing of backend responses.

3 design system are used in this project and can be found in theme-{ds-name}. All these modules contains features and ui modules to bind Composable with their ViewModels and to create all components of the Design System.

flowchart LR
    :androidApp --> :theme-m3:features
    :theme-m3:features --> :theme-m3:ui
    :theme-m3:features --> :ui-resources
    :theme-m3:features --> :android-data
    :theme-m3:features --> :shared
    :theme-m3:ui --> :ui-resources
    :theme-m3:ui --> :ui-camera
    :androidApp --> :theme-vitamin:features
    :theme-vitamin:features --> :theme-vitamin:ui
    :theme-vitamin:features --> :ui-resources
    :theme-vitamin:features --> :android-data
    :theme-vitamin:features --> :shared
    :theme-vitamin:ui --> :ui-resources
    :theme-vitamin:ui --> :ui-camera
    :androidApp --> :android-data
    :androidApp --> :shared
    :iosApp --> :shared
    :shared --> :models
    :backend --> :models

Testing

Running in local

Start firebase emulators inside a terminal with Firestore service.

firebase login # If you are not yet logged
firebase emulators:start --project $RANDOM_FIREBASE_PROJECT_ID

Start appengine server inside another terminal to interact with the local instance of your Firebase.

export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
export PROJECT_ID=$RANDOM_FIREBASE_PROJECT_ID
export BASE_URL_CONFERENCE_HALL=conference-hall.io
./gradlew :backend:installDist && ./backend/build/install/backend/bin/backend

Now, you can start to interact with the backend.

Deploy in GCP

Prerequisites

  • Billing account enabled on your GCP project
  • Gcloud app created: gcloud app create
  • Cloud Build service enabled
  • Cloud Firestore service enabled
  • Secret Manager enabled
  • Geocoding enabled
  • Add secret GEOCODE_API_KEY in Secret Manager with geocoding api key

Deploy in GCP with AppEngine

Be sure to edit the app.yaml file in backend/src/main/appengine folder with your project id before to deploy.

# If you are not yet logged
gcloud auth login
gcloud config set project $PROJECT_ID
# Deploy in production
./gradlew :backend:appengineDeploy

Deploy in GCP with Cloud Run

# If you are not yet logged
gcloud auth login
gcloud config set project $PROJECT_ID
# Deploy in production
gcloud builds submit --timeout 1h --tag gcr.io/$PROJECT_ID/$IMAGE:$TAG .
gcloud run deploy $IMAGE --image=eu.gcr.io/$PROJECT_ID/$IMAGE:$TAG \
  --platform managed \
  --port 8080 \
  --region europe-west1 \
  --set-env-vars=IS_CLOUD=true \
  --set-env-vars=BASE_URL_CONFERENCE_HALL=conference-hall.io \
  --set-env-vars=PROJECT_ID=$PROJECT_ID \
  --set-env-vars=GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS

References

License

Copyright 2022 Gérard Paligot.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.