From eaa7828e65cd81667501b09a9cd654c51e5e2708 Mon Sep 17 00:00:00 2001 From: Sergei Date: Sat, 17 Jan 2026 18:17:37 -0800 Subject: [PATCH] Add App Store build docs and LiveKit Agents guide - Add App Store build credentials and build-ios.sh script - Document Julia AI voice agent architecture - Add detailed instructions for editing agent behavior - Document token server deployment --- README.md | 296 ++++++++++++++++++++++++++++++++++++++++++++------- build-ios.sh | 20 ++++ 2 files changed, 279 insertions(+), 37 deletions(-) create mode 100755 build-ios.sh diff --git a/README.md b/README.md index 48dd63f..bd3fc27 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,272 @@ -# Welcome to your Expo app πŸ‘‹ +# WellNuo Lite -This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app). +Voice AI companion for elderly care monitoring. -## Get started +--- -1. Install dependencies - - ```bash - npm install - ``` - -2. Start the app - - ```bash - npx expo start - ``` - -In the output, you'll find options to open the app in a - -- [development build](https://docs.expo.dev/develop/development-builds/introduction/) -- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/) -- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/) -- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo - -You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction). - -## Get a fresh project - -When you're ready, run: +## Quick Start ```bash -npm run reset-project +npm install +expo-sim 8081 # Запуск Π½Π° симуляторС ``` -This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing. +--- -## Learn more +## App Store Build & Submit -To learn more about developing your project with Expo, look at the following resources: +### Credentials -- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides). -- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web. +| Parameter | Value | +|-----------|-------| +| Bundle ID | `com.wellnuo.BluetoothScanner` | +| Apple Team ID | `UHLZD54ULZ` | +| ASC App ID | `6756594148` | +| ASC API Key ID | `GA9C2GRPHS` | +| ASC Issuer ID | `dcac5647-0710-4764-affd-2d3270bf49d4` | +| API Key File | `AuthKey_GA9C2GRPHS.p8` | -## Join the community +### Build iOS for TestFlight -Join our community of developers creating universal apps. +```bash +./build-ios.sh production +``` -- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute. -- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions. +Или Π²Ρ€ΡƒΡ‡Π½ΡƒΡŽ: + +```bash +export EXPO_APPLE_TEAM_ID="UHLZD54ULZ" +export EXPO_APPLE_TEAM_TYPE="INDIVIDUAL" +export EXPO_ASC_KEY_ID="GA9C2GRPHS" +export EXPO_ASC_ISSUER_ID="dcac5647-0710-4764-affd-2d3270bf49d4" +export EXPO_ASC_API_KEY_PATH="$(pwd)/AuthKey_GA9C2GRPHS.p8" + +npx eas-cli build --platform ios --profile production +``` + +### Submit to TestFlight + +ПослС Π·Π°Π²Π΅Ρ€ΡˆΠ΅Π½ΠΈΡ сборки: + +```bash +eas submit --platform ios --latest +``` + +### Check Build Status + +```bash +eas build:list --platform ios --limit 5 +``` + +--- + +## Julia AI Voice Agent + +### Architecture + +``` +Mobile App (LiveKit SDK) + ↓ + LiveKit Cloud + ↓ + Julia AI Agent (CA_zKZCpX36ZT5C) + β”œβ”€β”€ STT: Deepgram Nova-2 + β”œβ”€β”€ LLM: OpenAI GPT-4o + └── TTS: Deepgram Aura Asteria +``` + +### Quick Reference + +| Item | Value | +|------|-------| +| Agent ID | `CA_zKZCpX36ZT5C` | +| Agent Name | `julia-ai` | +| LiveKit Cloud | `live-kit-demo-70txlh6a.livekit.cloud` | +| Token Server URL | `https://wellnuo.smartlaunchhub.com/julia/token` | + +### Project Structure + +``` +julia-agent/ +β”œβ”€β”€ julia-ai/ # LiveKit Agent (Python) +β”‚ β”œβ”€β”€ src/agent.py # Main agent code +β”‚ β”œβ”€β”€ livekit.toml # Agent deployment config +β”‚ β”œβ”€β”€ .env.local # API keys (OPENAI, DEEPGRAM) +β”‚ β”œβ”€β”€ pyproject.toml # Python dependencies +β”‚ └── Dockerfile # Deployment container +└── token-server/ # Token Server (Node.js) + β”œβ”€β”€ server.js # Express server + └── .env # LiveKit credentials +``` + +### How It Works + +1. **Mobile app** requests token from Token Server +2. **Token Server** generates JWT with room + agent config +3. **Mobile app** connects to LiveKit Cloud with token +4. **LiveKit Cloud** spawns Julia AI agent in the room +5. **Agent** handles voice conversation using STT β†’ LLM β†’ TTS pipeline + +### Editing Agent Behavior + +Agent configuration is in `julia-agent/julia-ai/src/agent.py`: + +**Change AI personality (system prompt):** +```python +# In build_system_prompt() function - line 77 +return f"""You are Julia, a compassionate AI care assistant... +``` + +**Change voice model:** +```python +# Line 186 - TTS model +tts=deepgram.TTS(model="aura-asteria-en"), # Female voice +# Options: aura-asteria-en, aura-luna-en, aura-stella-en +``` + +**Change LLM model:** +```python +# Line 181-184 - LLM model +llm=openai.LLM( + model="gpt-4o", # or "gpt-4o-mini" for faster/cheaper + api_key=os.getenv("OPENAI_API_KEY"), +), +``` + +**Change STT model:** +```python +# Line 179 - Speech-to-text +stt=deepgram.STT(model="nova-2"), # Most accurate +``` + +**Change initial greeting:** +```python +# Line 212-214 - First message when user connects +await session.generate_reply( + instructions="Greet the user warmly as Julia..." +) +``` + +### Deploy Agent Changes + +```bash +cd julia-agent/julia-ai + +# Install LiveKit CLI (if not installed) +brew install livekit/tap/lk + +# Deploy to LiveKit Cloud +lk agent deploy +``` + +The agent will be rebuilt and deployed automatically. Takes ~2-3 minutes. + +### Token Server + +Generates LiveKit tokens for mobile app connections. + +**Location:** `root@91.98.205.156:/var/www/julia-token-server/` +**PM2 process:** `julia-token-server` +**URL:** `https://wellnuo.smartlaunchhub.com/julia/token` + +**API:** +```bash +POST /token +Body: { "userId": "user-123" } +Response: { "token": "...", "roomName": "...", "wsUrl": "wss://..." } +``` + +**Update token server:** +```bash +# Copy changes to server +scp julia-agent/token-server/server.js root@91.98.205.156:/var/www/julia-token-server/ + +# Restart +ssh root@91.98.205.156 "pm2 restart julia-token-server" +``` + +### Environment Variables + +**Agent (.env.local):** +```env +OPENAI_API_KEY=sk-... +DEEPGRAM_API_KEY=... +LIVEKIT_URL=wss://live-kit-demo-70txlh6a.livekit.cloud +LIVEKIT_API_KEY=... +LIVEKIT_API_SECRET=... +``` + +**Token Server (.env):** +```env +LIVEKIT_API_KEY=APIEivUcPW3WSrV +LIVEKIT_API_SECRET=... +PORT=3001 +``` + +### Testing Locally + +```bash +cd julia-agent/julia-ai + +# Install dependencies +uv sync + +# Download required models (first time) +uv run python src/agent.py download-files + +# Test in console +uv run python src/agent.py console + +# Run for frontend connection +uv run python src/agent.py dev +``` + +### LiveKit Dashboard + +Monitor agent sessions and logs: https://cloud.livekit.io + +--- + +## Project Structure + +``` +WellNuoLite/ +β”œβ”€β”€ app/ # Expo Router screens +β”‚ β”œβ”€β”€ (auth)/ # Auth flow screens +β”‚ └── (tabs)/ # Main app tabs +β”œβ”€β”€ components/ # Reusable components +β”œβ”€β”€ services/ # API, navigation +β”œβ”€β”€ contexts/ # React contexts +β”œβ”€β”€ julia-agent/ # LiveKit AI agent +β”‚ └── julia-ai/ +β”‚ └── src/agent.py # Main agent code +β”œβ”€β”€ AuthKey_GA9C2GRPHS.p8 # ASC API Key +β”œβ”€β”€ build-ios.sh # iOS build script +β”œβ”€β”€ eas.json # EAS configuration +└── app.json # Expo configuration +``` + +--- + +## Links + +| Resource | URL | +|----------|-----| +| App Store Connect | https://appstoreconnect.apple.com | +| EAS Dashboard | https://expo.dev/accounts/serter20692/projects/WellNuo | +| LiveKit Dashboard | https://cloud.livekit.io | +| Privacy Policy | https://wellnuo.smartlaunchhub.com/privacy.html | +| Support | https://wellnuo.smartlaunchhub.com/support.html | + +--- + +## Full App Store Instructions + +See: `/Users/sergei/Desktop/WellNuo/INSTRUCTIONS_APP_STORE.md` + +Contains: +- Screenshots requirements +- App Store texts (copy-paste ready) +- Privacy labels +- Review notes +- Checklist before submission diff --git a/build-ios.sh b/build-ios.sh new file mode 100755 index 0000000..982af74 --- /dev/null +++ b/build-ios.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# EAS Build script for iOS with Robert's Apple Team credentials +# This script uses ASC API Key to authenticate and manage credentials + +export EXPO_APPLE_TEAM_ID="UHLZD54ULZ" +export EXPO_APPLE_TEAM_TYPE="INDIVIDUAL" +export EXPO_ASC_KEY_ID="GA9C2GRPHS" +export EXPO_ASC_ISSUER_ID="dcac5647-0710-4764-affd-2d3270bf49d4" +export EXPO_ASC_API_KEY_PATH="$(pwd)/AuthKey_GA9C2GRPHS.p8" + +# Optional: Skip Apple login prompt and use existing credentials +# Add --non-interactive if credentials are already set up + +echo "Building iOS with Apple Team ID: $EXPO_APPLE_TEAM_ID" +echo "Using ASC API Key: $EXPO_ASC_KEY_ID" +echo "" + +# Run the build +npx eas-cli build --platform ios --profile "${1:-production}"