A modern iOS messaging application with AI-powered assistance, built with SwiftUI and Supabase.
Want to try the app right away? Follow these steps:
-
Clone the repository
git clone https://github.com/caseymanos/WhatsNext.git cd WhatsNext -
Set up configuration
cp .env.example .env
-
Open in Xcode
open ios/WhatsNext/WhatsNext.xcworkspace
-
Run the app
- Select any iPhone simulator (e.g., iPhone 16 Pro)
- Press
⌘ + Ror click the Play button - Create a test account and start exploring!
Note: The demo is pre-configured with a shared backend, so AI features work immediately. All demo users share the same database.
WhatsNext is a feature-rich messaging app that combines traditional chat functionality with intelligent AI capabilities. The app provides seamless real-time communication with proactive AI assistance to help users manage their conversations, schedules, and important messages.
- Real-time Messaging: Instant 1:1 and group conversations with typing indicators
- AI Assistant: Proactive detection of conflicts, deadlines, RSVPs, and important decisions
- Calendar Integration: Automatic event detection and scheduling conflict alerts
- Offline Support: Full offline-first architecture with automatic sync
- Read Receipts: Track message delivery and read status in real-time
- Push Notifications: Stay updated with APNs-powered notifications
- Smart Organization: AI-powered message categorization and priority detection
WhatsNext includes several AI-powered features:
- Conflict Detection: Automatically identifies scheduling conflicts across conversations
- Deadline Tracking: Extracts and monitors important deadlines from messages
- RSVP Management: Detects event invitations and tracks responses
- Priority Messages: Highlights time-sensitive and important communications
- Decision Tracking: Identifies decisions that need to be made
- Proactive Assistance: Contextual suggestions and reminders
- Platform: iOS 17+
- UI Framework: SwiftUI
- Language: Swift 5.9+
- Local Storage: SwiftData for offline-first persistence
- Concurrency: Swift async/await
- Push Notifications: Apple Push Notification service (APNs)
- Database: PostgreSQL (via Supabase)
- Authentication: Supabase Auth with JWT
- Real-time: Supabase Realtime (WebSocket subscriptions)
- Edge Functions: Deno runtime
- AI Integration: OpenAI GPT models via Supabase Edge Functions
- macOS 13+ with Xcode 15 or later
- iOS 17+ device or simulator
- Supabase account (sign up here)
- Supabase CLI installed (
brew install supabase/tap/supabase)
-
Clone the repository
git clone https://github.com/yourusername/WhatsNext.git cd WhatsNext -
Set up Supabase
Create a
.envfile in the root directory:# Supabase Configuration IOS_SUPABASE_URL=https://your-project.supabase.co IOS_SUPABASE_ANON_KEY=your-anon-key # OpenAI Configuration (for AI features) OPENAI_API_KEY=your-openai-api-key
-
Initialize the database
Link to your Supabase project and push migrations:
supabase link --project-ref your-project-ref supabase db push
-
Deploy Edge Functions
Deploy the AI-powered backend functions:
# Set up secrets supabase secrets set OPENAI_API_KEY=your-openai-api-key # Deploy functions supabase functions deploy proactive-assistant supabase functions deploy detect-conflicts-agent supabase functions deploy parse-message-ai
-
Configure the iOS app
The app automatically loads configuration from
ios/WhatsNext/Resources/Config.xcconfig, which reads from your.envfile.
-
Open the project in Xcode
cd ios/WhatsNext open WhatsNext.xcworkspaceOr using
xed:xed ios/WhatsNext
-
Select a simulator
- In Xcode, select a simulator from the scheme selector (e.g., "iPhone 16 Pro")
- For best results, use iOS 17+ simulators
-
Build and run
- Press
⌘ + Ror click the Play button in Xcode - The app will build and launch in the simulator
- Press
-
Create an account
- On first launch, tap "Sign Up" to create a test account
- Use any email/password for testing purposes
For full functionality including push notifications:
-
Configure signing
- In Xcode, select the WhatsNext target
- Go to "Signing & Capabilities"
- Select your development team
- Ensure "Automatically manage signing" is checked
-
Connect your device
- Connect your iPhone via USB or wirelessly
- Select your device from the scheme selector
-
Trust the developer certificate
- Run the app (
⌘ + R) - On your device, go to Settings > General > VPN & Device Management
- Trust your developer certificate
- Run the app (
-
Enable push notifications
- Grant notification permissions when prompted
- Push notifications will only work on physical devices (not simulators)
ios/WhatsNext/WhatsNextPackage/Sources/WhatsNextFeature/
├── AI/ # AI-powered features
│ ├── Services/ # AI service layer
│ ├── ViewModels/ # AI feature view models
│ └── Views/ # AI UI components
├── App/ # App entry point and root views
├── Auth/ # Authentication flow
├── Calendar/ # Calendar integration
├── Conversations/ # Chat and messaging
├── Models/ # Data models
├── Services/ # Core services
└── Utilities/ # Helper utilities
The app follows the Model-View-ViewModel pattern:
-
Services: Single-responsibility services handle backend interactions
SupabaseClientService: Singleton for Supabase client accessAuthService: User authentication and session managementConversationService: Conversation CRUD operationsMessageService: Message handling and queryingRealtimeService: WebSocket subscriptionsCalendarSyncEngine: EventKit integrationAIService: AI-powered feature coordination
-
ViewModels:
@MainActorview models manage UI stateAuthViewModel: Authentication flowConversationListViewModel: Conversation list with real-time updatesChatViewModel: Chat screen with messages and typing indicatorsAIViewModel: AI features coordinator
-
Models: Clean Codable data models matching the Supabase schema
Send Message
- User sends message → Optimistic UI update with temporary ID
- Message sent to Supabase → Returns with real ID
- Optimistic message replaced with server response
- AI processing triggered for content analysis
Receive Message
- Supabase Realtime receives new message
- RealtimeService callback fires
- ViewModel updates published state
- SwiftUI view auto-renders
AI Processing
- New message triggers edge function
- AI analyzes content for deadlines, conflicts, RSVPs
- Results stored in AI tables
- Real-time updates notify iOS app
- AI tab updates with new insights
Key tables:
users: User profiles and authenticationconversations: Chat conversations and metadataconversation_participants: Many-to-many relationship for group chatsmessages: Chat messages with sender attributioncalendar_events: Synced calendar eventsai_deadlines: Extracted deadlines from messagesai_rsvps: Detected RSVP requestsai_conflicts: Scheduling conflictsai_decisions: Pending decisions
All tables are protected by Row-Level Security (RLS) policies.
- Row-Level Security: All database tables enforce RLS policies
- JWT Authentication: Secure token-based auth via Supabase
- End-to-End Privacy: Users only access their own data
- Secure Storage: Credentials stored in iOS Keychain
- Environment Variables: No secrets committed to version control
# Database migrations
supabase db push # Push migrations to remote
supabase db pull # Pull remote schema changes
supabase migration list # List all migrations
# Edge functions
supabase functions deploy <function-name> # Deploy a function
supabase functions logs <function-name> # View function logs
# Local development
supabase start # Start local Supabase
supabase stop # Stop local Supabase
supabase status # Check service status- Manual Testing: Run in simulator or on device
- Database Testing: Use Supabase Studio (http://localhost:54323 for local)
- Function Testing: Test edge functions via Supabase Dashboard
- Database changes: Create a new migration in
supabase/migrations/ - Backend logic: Add edge functions in
supabase/functions/ - iOS models: Update Swift models in
Models/ - Service layer: Add or update services in
Services/ - UI layer: Create SwiftUI views and view models
Build errors in Xcode
- Clean build folder:
⌘ + Shift + K - Reset package cache: File > Packages > Reset Package Caches
- Delete derived data:
rm -rf ~/Library/Developer/Xcode/DerivedData/WhatsNext-*
Real-time not working
- Check Supabase project status
- Verify RLS policies allow access
- Ensure proper WebSocket connection
Push notifications not appearing
- Push only works on physical devices
- Check notification permissions in Settings
- Verify APNs configuration in Supabase
Calendar integration issues
- Grant calendar permissions when prompted
- Check EventKit authorization status
- Ensure calendar sync is enabled in settings
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues, questions, or contributions:
- Open an issue on GitHub
- Check existing documentation in the repository
- Review the CLAUDE.md file for development guidelines