Website: Optimal
Optimal is an AI-powered accountability coaching app built with React Native and Expo, deployed to iOS via TestFlight. The frontend communicates with a multi-agent Spring Boot backend, rendering dynamic in-chat UI components driven by agent response tags. Users interact with AI coaching workflows for goal creation, milestone planning, and task scheduling through a conversational interface that surfaces interactive cards, confirmation flows, and date pickers inline within the chat.
- Tag-driven UI rendering -- Agent responses carry structured JSON tags (e.g.
CREATE_TASK_CARD_TAG,CREATE_GOAL_CARD_TAG,CONFIRM_TAG) that the frontend maps to interactive React Native components, enabling the backend to drive UI state from the LLM layer - Zustand state management -- Modular stores for chat, goals, tasks, and users with selector hooks to minimize re-renders across the app
- Axios HTTP service -- Singleton with JWT injection, automatic token refresh on 401, and retry logic backed by Supabase session management
- Expo Router file-based navigation -- Tab and stack navigation with animated transitions, safe area handling, and deep linking support
- React Native Reanimated -- Spring, sequence, and stagger animations throughout, including message entrance effects, loading dots, and pulse animations
The app requires three environment variables for production builds:
API_BASE_URL- Your backend API URL (must be internet-accessible)SUPABASE_URL- Your Supabase project URLSUPABASE_ANON_KEY- Your Supabase anonymous key
- Environment variables are set in EAS (Expo Application Services) and are automatically injected during the build process.
- API_BASE_URL must be internet-accessible. Localhost or temporary ngrok URLs won't work for TestFlight builds
# Set API_BASE_URL
eas env:create --scope project --name API_BASE_URL --value "https://your-backend-url.com/" --type string --environment production --visibility secret
# Set SUPABASE_URL
eas env:create --scope project --name SUPABASE_URL --value "https://your-project.supabase.co" --type string --environment production --visibility secret
# Set SUPABASE_ANON_KEY
eas env:create --scope project --name SUPABASE_ANON_KEY --value "your-supabase-anon-key" --type string --environment production --visibility secret# List all environment variables (requires interactive selection)
eas env:list- EAS CLI installed:
npm install -g eas-cli - Logged into EAS:
eas login - EAS project configured:
eas build:configure
# 1. Make changes locally
# 2. Commit and push
git add .
git commit -m "{Insert commit message}"
git push origin dev
# 3. Switch to production branch
git checkout prod
git merge dev
git push origin prod
# 4. Build
eas build --platform ios --profile productionDuring the build, you'll be prompted:
- Encryption: Answer
Y(yes) - app uses standard/exempt encryption - Apple Account Login: Answer
Y(yes) - allows EAS to manage credentials automatically - Distribution Certificate: Answer
Y(yes) - generates new certificate if needed
# 5. Submit
eas submit --platform ios --profile production