Skip to content

Commit 1693ead

Browse files
committed
refactor: naming conventions updated
1 parent 0109e62 commit 1693ead

File tree

32 files changed

+205
-76
lines changed

32 files changed

+205
-76
lines changed

.github/workflows/build.yml

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- name: Decode google-services.json
2424
run: echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 -d > ./app/google-services.json
2525

26+
- name: Decode Keystore
27+
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > keystore.properties
28+
2629
- name: Set up JDK 17
2730
uses: actions/setup-java@v4
2831
with:

.github/workflows/detekt_lint.yml

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
on:
22
pull_request:
3-
branches:
4-
- main
5-
workflow_dispatch:
3+
branches: [main]
64

75
jobs:
86
dekekt:
@@ -21,6 +19,17 @@ jobs:
2119
- name: Decode google-services.json
2220
run: echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 -d > ./app/google-services.json
2321

22+
- name: Decode Keystore
23+
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > keystore.properties
24+
25+
- name: Create local.properties and add API Keys
26+
run: |
27+
echo "MAPS_API_KEY=${{ secrets.MAPS_API_KEY }}" >> local.properties
28+
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> local.properties
29+
echo "PALM_API_KEY=${{ secrets.PALM_API_KEY }}" >> local.properties
30+
echo "WEB_CLIENT_ID=${{ secrets.WEB_CLIENT_ID }}" >> local.properties
31+
echo "UNSPLASH_BASE_URL=${{ secrets.UNSPLASH_BASE_URL }}" >> local.properties
32+
2433
- name: Set up JDK 17
2534
uses: actions/setup-java@v4
2635
with:
@@ -36,13 +45,5 @@ jobs:
3645
- name: Set gradlew executable
3746
run: chmod +x ./gradlew
3847

39-
- name: Create local.properties and add API Keys
40-
run: |
41-
echo "MAPS_API_KEY=${{ secrets.MAPS_API_KEY }}" >> local.properties
42-
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> local.properties
43-
echo "PALM_API_KEY=${{ secrets.PALM_API_KEY }}" >> local.properties
44-
echo "WEB_CLIENT_ID=${{ secrets.WEB_CLIENT_ID }}" >> local.properties
45-
echo "UNSPLASH_BASE_URL=${{ secrets.UNSPLASH_BASE_URL }}" >> local.properties
46-
4748
- name: Build and run detekt
4849
run: ./gradlew detekt

.github/workflows/release_with_apk.yml

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
echo "WEB_CLIENT_ID=${{ secrets.WEB_CLIENT_ID }}" >> local.properties
3636
echo "UNSPLASH_BASE_URL=${{ secrets.UNSPLASH_BASE_URL }}" >> local.properties
3737
38+
- name: Decode Keystore
39+
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > keystore.properties
40+
3841
- name: Set up JDK 17
3942
uses: actions/setup-java@v4
4043
with:

README.md

+53-33
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1+
---
2+
runme:
3+
id: 01HQGK9942PRCD1VKM5D2W2VJP
4+
version: v3
5+
---
6+
17
<h1 align="center">Gptmap🗺️🤖</h1>
28
<p align="center">Welcome to Gptmap, a startup project crafted using Kotlin and Jetpack Compose.</p>
39
<p align="center" text-align="center">This project will guide you through creating a comprehensive Android application using a modern toolkit, highlighting the integration of AI technologies and illustrating the real-world applications of these advanced technologies, providing valuable insights and best practices.</p>
410

511
![Feature](public/images/feature.png)
612

