Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
ab0b504
Closes #10
ma-r-s Oct 3, 2024
7b79bb4
Partial
ma-r-s Oct 9, 2024
e0225a9
Partial
ma-r-s Oct 10, 2024
122cf5c
Partial
ma-r-s Oct 11, 2024
c308977
Update README.md
LuimarcoCarrascalDiaz Oct 16, 2024
18674fb
Update README.md
LuimarcoCarrascalDiaz Oct 17, 2024
c180dab
Merge branch 'main' into feature/add-cart-api-#25
LuimarcoCarrascalDiaz Oct 17, 2024
31aded3
Merge pull request #6 from LuimarcoCarrascalDiaz/feature/add-cart-api…
LuimarcoCarrascalDiaz Oct 17, 2024
0738d71
agregando sensor de huellas digitales
LuimarcoCarrascalDiaz Oct 17, 2024
d99afaf
agregando sensor de huellas digitales
LuimarcoCarrascalDiaz Oct 17, 2024
723b7ab
Merge branch 'feature/add-cart-api-#25' of https://github.com/Luimarc…
LuimarcoCarrascalDiaz Oct 17, 2024
875afe3
Update README.md
LuimarcoCarrascalDiaz Oct 18, 2024
ee4df16
huella
LuimarcoCarrascalDiaz Oct 19, 2024
99c3eb7
description
LuimarcoCarrascalDiaz Oct 20, 2024
d0578bb
agregando gestión de mapas
LuimarcoCarrascalDiaz Oct 21, 2024
5704383
funcionalidad del mapa
LuimarcoCarrascalDiaz Oct 22, 2024
733bd4f
autocompletar
LuimarcoCarrascalDiaz Oct 22, 2024
e1284d6
animacion interactiva
LuimarcoCarrascalDiaz Oct 22, 2024
3c22ca4
update de puntos en el mapa
LuimarcoCarrascalDiaz Oct 22, 2024
0db8b43
Merge pull request #8 from LuimarcoCarrascalDiaz/feature/restaurant_map
LuimarcoCarrascalDiaz Oct 22, 2024
7430eab
notas al pie de página
LuimarcoCarrascalDiaz Oct 23, 2024
e1d66ad
Update README.md
LuimarcoCarrascalDiaz Oct 23, 2024
688cd13
Update README.md
LuimarcoCarrascalDiaz Oct 28, 2024
70b155f
multithreading added
LuimarcoCarrascalDiaz Oct 28, 2024
9475a25
Merge pull request #9 from LuimarcoCarrascalDiaz/feature/restaurant_map
LuimarcoCarrascalDiaz Oct 28, 2024
af37940
actualización
LuimarcoCarrascalDiaz Oct 30, 2024
ea2ce09
añadiendo las dependencias necesarias para crear una base de datos local
LuimarcoCarrascalDiaz Oct 30, 2024
dbfa995
local storage funcional
LuimarcoCarrascalDiaz Oct 30, 2024
f905c41
funcionalidad completada
LuimarcoCarrascalDiaz Oct 30, 2024
606cf35
Merge pull request #11 from LuimarcoCarrascalDiaz/develop/local-storage
LuimarcoCarrascalDiaz Oct 30, 2024
6d2d7c4
toast de la pantalla de login eliminado
LuimarcoCarrascalDiaz Oct 30, 2024
fe10f55
context aware mejorado
LuimarcoCarrascalDiaz Oct 30, 2024
b5905f8
aclaración de entrega
LuimarcoCarrascalDiaz Oct 30, 2024
a75cb04
Merge pull request #12 from LuimarcoCarrascalDiaz/develop/caching_str…
LuimarcoCarrascalDiaz Oct 30, 2024
d400d70
dot
LuimarcoCarrascalDiaz Nov 1, 2024
5623ceb
dot
LuimarcoCarrascalDiaz Nov 3, 2024
93c3668
Update README.md
LuimarcoCarrascalDiaz Nov 3, 2024
3e02ccc
dot
LuimarcoCarrascalDiaz Nov 3, 2024
18180af
campo de fecha de cumpleaños para los perfiles eliminado
LuimarcoCarrascalDiaz Nov 3, 2024
c7fdca1
Merge pull request #15 from LuimarcoCarrascalDiaz/develop/caching_str…
LuimarcoCarrascalDiaz Nov 3, 2024
7ea0c38
ajustes importantes
LuimarcoCarrascalDiaz Nov 3, 2024
86e8397
arreglando crash
LuimarcoCarrascalDiaz Nov 4, 2024
ea540cf
estrategia de la memoria caché
LuimarcoCarrascalDiaz Nov 4, 2024
28f4cb8
navigation update
LuimarcoCarrascalDiaz Nov 5, 2024
5971489
adding cart icon
LuimarcoCarrascalDiaz Nov 5, 2024
cd8ef47
subiando cambiar para la apk
LuimarcoCarrascalDiaz Nov 7, 2024
af3c520
Merge branch 'fix/sprint3_adjustments' of https://github.com/Luimarco…
LuimarcoCarrascalDiaz Nov 7, 2024
9877f54
correcting stuff
LuimarcoCarrascalDiaz Nov 8, 2024
123832b
fixed cart
LuimarcoCarrascalDiaz Nov 9, 2024
b0e29d8
added firestore
LuimarcoCarrascalDiaz Nov 19, 2024
6868f36
adding stuff of firebase
LuimarcoCarrascalDiaz Nov 19, 2024
005dfd8
local storage strategy completed
LuimarcoCarrascalDiaz Nov 19, 2024
8d51f1f
adding firebase storage service
LuimarcoCarrascalDiaz Nov 20, 2024
2878635
added functionalities for sprint 4
LuimarcoCarrascalDiaz Nov 20, 2024
3af785b
adding some icons
LuimarcoCarrascalDiaz Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .kotlin/errors/errors-1729205467831.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kotlin version: 2.0.20
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready

