Blame
|
1 | --- |
||||||
| 2 | title: Services, APIs & Vendors |
|||||||
| 3 | aliases: [Vendor Inventory, API Inventory] |
|||||||
| 4 | tags: [3netra/wiki, vendors, apis, services] |
|||||||
| 5 | product: 3netra Meta Android App |
|||||||
| 6 | source_repository: 3Netra-ai/3n_meta_android |
|||||||
| 7 | source_ref: origin/prod |
|||||||
| 8 | source_revision: b48aada8fd5427b5db0c02945569963c4ae543c8 |
|||||||
| 9 | last_verified: 2026-08-06 |
|||||||
| 10 | up: "[[Home]]" |
|||||||
| 11 | --- |
|||||||
| 12 | ||||||||
| 13 | # Services, APIs & Vendors |
|||||||
| 14 | ||||||||
| 15 | ## Vendor Inventory |
|||||||
| 16 | ||||||||
| 17 | > [!warning] Audit correction |
|||||||
| 18 | > A listed vendor is not proof of an operational integration. In particular, the active app calls Supabase `chat-vision` (not the AWS client) and discards its returned model text; Sarvam has no end-to-end test; and the DAT gesture bridge is not present. The table records source inventory, with this correction taking precedence over legacy checkmarks. |
|||||||
| 19 | ||||||||
| 20 | | Vendor | Purpose | Endpoint / Transport | Auth / Key source | Status | |
|||||||
| 21 | |---|---|---|---|---| |
|||||||
| 22 | | **Meta (Wearables DAT SDK)** | Registration, device state, camera capture API | DAT SDK / Bluetooth | Manifest meta-data resolves from Gradle resources; fallback values are committed in `app/build.gradle` (rotate/remove) | ๐ก code path; no hardware verification or gesture callback registration | |
|||||||
| 23 | | **Supabase** | Auth (GoTrue), Postgres (PostgREST), Realtime | `BuildConfig.SUPABASE_URL` | `SUPABASE_ANON_KEY` | โ
primary | |
|||||||
| 24 | | **OpenAI** | Edge Function implementation requests `gpt-4o` | Supabase `chat-vision` Edge Function | Edge-function environment variable | ๐ก app invokes it, but client discards its reply | |
|||||||
| 25 | | **AWS** | Unreferenced SAM prototype: Lambda/API Gateway/S3/Rekognition | `AwsBackendService` / `/api/*` | Build config + SAM parameters | ๐ก source exists; no production app call site | |
|||||||
| 26 | | **Sarvam.ai** | Indic translation, TTS (speaker "meera"), STT (model "saaras:v1") | `https://api.sarvam.ai/translate`, `/text-to-speech`, `/speech-to-text` | `SARVAM_API_KEY` (Bearer + `api-subscription-key`) | โ
voice | |
|||||||
| 27 | | **Google Identity** | Sign-In (Credential Manager bottom sheet โ ID token โ Supabase IDToken auth) | play-services-auth / credentials API | `GOOGLE_WEB_CLIENT_ID` | โ
auth | |
|||||||
| 28 | | **TensorFlow Lite (LiteRT)** | FaceNet embedding calculation | In-process; asset `facenet.tflite` | n/a | ๐ก embedding store/read path is Supabase, not local-only | |
|||||||
| 29 | | **Ollama (LAN)** | Legacy/local VLM client | Hardcoded private-LAN endpoint in `VisionService` | none | โ no active production call site | |
|||||||
| 30 | | **Resend** | Welcome/notification emails | Firebase Functions + Vercel function | `RESEND_API_KEY` / functions config | ๐ก legacy | |
|||||||
| 31 | | **Firebase** | Cloud Functions (email triggers) only โ auth/data removed | n/a | n/a | ๐ก legacy | |
|||||||
| 32 | | **Vercel** | `api/send-welcome.js` serverless (project `3netra`) | vercel.app | env | ๐ก legacy | |
|||||||
| 33 | | **Android platform** | TextToSpeech, SpeechRecognizer (voice commands, dictation), CameraX (face registration), BLE APIs, EncryptedSharedPreferences | on-device | n/a | โ
| |
|||||||
| 34 | | **Google ML Kit face-detection** | Declared in build.gradle | โ | โ | โ unused | |
|||||||
| 35 | ||||||||
| 36 | ## Client BuildConfig Keys (names only) |
|||||||
| 37 | ||||||||
| 38 | | Key | Used by | |
|||||||
| 39 | |---|---| |
|||||||
| 40 | | `SUPABASE_URL`, `SUPABASE_ANON_KEY` | SupabaseService | |
|||||||
| 41 | | `AWS_BACKEND_URL` | AwsBackendService only; no production caller at this ref | |
|||||||
| 42 | | `SARVAM_API_KEY` | SarvamService | |
|||||||
| 43 | | `GOOGLE_WEB_CLIENT_ID` | GoogleAuthHelper | |
|||||||
| 44 | | `OPENAI_API_KEY` | Defined but unreferenced in Android code (remove from client build inputs) | |
|||||||
| 45 | | `GITHUB_ACTOR`, `GITHUB_TOKEN` (env) | Meta SDK Maven resolution | |
|||||||
| 46 | ||||||||
| 47 | All sourced from `src/frontend/local.properties` with env fallback. No `local.properties.example` exists. |
|||||||
| 48 | ||||||||
| 49 | ## App Service Layer (Kotlin singletons) |
|||||||
| 50 | ||||||||
| 51 | | Service | Responsibility | External deps | |
|||||||
| 52 | |---|---|---| |
|||||||
| 53 | | `BluetoothService` | Callable mode handlers, capture/AI invocation, chat history, DAT state observation | Meta SDK, Sarvam, Supabase AI, Supabase | |
|||||||
| 54 | | `WearableCameraService` | MWDAT camera session โ photo bytes (mutex-guarded) | Meta SDK | |
|||||||
| 55 | | `SupabaseAiService` | Active `chat-vision` caller; incorrectly returns fixed success text instead of decoding the response | Supabase Functions | |
|||||||
| 56 | | `AwsBackendService` | `/api/chat` client with retry logic; unreferenced by production app code | AWS Lambda | |
|||||||
| 57 | | `SupabaseService` | Auth (email/OTP/Google), profiles, settings, sessions, face embeddings, Realtime | Supabase | |
|||||||
| 58 | | `SupabaseDashboardRepository` | Settings/audit repository methods; no active dashboard/role flow verified | Supabase | |
|||||||
| 59 | | `SarvamService` | translateText / textToSpeech / speechToText | Sarvam.ai | |
|||||||
| 60 | | `VisionService` | Legacy VLM router (Ollama moondream/llava; GPT4_VISION enum) | Ollama LAN | |
|||||||
| 61 | | `FaceNetModel` | TFLite embeddings + cosine similarity | LiteRT | |
|||||||
| 62 | | `VoiceCommandService` | Foreground mic service, BT SCO, broadcasts `VOICE_COMMAND` | Android SpeechRecognizer | |
|||||||
| 63 | | `AudioTranscriptionService` | Continuous lecture dictation | Android SpeechRecognizer | |
|||||||
| 64 | | `EmotionDetectionService` / `HallwayNavigationService` / `RecessSocialService` | Mode-specific prompt wrappers (concise, word-limited) | SupabaseAiService; no active student route for hallway/recess | |
|||||||
| 65 | | `EmergencyAlertManager` | SOS โ Supabase `emergency_alerts` | Supabase | |
|||||||
| 66 | | `ChildVoicePersonaManager` | Scene-screen Android TTS with legacy Kโ6 vocabulary filtering | Android TTS | |
|||||||
| 67 | | `PinManager` | Teacher PIN (BCrypt in secure prefs) | jbcrypt | |
|||||||
| 68 | | `SmartCaptureController` | Adaptive capture intervals (battery saver) | โ | |
|||||||
| 69 | | `MetaWearableService` | Placeholder stub (no real SDK calls) | โ | |
|||||||
| 70 | | Utils: `EncryptedFaceStorageManager`, `MediaCompressor`, `PdfExportManager` | Unused encrypted-face utility ยท pre-upload compression ยท legacy external-storage PDF writer | androidx.security / Android | |
|||||||
| 71 | ||||||||
| 72 | ## API Endpoints Summary |
|||||||
| 73 | ||||||||
| 74 | | Endpoint | Method | Payload | Returns | |
|||||||
| 75 | |---|---|---|---| |
|||||||
| 76 | | Supabase Function `chat-vision` | invoke | `{prompt, mediaType, frames[]}` | Function returns `{message}`, but Android client presently discards it | |
|||||||
| 77 | | `{AWS_BACKEND_URL}/api/chat` | POST | `{prompt, mediaType: NONE/IMAGE/VIDEO, frames[]}` | `{message}`; implemented but not used by production callers | |
|||||||
| 78 | | `{AWS_BACKEND_URL}/api/vision` | POST | `{image_base64}` | `{labels[]}` (Rekognition) | |
|||||||
| 79 | | `{AWS_BACKEND_URL}/api/upload` | POST | `{image_base64}` | S3 file ref | |
|||||||
| 80 | | `{AWS_BACKEND_URL}/api/auth` | POST | `{access_token}` | `{user}` (Supabase verify) | |
|||||||
| 81 | | `api.sarvam.ai/translate` | POST | `{input, source_language_code, target_language_code}` | translated text | |
|||||||
| 82 | | `api.sarvam.ai/text-to-speech` | POST | `{text, speaker: meera, โฆ}` | base64 `audios[]` | |
|||||||
| 83 | | `api.sarvam.ai/speech-to-text` | POST multipart | audio, `model: saaras:v1` | transcript | |
|||||||
| 84 | | Supabase PostgREST | โ | client references `user_profiles`, `students`, `student_settings`, `sessions`, `face_embeddings`, `audit_logs`, and `emergency_alerts`; server schema/policies are not committed | โ | |
|||||||
| 85 | ||||||||
| 86 | --- |
|||||||
| 87 | ||||||||
| 88 | > [!tip] Navigation |
|||||||
| 89 | > โฌ
๏ธ [[06-Feature-Matrix|Feature Matrix]] ยท ๐ [[Home]] ยท โก๏ธ [[08-Data-Model-Supabase|Data Model (Supabase)]] |
|||||||
