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
This commit is contained in:
parent
dde0ecb9cd
commit
eaa7828e65
296
README.md
296
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
|
## Quick Start
|
||||||
|
|
||||||
```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:
|
|
||||||
|
|
||||||
```bash
|
```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).
|
| Parameter | Value |
|
||||||
- [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.
|
|-----------|-------|
|
||||||
|
| 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
|
||||||
|
|||||||
20
build-ios.sh
Executable file
20
build-ios.sh
Executable file
@ -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}"
|
||||||
Loading…
x
Reference in New Issue
Block a user