4 changes: 4 additions & 0 deletions .kotlin/errors/errors-1730660052865.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kotlin version: 2.0.20
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready

4 changes: 4 additions & 0 deletions .kotlin/errors/errors-1730754361219.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kotlin version: 2.0.20
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready

4 changes: 4 additions & 0 deletions .kotlin/errors/errors-1731096633063.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kotlin version: 2.0.20
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
### Visit the android developers website
[Compila apps adaptables con las nuevas APIs de Compose, ahora estables](https://developer.android.com/?hl=es-419#:~:text=Discover%20the%20latest%20app%20development%20tools,)
# [Compila apps adaptables con las nuevas APIs de Compose, ahora estables](https://developer.android.com/?hl=es-419#:~:text=Discover%20the%20latest%20app%20development%20tools,)
no olvides configurar el gradle para una exitosa ejecución,
el apk será generado y compartido en su debido momento
54 changes: 44 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
plugins {
id("com.android.application") version "8.6.1" // AGP version
id("org.jetbrains.kotlin.android") version "1.9.0" // Kotlin plugin for Android
id("org.jetbrains.kotlin.plugin.serialization") version "1.9.0" // Kotlin serialization plugin
id("org.jetbrains.kotlin.android") version "2.0.20" // Kotlin plugin for Android
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.20" // Kotlin serialization plugin
id("org.jetbrains.kotlin.plugin.compose") version "2.0.20"
id("kotlin-kapt") // Asegúrate de que kapt esté habilitado
id("com.google.gms.google-services") // Plugin de Google Services
}

android {
Expand Down Expand Up @@ -30,19 +33,24 @@ android {
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}

buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
}

packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
Expand All @@ -51,8 +59,6 @@ android {
}

dependencies {


// Supabase dependencies
implementation(platform("io.github.jan-tennert.supabase:bom:3.0.0"))
implementation("io.github.jan-tennert.supabase:postgrest-kt")
Expand All @@ -65,20 +71,48 @@ dependencies {

// Compose dependencies
implementation(platform("androidx.compose:compose-bom:2024.09.03"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3:1.3.0")
implementation("androidx.compose.material3:material3")
implementation("androidx.navigation:navigation-compose:2.8.2")
implementation("androidx.biometric:biometric:1.1.0")
implementation("androidx.fragment:fragment-ktx:1.8.4")
implementation("com.google.android.libraries.places:places:4.0.0")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.maps.android:maps-compose:2.2.0")
implementation("com.google.accompanist:accompanist-flowlayout:0.28.0")
implementation("androidx.compose.runtime:runtime-livedata:1.7.4")

// Google Play Services
implementation("com.google.android.gms:play-services-maps")
implementation("com.google.android.gms:play-services-measurement-api")
implementation("com.google.android.gms:play-services-measurement-sdk")

// Room and Kapt
implementation("androidx.room:room-runtime:2.5.1")
kapt("androidx.room:room-compiler:2.5.1")

// Glide
implementation("com.github.bumptech.glide:glide:4.12.0")
kapt("com.github.bumptech.glide:compiler:4.12.0")

// Coil
implementation("io.coil-kt:coil-compose:2.0.0")

// Testing dependencies
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2024.09.03"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0")
testImplementation("io.mockk:mockk:1.13.3")

// Debug dependencies
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")

}
// Firebase dependencies (using BOM for version management)
implementation(platform("com.google.firebase:firebase-bom:32.1.0"))
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-firestore-ktx")
implementation("com.google.firebase:firebase-storage-ktx")
implementation("com.google.firebase:firebase-messaging-ktx") // Notificaciones push
}
29 changes: 29 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "631169455352",
"project_id": "ecobitesandroid",
"storage_bucket": "ecobitesandroid.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:631169455352:android:d850824d325ecaea7bd70d",
"android_client_info": {
"package_name": "com.uniandes.ecobites"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyAKofhygTp6LyG_fZ2wLT0lpUlP-40ZH8A"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
11 changes: 11 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />

<uses-permission android:name="android.permission.USE_FINGERPRINT" />
Comment on lines +5 to +7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove deprecated fingerprint permission.

The USE_FINGERPRINT permission is deprecated since Android 9.0 (API 28). The USE_BIOMETRIC permission already covers all biometric authentication methods including fingerprint.

Apply this diff to remove the redundant permission:

    <uses-permission android:name="android.permission.USE_BIOMETRIC" />

-   <uses-permission android:name="android.permission.USE_FINGERPRINT" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />


<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
Expand All @@ -12,6 +19,10 @@
android:supportsRtl="true"
android:theme="@style/Theme.EcoBites"
tools:targetApi="31">
<!-- Clave de la API de Google Maps -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCTHkA6PG3Zr_nhxq8N7dlX-vrmEM4mltY"/>
Comment on lines +22 to +25
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

SECURITY RISK: Google Maps API key exposed.

The Google Maps API key is currently exposed in plain text in the manifest file. This is a critical security risk as:

  1. The key is now in version control and publicly accessible
  2. It could be misused, leading to unauthorized access and potential billing issues

Recommended fixes:

  1. Immediately rotate (replace) this API key in Google Cloud Console

  2. Store the new key securely using one of these methods:

    // Option 1: BuildConfig (preferred)
    android {
        buildTypes {
            debug {
                buildConfigField("String", "MAPS_API_KEY", "\"your_debug_key\"")
            }
            release {
                buildConfigField("String", "MAPS_API_KEY", "\"your_release_key\"")
            }
        }
    }

    Then in manifest:

    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="${MAPS_API_KEY}"/>

    Option 2: Create a secrets.properties file (add to .gitignore):

    MAPS_API_KEY=your_api_key

    And load it in build.gradle.kts:

    val secretsFile = rootProject.file("secrets.properties")
    val secrets = Properties()
    secrets.load(FileInputStream(secretsFile))

Would you like me to help set up either of these secure configurations?

🧰 Tools
🪛 Gitleaks

25-25: Uncovered a GCP API key, which could lead to unauthorized access to Google Cloud services and data breaches.

(gcp-api-key)

<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
70 changes: 21 additions & 49 deletions app/src/main/java/com/uniandes/ecobites/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,75 +8,47 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import com.uniandes.ecobites.ui.screens.ProfileScreen
import com.uniandes.ecobites.ui.screens.CartScreen
import com.uniandes.ecobites.ui.screens.home.HomeScreen
import com.uniandes.ecobites.ui.theme.AppTheme
import com.uniandes.ecobites.ui.components.NavBar
import androidx.navigation.compose.rememberNavController
import com.uniandes.ecobites.ui.SplashScreen
import com.uniandes.ecobites.ui.screens.LoginScreen
import io.github.jan.supabase.createSupabaseClient
import com.uniandes.ecobites.ui.components.BiometricAuth
import com.uniandes.ecobites.ui.navigation.NavigationHost
import com.uniandes.ecobites.ui.theme.AppTheme
import kotlinx.coroutines.delay
import io.github.jan.supabase.auth.Auth
import io.github.jan.supabase.postgrest.Postgrest

val supabase = createSupabaseClient(
supabaseUrl = "https://nlhcaanwwchxdzdiyizf.supabase.co",
supabaseKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im5saGNhYW53d2NoeGR6ZGl5aXpmIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Mjc5MDc0OTQsImV4cCI6MjA0MzQ4MzQ5NH0.LrcRGkVH1qjPE09xDngX7wrtrUmfIYbTGrgbPKarTeM"
) {
install(Auth)
install(Postgrest)
//install other modules
}
import com.google.firebase.FirebaseApp
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.firestore.FirebaseFirestore

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val biometricAuth = BiometricAuth(this)
FirebaseApp.initializeApp(this)
// Opcional: Inicializar Firebase Analytics
val firebaseAnalytics = FirebaseAnalytics.getInstance(this)
// Inicialización de Firestore
val firestore = FirebaseFirestore.getInstance()
setContent {
AppTheme {
MyApp()
MyApp(biometricAuth)
}
}
}
}

@Composable
fun MyApp() {
fun MyApp(biometricAuth: BiometricAuth) {
val navController = rememberNavController() // Create the NavController
var showSplashScreen by remember { mutableStateOf(true) }
var isLoggedIn by remember { mutableStateOf(false) } // Track login state

// Show splash screen for 3 seconds before navigating to the main content
// Show splash screen for 1.5 seconds before navigating to the main content
LaunchedEffect(Unit) {
delay(3000) // 3 seconds delay
showSplashScreen = false // Hide splash screen after the delay
delay(1500)
showSplashScreen = false
}

if (showSplashScreen) {
SplashScreen() // Show splash screen
} else if (!isLoggedIn) {
LoginScreen(onLoginSuccess = { isLoggedIn = true }) // Pass a callback to update isLoggedIn
SplashScreen()
} else {
MainContent() // Show main content if logged in
}
}


@Composable
fun MainContent() {
var selectedTab by remember { mutableIntStateOf(0) }

Scaffold(
bottomBar = {
NavBar(selectedTab = selectedTab, onTabSelected = { tab -> selectedTab = tab })
}
) { innerPadding ->
Box(modifier = Modifier.padding(innerPadding)) {
when (selectedTab) {
0 -> HomeScreen()
1 -> CartScreen()
3 -> ProfileScreen()
}
}
NavigationHost(navController = navController, biometricAuth = biometricAuth) // Pass the NavController here
}
}

8 changes: 8 additions & 0 deletions app/src/main/java/com/uniandes/ecobites/MenuCategory.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.uniandes.ecobites

import kotlinx.serialization.Serializable

@Serializable
class MenuCategory(
val menu: List<String>
)
Loading