713
## Download
14+
815
Go to the [Releases](https://github.com/f-arslan/GptMap/releases) to download the latest APK.
916

1017
## Table of Contents
18+
1119
- [Tech Stack & Open-source Libraries](#tech-stack--open-source-libraries)
1220
- [Architecture Overview](#architecture-overview)
1321
- [App Demos](#app-demos)
@@ -18,53 +26,69 @@ Go to the [Releases](https://github.com/f-arslan/GptMap/releases) to download th
1826
- **[Kotlin](https://kotlinlang.org/)**: The primary language for application development, emphasizing safety, simplicity, and interoperability.
1927
- **[Jetpack Compose](https://developer.android.com/jetpack/compose)**: Used for modern UI development, leveraging custom composables and animations for a dynamic and responsive design.
2028
- **Jetpack Libraries**:
21-
- **ViewModel**: Centralizes UI-related data management, making it resilient to configuration changes.
22-
- **Lifecycle**: Observes component lifecycles to ensure appropriate UI actions are taken at each stage.
23-
- **SavedStateHandle**: Enhances state management by preserving UI data across system-initiated process terminations.
24-
- **DataStore**: A modern data storage solution that utilizes Kotlin coroutines and Flow to store data asynchronously, securely, and consistently, serving as a replacement for SharedPreferences.
29+
- **ViewModel**: Centralizes UI-related data management, making it resilient to configuration changes.
30+
- **Lifecycle**: Observes component lifecycles to ensure appropriate UI actions are taken at each stage.
31+
- **SavedStateHandle**: Enhances state management by preserving UI data across system-initiated process terminations.
32+
- **DataStore**: A modern data storage solution that utilizes Kotlin coroutines and Flow to store data asynchronously, securely, and consistently, serving as a replacement for SharedPreferences.
33+
2534
- **[Ktor](https://ktor.io/)**: Enables server and client-side HTTP communications, seamlessly integrating with various third-party APIs for extended functionality.
2635
- **Database and Storage Solutions**:
27-
- **MongoDB Realm**: Provides a robust local database and synchronization solutions, enabling efficient offline data access and seamless cloud integration. It also implements **JWT Authentication** for secure user authentication and data access.
28-
- **Firebase Firestore and Storage**: Facilitates real-time data synchronization and scalable cloud storage, ensuring smooth data operations and media management.
36+
- **MongoDB Realm**: Provides a robust local database and synchronization solutions, enabling efficient offline data access and seamless cloud integration. It also implements **JWT Authentication** for secure user authentication and data access.
37+
- **Firebase Firestore and Storage**: Facilitates real-time data synchronization and scalable cloud storage, ensuring smooth data operations and media management.
38+
2939
- **Asynchronous Programming**:
30-
- **[Coroutines](https://github.com/Kotlin/kotlinx.coroutines)** and **[Flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/)**: Manage asynchronous tasks and streamline data stream processing, guaranteeing a smooth user experience.
40+
- **[Coroutines](https://github.com/Kotlin/kotlinx.coroutines)** and **[Flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/)**: Manage asynchronous tasks and streamline data stream processing, guaranteeing a smooth user experience.
41+
3142
- **Authentication Systems**:
32-
- **Firebase Auth**: Offers support for diverse authentication mechanisms, including email & password and Gmail, ensuring secure user access and streamlined account management.
33-
- **[MongoDB Realm JWT Auth](https://www.mongodb.com/docs/atlas/app-services/authentication/custom-jwt/)**: Implements JSON Web Token (JWT) authentication to ensure secure and scalable user authentication within the MongoDB Realm ecosystem.
43+
- **Firebase Auth**: Offers support for diverse authentication mechanisms, including email & password and Gmail, ensuring secure user access and streamlined account management.
44+
- **[MongoDB Realm JWT Auth](https://www.mongodb.com/docs/atlas/app-services/authentication/custom-jwt/)**: Implements JSON Web Token (JWT) authentication to ensure secure and scalable user authentication within the MongoDB Realm ecosystem.
45+
3446
- **Dependency Injection Frameworks**:
35-
- **[Dagger2](https://dagger.dev/)**, **[Hilt](https://dagger.dev/hilt/)**, and **[Koin](https://insert-koin.io/)**: Provide scalable and maintainable object creation and management, optimizing app architecture and development workflow.
47+
- **[Dagger2](https://dagger.dev/)**, **[Hilt](https://dagger.dev/hilt/)**, and **[Koin](https://insert-koin.io/)**: Provide scalable and maintainable object creation and management, optimizing app architecture and development workflow.
48+
3649
- **APIs & Services Integration**:
37-
- **Google Maps API**: Enhances app functionality with comprehensive mapping and location services.
38-
- **Third-party APIs (Gemini, Palm, ChatGPT, Unsplash)**: Enrich the application with a diverse range of services, including cryptocurrency data, AI-generated content, and high-quality images.
50+
- **Google Maps API**: Enhances app functionality with comprehensive mapping and location services.
51+
- **Third-party APIs (Gemini, Unsplash)**: Enrich the application with a diverse range of services, including cryptocurrency data, AI-generated content, and high-quality images.
52+
3953
- **Image Loading and Animation Libraries**:
40-
- **Coil**: Efficiently loads and displays images, optimizing memory and network usage.
41-
- **Lottie**: Implements complex animations sourced from JSON files, enriching the UI with engaging visuals.
54+
- **Coil**: Efficiently loads and displays images, optimizing memory and network usage.
55+
- **Lottie**: Implements complex animations sourced from JSON files, enriching the UI with engaging visuals.
56+
4257
- **Material Design 3**: Adopts the latest Material Design guidelines for a cohesive, dynamic user interface and enhanced user experience, leveraging the newest components, theming, and layout principles.
4358
- **[Kotlin Symbol Processing (KSP)](https://github.com/google/ksp)**: Streamlines code generation and processing, enhancing development efficiency.
4459
- **WorkManager**: Manages background tasks and asynchronous operations, ensuring reliable execution under various system conditions.
4560
- **Architectural Patterns**:
46-
- **MVVM and MVI**: Adopt modern architectural patterns for a clean separation of concerns, facilitating the development of testable and maintainable code.
61+
- **MVVM and MVI**: Adopt modern architectural patterns for a clean separation of concerns, facilitating the development of testable and maintainable code.
62+
4763
- **Core Android Features**:
48-
- Utilizes Services, Broadcast Receivers, and Intents for robust background processing and inter-component communication.
64+
- Utilizes Services, Broadcast Receivers, and Intents for robust background processing and inter-component communication.
65+
4966
- **Project Organization**:
50-
- Implements a multi-module structure with a version catalogue, promoting modular development and easier dependency management.
67+
- Implements a multi-module structure with a version catalogue, promoting modular development and easier dependency management.
68+
5169
- **Networking**:
52-
- **[Retrofit](https://github.com/square/retrofit)**: Simplifies REST API communication, enhancing data exchange and integration.
70+
- **[Retrofit](https://github.com/square/retrofit)**: Simplifies REST API communication, enhancing data exchange and integration.
71+
5372
- **[Docker](https://www.docker.com/)**: Utilizes container technology for consistent development, testing, and deployment environments.
5473
- **Secure Management**:
55-
- **GCP Secret Manager**: Safeguards sensitive information, ensuring secure access and storage of secrets.
74+
- **GCP Secret Manager**: Safeguards sensitive information, ensuring secure access and storage of secrets.
75+
5676
- **Testing Suite**:
57-
- Employs **JUnit 4 & 5**, **[Mockk](https://mockk.io/)**, and **[turbine](https://github.com/cashapp/turbine)** for comprehensive testing across units and integration points.
77+
- Employs **JUnit 4 & 5**, **[Mockk](https://mockk.io/)**, and **[turbine](https://github.com/cashapp/turbine)** for comprehensive testing across units and integration points.
78+
5879
- **Code Quality Tools**:
59-
- **Detekt**: Monitors code quality and maintainability, enforcing best practices and coding standards.
80+
- **Detekt**: Monitors code quality and maintainability, enforcing best practices and coding standards.
6081

6182
### Architecture Overview
62-
![GptmapArchıtecture](public/images/gptmapArc.jpg)
83+
84+
![GptmapArchıtecture](public/images/gptmapArc.png)
6385

6486
<p>This project is designed following the principles of Clean Architecture, utilizing a multi-modular approach. It includes several layers, including the UI Layer, Domain Layer, Data Layer, and the backend, to ensure a solid separation of concerns and enhance maintainability.
6587

66-
For the backend, Ktor for server-side logic, MongoDB for database management (Realm Sync and Auth for synchronization and authentication), Firebase for authentication, storage, and real-time database capabilities (Auth, Storage, Firestore), and GCP's Secret Manager for secure management of secrets and API keys.</p>
88+
For the backend, Ktor for server-side logic, MongoDB for database management (Realm Sync and Auth for synchronization and authentication), Firebase for authentication, storage, and real-time database capabilities (Auth, Storage, Firestore), and GCP's Secret Manager for secure management of secrets and API keys.
89+
6790
## App Demos
91+
6892
Check out the [resources](public/) for the full list.
6993

7094
https://github.com/f-arslan/GptMap/assets/66749900/68769bcf-8dcc-4e9d-8bec-6d6f393dc7b6
@@ -73,32 +97,28 @@ https://github.com/f-arslan/GptMap/assets/66749900/37f69fa5-bd37-41da-8688-15c74
7397

7498
https://github.com/f-arslan/GptMap/assets/66749900/889fdcf8-8989-4d2d-8752-88cdbe6747cb
7599

76-
77100
### Setup and Configuration Guide
78101

79102
Getting started with this project involves several key steps to ensure everything is set up correctly. Follow this guide to configure your development environment and integrate all necessary services:
103+
80104
1. **Android Studio Iguana**: This project is optimized for Android Studio Iguana. While it might work on lower versions, Gradle plugin 8.2.2 is required for the best experience. If you're using an older version, consider updating to avoid compatibility issues.
81-
82-
2. **Setting up `local.properties`**: This file contains essential environment variables. You won't need an OpenAI key as it will be deprecated. Fill in the necessary API keys and URLs except for the OpenAI key:
105+
2. **Setting up `local.properties`**: This file contains essential environment variables. You won't need an OpenAI key as it will be deprecated. Fill in the necessary API keys and URLs except for the OpenAI key:
83106

84-
```properties
107+
```properties {"id":"01HQGK9942PRCD1VKM59AC6BYM"}
85108
sdk.dir=<path_to_your_android_sdk>
86109
MAPS_API_KEY=<your_google_maps_api_key>
87110
OPENAI_API_KEY= (will be deprecated, no need to fill this)
88111
PALM_API_KEY=<your_gemini_api_key>
89112
UNSPLASH_BASE_URL=<unsplash_api_base_url>
113+
90114
```
91115

92-
Ensure you replace placeholder text with actual values relevant to your development environment.
93-
116+
Ensure you replace placeholder text with actual values relevant to your development environment.
117+
94118
3. **Remove Keystore Related Configurations**: For development purposes, remove or comment out any keystore configurations in your Gradle build files. This simplifies the build process for initial setup and testing.
95-
96119
4. **Setup Docker and GCP Secret Manager**: Docker is used for containerization, ensuring a consistent environment for development and deployment. GCP Secret Manager stores and manages access to your application's secrets. Skipping this step means you won't be able to use AI features on images, though you can still proceed with other functionalities. For Docker, install Docker and follow the setup instructions for your OS. For GCP Secret Manager, set up a GCP account, create a new project, and follow the instructions to store your secrets.
97-
98120
5. **Firebase Setup**: To integrate Firebase, create a new project in the Firebase console, register your app, and download the `google-services.json` file. Place this file in your app's `app` directory. This step is crucial for utilizing Firebase Auth, Firestore, and Storage.
99-
100121
6. **MongoDB Atlas Setup**: Sign up or log in to MongoDB Atlas, create a new cluster, and connect your application using the provided connection string. Ensure you've configured the network access and database user for your cluster.
101-
102122
7. **GCP Account Requirement**: A Google Cloud Platform (GCP) account is necessary for utilizing Google Maps API and GCP Secret Manager. If you don't already have an account, sign up at [GCP's website](https://cloud.google.com/) and set up billing to access these services.
103123

104124

app/build.gradle.kts

+6
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,18 @@ android {
5252
"proguard-rules.pro"
5353
)
5454
signingConfig = signingConfigs.getByName("config")
55+
// baselineProfile.automaticGenerationDuringBuild = true
5556
}
5657
}
5758

5859
namespace = "com.espressodev.gptmap"
5960
}
6061

62+
baselineProfile {
63+
dexLayoutOptimization = true
64+
baselineProfileRulesRewrite = true
65+
}
66+
6167
dependencies {
6268
implementation(projects.feature.map)
6369
implementation(projects.feature.login)

app/release/output-metadata.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
"outputFile": "app-release.apk"
1717
}
1818
],
19-
"elementType": "File"
19+
"elementType": "File",
20+
"minSdkVersionForDexing": 26
2021
}

config/detekt/detekt.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ complexity:
106106
ignoreOverloaded: false
107107
CyclomaticComplexMethod:
108108
active: true
109-
threshold: 15
109+
threshold: 20
110110
ignoreSingleWhenExpression: false
111111
ignoreSimpleWhenEntries: false
112112
ignoreNestingFunctions: false
@@ -132,7 +132,7 @@ complexity:
132132
LongParameterList:
133133
active: true
134134
functionThreshold: 60
135-
constructorThreshold: 8
135+
constructorThreshold: 10
136136
ignoreDefaultParameters: true
137137
ignoreDataClasses: true
138138
ignoreAnnotatedParameter: ['Composable', 'Preview']
@@ -167,8 +167,8 @@ complexity:
167167
TooManyFunctions:
168168
active: true
169169
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
170-
thresholdInFiles: 16
171-
thresholdInClasses: 16
170+
thresholdInFiles: 20
171+
thresholdInClasses: 20
172172
thresholdInInterfaces: 11
173173
thresholdInObjects: 11
174174
thresholdInEnums: 11

core/common/src/main/kotlin/com/espressodev/gptmap/core/common/di/CommonModule.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.espressodev.gptmap.core.common.module
1+
package com.espressodev.gptmap.core.common.di
22

33
import com.espressodev.gptmap.core.common.LogService
44
import com.espressodev.gptmap.core.common.NetworkMonitor

core/data/src/main/kotlin/com/espressodev/gptmap/core/data/di/DataModule.kt

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import dagger.Module
1717
import dagger.hilt.InstallIn
1818
import dagger.hilt.components.SingletonComponent
1919

20-
2120
@Module
2221
@InstallIn(SingletonComponent::class)
2322
interface DataModule {

core/data/src/main/kotlin/com/espressodev/gptmap/core/data/repository/FavouriteRepository.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import com.espressodev.gptmap.core.model.Location
44

55
interface FavouriteRepository {
66
suspend fun saveImageForLocation(location: Location): Result<Unit>
7-
}
7+
}

core/data/src/main/kotlin/com/espressodev/gptmap/core/data/repository/FileRepository.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ package com.espressodev.gptmap.core.data.repository
33
interface FileRepository {
44
suspend fun deleteFilesFromInternal(filenames: List<String>, dir: String): Result<Unit>
55
suspend fun saveImageToInternal(imageUrl: String, fileId: String, size: Int): Result<Unit>
6-
}
6+
}

core/data/src/main/kotlin/com/espressodev/gptmap/core/data/repository/impl/AuthenticationRepositoryImpl.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.espressodev.gptmap.core.data.repository.impl
22

3-
import com.espressodev.gptmap.core.model.di.Dispatcher
4-
import com.espressodev.gptmap.core.model.di.GmDispatchers.IO
53
import com.espressodev.gptmap.core.data.repository.AuthenticationRepository
64
import com.espressodev.gptmap.core.data.util.runCatchingWithContext
75
import com.espressodev.gptmap.core.firebase.AccountService
@@ -10,6 +8,8 @@ import com.espressodev.gptmap.core.google.GoogleAuthService
108
import com.espressodev.gptmap.core.google.OneTapSignInUpResponse
119
import com.espressodev.gptmap.core.google.SignInUpWithGoogleResponse
1210
import com.espressodev.gptmap.core.model.Exceptions
11+
import com.espressodev.gptmap.core.model.di.Dispatcher
12+
import com.espressodev.gptmap.core.model.di.GmDispatchers.IO
1313
import com.espressodev.gptmap.core.model.firebase.Provider
1414
import com.espressodev.gptmap.core.model.firebase.User
1515
import com.espressodev.gptmap.core.model.google.GoogleResponse

0 commit comments

Comments
 (0)