Mourshid is an Android mobile application (Kotlin + Java) implementing a multi-screen user experience with background data collection and local persistence. The codebase follows a modular, app-layered structure (activities, viewmodels, repository, network, db, workers) suitable for MVVM-style development and easy iteration in Android Studio.
- Language(s): Kotlin (primary), Java (secondary)
- Framework / runtime: Android SDK (AndroidX / Jetpack-style architecture inferred from package layout)
- Notable structure and libraries:
- Application entry point (MourshidApplication)
- UI layer: activities under app/src/main/java/.../activities (HomepageActivity, MainActivity, GoalsActivity, InsightsActivity)
- Architecture pieces: viewmodels, repository, db, network, workers, ui, navigation
- Build system: Gradle with Gradle wrapper (gradlew / gradlew.bat) and Kotlin-based Gradle scripts
Top-level (important entries)
.gitignore
.idea/ # IDE settings (optional)
README.md
app/ # Android app module (source, manifests, resources)
build.gradle.kts # root Gradle configuration (Kotlin DSL)
gradle.properties
gradle/ # Gradle helper scripts/wrapper configuration
gradlew
gradlew.bat
settings.gradle.kts
app/ (important substructure)
app/
src/
main/
AndroidManifest.xml
java/com/example/mourshid_app/
MourshidApplication.java
activities/ # UI screens: MainActivity.kt, HomepageActivity.kt, GoalsActivity.kt, InsightsActivity.kt
viewmodels/ # ViewModel classes
repository/ # Repository layer: data access coordination
network/ # Networking / API client code
db/ # Local persistence (database) code
data_collection/ # Data collection utilities or flows
workers/ # Background workers (WorkManager or similar)
ui/ # UI helpers, adapters, custom components
models/ # Domain / data models
utils/ # Utility classes and helpers
interfaces/ # Interfaces for callbacks / repositories
navigation/ # Navigation helpers/routes
How it fits together:
- MourshidApplication initializes app-level components.
- Activities in activities/ provide screens; viewmodels/ hold UI state and interact with repository/.
- repository/ mediates between network/ (remote API) and db/ (local persistence); workers/ handle scheduled/background tasks and data collection.
- The Gradle scripts configure dependencies and build settings; the Gradle wrapper allows reproducible builds.
Important: Before building or running the Android app, you must set up and run the backend and point the app at the backend URL.
-
Set up the backend
- Follow the backend setup guide here and run a backend instance:
https://github.com/Mourshid/backend/blob/d17f3b178754b09a2c2b9e48cd46d84ab9bd9b19/README.md - After starting the backend you will have a base URL (for example:
http://localhost:8080for local runs, or a Cloudflare tunnel URL likehttps://throw-bird-...trycloudflare.comif you use cloudflared).
- Follow the backend setup guide here and run a backend instance:
-
Configure the app to use your backend URL
-
Replace the BASE_URL value in these two files with the backend URL you obtained in step 1:
- app/src/main/java/com/example/mourshid_app/network/ActivityLogApiService.kt
- Look for:
private const val BASE_URL = "https://throw-bird-gpl-push.trycloudflare.com"
- Look for:
- app/src/main/java/com/example/mourshid_app/utils/RetrofitInstance.kt
- Look for:
private val BASE_URL = "https://throw-bird-gpl-push.trycloudflare.com"
- Look for:
- app/src/main/java/com/example/mourshid_app/network/ActivityLogApiService.kt
-
Example: if your backend is at
https://my-backend.example.com, change the lines to:
-
// ActivityLogApiService.kt
private const val BASE_URL = "https://my-backend.example.com"
// RetrofitInstance.kt
private val BASE_URL = "https://my-backend.example.com"- Quick command-line replacement (from repository root, adjust the URL as needed):
# macOS / Linux (example)
sed -i '' 's|https://throw-bird-gpl-push.trycloudflare.com|https://my-backend.example.com|g' app/src/main/java/com/example/mourshid_app/network/ActivityLogApiService.kt
sed -i '' 's|https://throw-bird-gpl-push.trycloudflare.com|https://my-backend.example.com|g' app/src/main/java/com/example/mourshid_app/utils/RetrofitInstance.kt
# GNU sed variant (Linux)
sed -i 's|https://throw-bird-gpl-push.trycloudflare.com|https://my-backend.example.com|g' app/src/main/java/com/example/mourshid_app/network/ActivityLogApiService.kt
sed -i 's|https://throw-bird-gpl-push.trycloudflare.com|https://my-backend.example.com|g' app/src/main/java/com/example/mourshid_app/utils/RetrofitInstance.kt- Rebuild after editing so the change is included in the app.
-
Prerequisites for building
- JDK 11+ (or the version configured for the project)
- Android Studio (recommended) or Android SDK + command-line build tools
- An Android device or emulator
-
Build & install
git clone https://github.com/Mourshid/Mourshid-Mobile-App.git
cd Mourshid-Mobile-App
# Build the debug APK
# Linux/macOS
./gradlew clean assembleDebug
# Windows (PowerShell)
.\gradlew.bat clean assembleDebug
# Install to a connected device/emulator
./gradlew installDebug