Skip to content

Commit df5d4aa

Browse files
committed
Update Agriculture AI OS with Supabase auth and Groq integration
0 parents  commit df5d4aa

193 files changed

Lines changed: 22696 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Whitespace-only changes.

.github/workflows/android.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Android CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: set up JDK 17
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: '17'
20+
distribution: 'temurin'
21+
cache: gradle
22+
23+
- name: Grant execute permission for gradlew
24+
run: chmod +x gradlew
25+
26+
- name: Build with Gradle
27+
run: ./gradlew build
28+
29+
- name: Build Release AAB
30+
run: ./gradlew bundleRelease
31+
32+
- name: Build Release APK
33+
run: ./gradlew assembleRelease
34+
35+
- name: Upload APK
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: app-release-apk
39+
path: app/build/outputs/apk/release/app-release.apk
40+
41+
- name: Upload AAB
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: app-release-aAB
45+
path: app/build/outputs/bundle/release/app-release.aab

.github/workflows/backend.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Backend CI/CD
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths:
7+
- 'backend/**'
8+
pull_request:
9+
branches: [ "main" ]
10+
paths:
11+
- 'backend/**'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
working-directory: ./backend
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Use Node.js 20
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '20'
27+
cache: 'npm'
28+
cache-dependency-path: './backend/package-lock.json'
29+
30+
- name: Install dependencies
31+
run: npm install
32+
33+
- name: Build
34+
run: npm run build
35+
36+
- name: Run tests
37+
run: echo "No tests specified yet"
38+
39+
- name: Build Docker Image
40+
run: docker build -t ai-enterprise-backend .
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Automated Mandi Synchronization Engine
2+
3+
on:
4+
schedule:
5+
- cron: '0 15 * * *' # Triggers automatically daily at exactly 15:00 UTC (8:30 PM IST)
6+
workflow_dispatch: # Allows you to click a button in GitHub to force run it instantly
7+
8+
jobs:
9+
execute-pipeline:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Codebase Clone Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Enterprise Python Runtime Environment
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.11'
19+
cache: 'pip'
20+
21+
- name: Install System Architecture Requirements Modules
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -r backend/requirements.txt
25+
26+
- name: Run Extraction Matrix Pipeline Tasks
27+
env:
28+
GOVT_API_KEY: ${{ secrets.GOVT_API_KEY }}
29+
DB_CONNECTION_STRING: ${{ secrets.DB_CONNECTION_STRING }}
30+
run: python backend/mandi_pipeline_sync.py

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
*.iml
2+
.gradle
3+
.kotlin
4+
/local.properties
5+
/.idea/caches
6+
/.idea/libraries
7+
/.idea/modules.xml
8+
/.idea/workspace.xml
9+
/.idea/navEditor.xml
10+
/.idea/assetWizardSettings.xml
11+
.DS_Store
12+
/build
13+
/captures
14+
.externalNativeBuild
15+
.cxx
16+
local.properties
17+
.env
18+
debug.keystore
19+
node_modules/
20+
dist/

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div align="center">
2+
<img width="1200" height="475" alt="GHBanner" src="https://ai.google.dev/static/site-assets/images/share-ais-513315318.png" />
3+
</div>
4+
5+
# Run and deploy your AI Studio app
6+
7+
This contains everything you need to run your app locally.
8+
9+
View your app in AI Studio: https://ai.studio/apps/e6f8fc34-29e7-4bed-9b6d-eaa28f15ebca
10+
11+
## Run Locally
12+
13+
**Prerequisites:** [Android Studio](https://developer.android.com/studio)
14+
15+
16+
1. Open Android Studio
17+
2. Select **Open** and choose the directory containing this project
18+
3. Allow Android Studio to fix any incompatibilities as it imports the project.
19+
4. Create a file named `.env` in the project directory and set `GEMINI_API_KEY` in that file to your Gemini API key (see `.env.example` for an example)
20+
5. Remove this line from the app's `build.gradle.kts` file: `signingConfig = signingConfigs.getByName("debugConfig")`
21+
6. Run the app on an emulator or physical device

app-debug.apk

37.7 MB
Binary file not shown.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle.kts

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.kotlin.compose)
4+
alias(libs.plugins.google.devtools.ksp)
5+
alias(libs.plugins.roborazzi)
6+
alias(libs.plugins.secrets)
7+
alias(libs.plugins.kotlinx.serialization)
8+
9+
}
10+
11+
android {
12+
namespace = "com.example"
13+
compileSdk { version = release(36) { minorApiLevel = 1 } }
14+
15+
defaultConfig {
16+
applicationId = "com.nukrop.app"
17+
minSdk = 24
18+
targetSdk = 34
19+
versionCode = 1
20+
versionName = "1.0"
21+
22+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
23+
}
24+
25+
signingConfigs {
26+
create("release") {
27+
val keystorePath = System.getenv("KEYSTORE_PATH") ?: "${rootDir}/debug.keystore"
28+
storeFile = file(keystorePath)
29+
storePassword = System.getenv("STORE_PASSWORD") ?: "android"
30+
keyAlias = System.getenv("KEY_ALIAS") ?: "androiddebugkey"
31+
keyPassword = System.getenv("KEY_PASSWORD") ?: "android"
32+
}
33+
create("debugConfig") {
34+
storeFile = file("${rootDir}/debug.keystore")
35+
storePassword = "android"
36+
keyAlias = "androiddebugkey"
37+
keyPassword = "android"
38+
}
39+
}
40+
41+
buildTypes {
42+
release {
43+
isCrunchPngs = false
44+
isMinifyEnabled = false
45+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
46+
signingConfig = signingConfigs.getByName("release")
47+
}
48+
debug {
49+
}
50+
}
51+
compileOptions {
52+
sourceCompatibility = JavaVersion.VERSION_11
53+
targetCompatibility = JavaVersion.VERSION_11
54+
}
55+
buildFeatures {
56+
compose = true
57+
buildConfig = true
58+
}
59+
testOptions { unitTests { isIncludeAndroidResources = true } }
60+
}
61+
62+
// Configure the Secrets Gradle Plugin to use .env and .env.example files
63+
// to match the convention used in Web projects.
64+
secrets {
65+
propertiesFileName = ".env"
66+
defaultPropertiesFileName = ".env.example"
67+
}
68+
69+
// Some unused dependencies are commented out below instead of being removed.
70+
// This makes it easy to add them back in the future if needed.
71+
dependencies {
72+
implementation(platform(libs.androidx.compose.bom))
73+
// implementation(libs.accompanist.permissions)
74+
implementation(libs.androidx.activity.compose)
75+
// implementation(libs.androidx.camera.camera2)
76+
// implementation(libs.androidx.camera.core)
77+
// implementation(libs.androidx.camera.lifecycle)
78+
// implementation(libs.androidx.camera.view)
79+
implementation(libs.androidx.compose.material.icons.core)
80+
implementation(libs.androidx.compose.material.icons.extended)
81+
implementation(libs.androidx.compose.material3)
82+
implementation(libs.androidx.compose.ui)
83+
implementation(libs.androidx.compose.ui.graphics)
84+
implementation(libs.androidx.compose.ui.tooling.preview)
85+
implementation(libs.androidx.core.ktx)
86+
// implementation(libs.androidx.datastore.preferences)
87+
implementation(libs.androidx.lifecycle.runtime.compose)
88+
implementation(libs.androidx.lifecycle.runtime.ktx)
89+
implementation(libs.androidx.lifecycle.viewmodel.compose)
90+
// implementation(libs.androidx.navigation.compose)
91+
implementation(libs.androidx.room.ktx)
92+
implementation(libs.androidx.room.runtime)
93+
implementation(libs.compose.markdown)
94+
implementation(libs.coil.compose)
95+
// implementation(libs.converter.moshi)
96+
implementation(libs.supabase.auth)
97+
implementation(libs.ktor.client.android)
98+
implementation("androidx.credentials:credentials:1.3.0")
99+
implementation("androidx.credentials:credentials-play-services-auth:1.3.0")
100+
implementation("com.google.android.libraries.identity.googleid:googleid:1.1.1")
101+
implementation(libs.kotlinx.coroutines.android)
102+
implementation(libs.kotlinx.coroutines.core)
103+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3")
104+
implementation(libs.logging.interceptor)
105+
// implementation(libs.moshi.kotlin)
106+
implementation(libs.okhttp)
107+
// implementation(libs.play.services.location)
108+
implementation(libs.retrofit)
109+
implementation(libs.retrofit.converter.kotlinx.serialization)
110+
implementation(libs.kotlinx.serialization.json)
111+
implementation(libs.play.services.location)
112+
implementation("androidx.work:work-runtime-ktx:2.9.0")
113+
implementation(libs.androidx.lifecycle.runtime.compose)
114+
115+
testImplementation(libs.androidx.compose.ui.test.junit4)
116+
testImplementation(libs.androidx.core)
117+
118+
testImplementation(libs.androidx.junit)
119+
testImplementation(libs.junit)
120+
testImplementation(libs.kotlinx.coroutines.test)
121+
testImplementation(libs.robolectric)
122+
testImplementation(libs.roborazzi)
123+
testImplementation(libs.roborazzi.compose)
124+
testImplementation(libs.roborazzi.junit.rule)
125+
androidTestImplementation(platform(libs.androidx.compose.bom))
126+
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
127+
androidTestImplementation(libs.androidx.espresso.core)
128+
androidTestImplementation(libs.androidx.junit)
129+
androidTestImplementation(libs.androidx.runner)
130+
debugImplementation(libs.androidx.compose.ui.test.manifest)
131+
debugImplementation(libs.androidx.compose.ui.tooling)
132+
implementation(libs.tensorflow.lite)
133+
implementation(libs.androidx.camera.camera2)
134+
implementation(libs.androidx.camera.core)
135+
implementation(libs.androidx.camera.lifecycle)
136+
implementation(libs.androidx.camera.view)
137+
"ksp"(libs.androidx.room.compiler)
138+
"ksp"(libs.moshi.kotlin.codegen)
139+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

0 commit comments

Comments
 (0)