-
-
Notifications
You must be signed in to change notification settings - Fork 110
Configured production release settings, signing configurations, and version updates. #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| # Never put SUPABASE_SERVICE_ROLE_KEY or VEXA_API_KEY here — those are server-only. | ||
| # flutter run --dart-define-from-file=dart_defines.json | ||
|
|
||
| SUPABASE_URL=<YOUR_SUPABASE_URL> | ||
| SUPABASE_ANON_KEY=<YOUR_SUPABASE_ANON_KEY> | ||
| SUPABASE_SERVICE_ROLE_KEY=<YOUR_SUPABASE_SERVICE_ROLE_KEY> | ||
| GEMINI_API_KEY=<YOUR_GEMINI_API_KEY> | ||
| VEXA_API_KEY=<YOUR_VEXA_API_KEY> | ||
| OAUTH_REDIRECT_URL = <YOUR_OAUTH_REDIRECT_URL> | ||
| OAUTH_REDIRECT_URL=io.supabase.ellena://login-callback/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,17 +206,14 @@ You can use either Visual Studio Code (VS Code) or Android Studio for Flutter de | |
| ``` | ||
|
|
||
| 3. **Set Up Environment Variables**: | ||
| - Copy the `.env.example` file to create a new `.env` file: | ||
| - Client config is compile-time via `--dart-define-from-file` (not a bundled `.env` asset). | ||
| - Copy the example file and fill in **client-safe** values only: | ||
| ``` | ||
| cp .env.example .env | ||
| ``` | ||
| - Update the `.env` file with your Supabase credentials (as described in the BACKEND.md guide): | ||
| ``` | ||
| SUPABASE_URL=<YOUR_SUPABASE_URL> | ||
| SUPABASE_ANON_KEY=<YOUR_SUPABASE_ANON_KEY> | ||
| GEMINI_API_KEY=<YOUR_GEMINI_API_KEY> | ||
| VEXA_API_KEY=<YOUR_VEXA_API_KEY> | ||
| cp dart_defines.example.json dart_defines.json | ||
| ``` | ||
| - Required keys: `SUPABASE_URL`, `SUPABASE_ANON_KEY`, `GEMINI_API_KEY`, `OAUTH_REDIRECT_URL` | ||
| - Do **not** put `SUPABASE_SERVICE_ROLE_KEY` in `dart_defines.json` (server-only). | ||
| - `dart_defines.json` is gitignored. | ||
|
Comment on lines
+209
to
+216
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Complete the Dart define migration in this guide. The setup now uses As per path instructions, documentation examples must match the codebase. 🧰 Tools🪛 markdownlint-cli2 (0.23.2)[warning] 211-211: Fenced code blocks should be surrounded by blank lines (MD031, blanks-around-fences) [warning] 211-211: Fenced code blocks should have a language specified (MD040, fenced-code-language) [warning] 213-213: Fenced code blocks should be surrounded by blank lines (MD031, blanks-around-fences) 🤖 Prompt for AI AgentsSource: Path instructions |
||
|
|
||
| ## Connecting to the Supabase Backend | ||
|
|
||
|
|
@@ -227,7 +224,7 @@ The Ell-ena project is already configured to connect to Supabase. The connection | |
| - Your Supabase project should be up and running with all the required tables and functions. | ||
|
|
||
| 2. **Configure Environment Variables**: | ||
| - Ensure your `.env` file contains the correct Supabase URL and anon key. | ||
| - Ensure `dart_defines.json` contains the correct Supabase URL and anon key. | ||
| - These values can be found in your Supabase dashboard under Settings > API. | ||
|
|
||
| 3. **Initialize Supabase**: | ||
|
|
@@ -245,15 +242,15 @@ The Ell-ena project is already configured to connect to Supabase. The connection | |
| 2. **Run the App**: | ||
| - To run on all connected devices: | ||
| ``` | ||
| flutter run | ||
| flutter run --dart-define-from-file=dart_defines.json | ||
| ``` | ||
| - To run on a specific device: | ||
| ``` | ||
| flutter run -d <device-id> | ||
| flutter run -d <device-id> --dart-define-from-file=dart_defines.json | ||
| ``` | ||
| - To run in release mode (for better performance): | ||
| ``` | ||
| flutter run --release | ||
| flutter run --release --dart-define-from-file=dart_defines.json | ||
| ``` | ||
|
|
||
| 3. **Debug Mode Features**: | ||
|
|
@@ -285,13 +282,13 @@ The Ell-ena project is already configured to connect to Supabase. The connection | |
|
|
||
| 3. **Build the APK**: | ||
| ``` | ||
| flutter build apk --release | ||
| flutter build apk --release --dart-define-from-file=dart_defines.json | ||
| ``` | ||
| - The APK will be available at `build/app/outputs/flutter-apk/app-release.apk`. | ||
|
|
||
| 4. **Build App Bundle**: | ||
| ``` | ||
| flutter build appbundle --release | ||
| flutter build appbundle --release --dart-define-from-file=dart_defines.json | ||
| ``` | ||
| - The bundle will be available at `build/app/outputs/bundle/release/app-release.aab`. | ||
|
|
||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package org.aossie.ellena | ||
|
|
||
| import io.flutter.embedding.android.FlutterActivity | ||
|
|
||
| class MainActivity : FlutterActivity() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError | ||
| android.useAndroidX=true | ||
| android.enableJetifier=true | ||
| org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError | ||
| android.useAndroidX=true | ||
| android.enableJetifier=true | ||
| # This builtInKotlin flag was added automatically by Flutter migrator | ||
| android.builtInKotlin=false | ||
| # This newDsl flag was added automatically by Flutter migrator | ||
| android.newDsl=false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "SUPABASE_URL": "https://YOUR_PROJECT.supabase.co", | ||
| "SUPABASE_ANON_KEY": "YOUR_SUPABASE_ANON_KEY", | ||
| "GEMINI_API_KEY": "YOUR_GEMINI_API_KEY", | ||
| "OAUTH_REDIRECT_URL": "io.supabase.ellena://login-callback/" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /// Compile-time app configuration via `--dart-define` / `--dart-define-from-file`. | ||
| /// | ||
| /// These values are baked in at build time and are **not** loaded from a bundled | ||
| /// `.env` asset. Never pass service-role keys or other server-only secrets here. | ||
| /// | ||
| /// Local / release examples: | ||
| /// ```bash | ||
| /// flutter run --dart-define-from-file=dart_defines.json | ||
| /// flutter build appbundle --release --dart-define-from-file=dart_defines.json | ||
| /// ``` | ||
| class AppConfig { | ||
| AppConfig._(); | ||
|
|
||
| static const String supabaseUrl = String.fromEnvironment('SUPABASE_URL'); | ||
| static const String supabaseAnonKey = | ||
| String.fromEnvironment('SUPABASE_ANON_KEY'); | ||
| static const String geminiApiKey = String.fromEnvironment('GEMINI_API_KEY'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- candidate files ---'
git ls-files | rg '(^|/)(app_config\.dart|.*[Aa][Ii].*\.dart|.*(env|define|config).*\.(json|example|env))$|(^|/)\.env(\.example)?$'
printf '%s\n' '--- relevant symbols and references ---'
rg -n --hidden -g '!build' -g '!node_modules' 'GEMINI_API_KEY|geminiApiKey|AIService|generativelanguage|generativelanguage\.googleapis|dart_defines|\.env\.example' .
printf '%s\n' '--- app config outline ---'
ast-grep outline lib/config/app_config.dart 2>/dev/null || true
printf '%s\n' '--- app config ---'
cat -n lib/config/app_config.dartRepository: AOSSIE-Org/Ell-ena Length of output: 6971 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- AI service ---'
cat -n lib/services/ai_service.dart
printf '%s\n' '--- chat call sites ---'
rg -n -A8 -B5 'AIService|generateContent|initialize\(' lib/screens lib/main.dart
printf '%s\n' '--- client examples ---'
cat -n dart_defines.example.json
cat -n .env.example
printf '%s\n' '--- FRONTEND client configuration and release sections ---'
sed -n '195,305p' FRONTEND.md
printf '%s\n' '--- BACKEND Gemini sections ---'
sed -n '110,155p' BACKEND.md
sed -n '340,375p' BACKEND.md
printf '%s\n' '--- edge-function Gemini calls ---'
for f in supabase/functions/get-embedding/index.ts supabase/functions/summarize-transcription/index.ts supabase/functions/generate-embeddings/index.ts; do
if [ -f "$f" ]; then
echo "### $f"
rg -n -A6 -B5 'GEMINI_API_KEY|generativelanguage.googleapis.com' "$f"
fi
doneRepository: AOSSIE-Org/Ell-ena Length of output: 41536 🏁 Script executed: #!/bin/bash
set -e
python3 - <<'PY'
from pathlib import Path
import re
app = Path("lib/config/app_config.dart").read_text()
ai = Path("lib/services/ai_service.dart").read_text()
defines = Path("dart_defines.example.json").read_text()
env = Path(".env.example").read_text()
checks = {
"compile_time_gemini_define": "String.fromEnvironment('GEMINI_API_KEY')" in app,
"client_gemini_host": "generativelanguage.googleapis.com" in ai,
"client_reads_app_config_key": "AppConfig.geminiApiKey" in ai,
"client_example_requires_key": '"GEMINI_API_KEY"' in defines,
"env_instructs_client_copy": "dart_defines.json" in env and "GEMINI_API_KEY" in env,
"server_functions_read_env_key": all(
"Deno.env.get(\"GEMINI_API_KEY\")" in Path(p).read_text()
for p in [
"supabase/functions/get-embedding/index.ts",
"supabase/functions/summarize-transcription/index.ts",
"supabase/functions/generate-embeddings/index.ts",
]
),
}
for name, value in checks.items():
print(f"{name}={value}")
# Print the exact client request lines for a deterministic call-path check.
for i, line in enumerate(ai.splitlines(), 1):
if "generativelanguage.googleapis.com" in line or "apiKey" in line or "AppConfig.geminiApiKey" in line:
print(f"ai_service:{i}:{line.strip()}")
PYRepository: AOSSIE-Org/Ell-ena Length of output: 654 Keep
🤖 Prompt for AI AgentsSource: Path instructions |
||
| static const String oauthRedirectUrl = String.fromEnvironment( | ||
| 'OAUTH_REDIRECT_URL', | ||
| defaultValue: 'io.supabase.ellena://login-callback/', | ||
| ); | ||
|
|
||
| static bool get hasSupabaseConfig => | ||
| supabaseUrl.isNotEmpty && supabaseAnonKey.isNotEmpty; | ||
|
|
||
| static bool get hasGeminiConfig => geminiApiKey.isNotEmpty; | ||
|
|
||
| /// Throws a clear error if required client defines are missing. | ||
| static void ensureClientConfig() { | ||
| final missing = <String>[]; | ||
| if (supabaseUrl.isEmpty) missing.add('SUPABASE_URL'); | ||
| if (supabaseAnonKey.isEmpty) missing.add('SUPABASE_ANON_KEY'); | ||
| if (geminiApiKey.isEmpty) missing.add('GEMINI_API_KEY'); | ||
| if (missing.isEmpty) return; | ||
|
|
||
| throw StateError( | ||
| 'Missing compile-time config: ${missing.join(', ')}. ' | ||
| 'Pass them with --dart-define=KEY=value or ' | ||
| '--dart-define-from-file=dart_defines.json ' | ||
| '(see dart_defines.example.json).', | ||
| ); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
|
|
||
| list(APPEND FLUTTER_PLUGIN_LIST | ||
| gtk | ||
| printing | ||
| url_launcher_linux | ||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" | ||
| #include "ephemeral/Flutter-Generated.xcconfig" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
| #include "ephemeral/Flutter-Generated.xcconfig" |
Uh oh!
There was an error while loading. Please reload this page.