Group Members:
- Nicholas Thai (Gitmaster)
- Nathan Soto (Project Manager)
- Devin Dao (Communications Lead)
- Minseo Lee (Quality Assurance Tester)
- Peter Nguyen (Design Lead)
This is an Android app for your fitness needs. Features include workout generator/logger, calorie/macro tracker, news, and social media. The app uses Kotlin Multiplatform, so it may be runnable on iOS. However, it has only been tested on Android.
- Install Docker. This will be used to setup the database.
- Install the latest JDK if you do not already have a JDK installed.
- Install Android Studio.
- Install the Kotlin Multiplatform plugin on Android Studio.
- Clone this repo.
- Open it in Android Studio.
- Wait for Android Studio to fully sync and index all the files. This may take a long time for the first time because it has to download all the dependencies.
- Copy
.env.template
to a new file named.env
.
Note: After the project is synced and indxed, you may get the warning
Duplicate content roots detected
. This is a bug with Android Studio, and you can ignore it.
There are two variables in .env
that you need to configure for the app to work:
If you are planning to run the app on Android Studio's emulator, you can skip this step. Otherwise, you need to configure this. When running on a real phone, your phone needs to know what the IP address of the backend is. You must set this variable to the local IP address of your computer.
To get your computer's local IP address, it depends on your operating system:
Once you've gotten your local IP address, set it in this variable.
The backend uses Microsoft's Bing Search API to search for news articles. You must set this variable for the app to work.
Register a Microsoft Azure account and activate your free trial. If you already have an old Azure account with an expired free trial, you can activate a pay-as-you-go plan. Don't worry, no costs will be charged because you can use the free tier.
Once you've registered an account, create a Bing Search resource here. You will need to configure some fields:
- For the resource group, it doesn't matter. Create a new one if you don't have a resource group.
- For the pricing tier, you can use
F1
, which is the free tier. - For the name, put anything. It does not matter.
Once you have created the resource, you need to get one of the subscription keys. From the web page of your resource, click the link next to "Manage keys".
Once you've clicked on the link, copy either key to your clipboard. Paste it in this variable.
Before you run the app, open Docker Desktop. This is to make sure the Docker Daemon is running on your computer.
You will run the app using Android Studio's run configurations feature. It is located on the top right of Android Studio and looks like this:
Run the Backend
run configuration.
When running for the first time, it may take a while.
This will do the following:
- Spin up the database using Docker Compose.
- Build the server into a
jar
file. - Run the built
jar
file.
While the database is running, you can navigate to http://localhost:26545/ to view database graphically.
While Backend
is running. Switch the run configuration to Frontend
. Then, run it. This will do the following:
- Build the Android app into an APK.
- Install the app your phone or emulator.
- Run it on your phone or emulator.
- Don't commit to the main branch. Instead, create feature branches off of dev branch.
- Use meaningful commit and branch names.
- Format your code before committing.
- Follow the code conventions.
- Navigate to File > Settings > Tools > Actions on Save.
- Enable Reformat code and Optimize imports.
- Navigate to Version Control > Git.
- Enable staging area.
- Kotlin
- Kotlin Multiplatform
- Jetpack Compose
- List of Composables
- Material 3 Components
- Material Icons
- Ktor
-
/composeApp
is for code that will be shared across your Compose Multiplatform applications. It contains several subfolders:commonMain
is for code that’s common for all targets.- Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name.
For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app,
iosMain
would be the right folder for such calls.
-
/iosApp
contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform, you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project. -
/server
is for the Ktor server application. -
/shared
is for the code that will be shared between all targets in the project. The most important subfolder iscommonMain
. If preferred, you can add code to the platform-specific folders here too.