Transform the static MVP into a dynamic, location-aware civic event discovery platform with AI-generated content, persistent storage, and push notifications.
- Install and configure AsyncStorage for saved events persistence
- Update EventsContext to load/save events from AsyncStorage on app start
- Add loading states while hydrating saved events from storage
- Implement data migration for future app updates
- Install expo-location package
- Add location permissions to app.json
- Implement GPS-based location detection on app launch
- Create location search functionality for the expandable button
- Add location preference storage and retrieval
- Handle location permission denials gracefully
- Create API service wrapper for Perplexity API using the API key from the .env.local file
- Implementation:
utils/perplexity-api.tswith full error handling
- Implementation:
- Use the Perplexity Sonar Pro to generate event cards
- Implementation: Uses
sonar-promodel with temperature 0.2 for consistent output
- Implementation: Uses
- Implement event card generation endpoint that takes user location as input using location data that's already stored
- Implementation:
contexts/discovery-events-context.tsxwithfetchEvents()method
- Implementation:
- Generate cards with required fields: location, name, AI overview, date, time, address
- Implementation: Three-tier type system (PerplexityEventData → DiscoveredEvent → SerializedEvent)
- Create the prompt for the Perplexity Sonar Pro to generate event cards
- Implementation:
utils/event-generation.ts- generates civic/political events with structured JSON output
- Implementation:
- Target: Generate maximum possible civic/political events for the next month
- Implementation: Prompt configured for month-long event discovery with search_recency_filter
- Add API response caching (6-24 hour cache durations)
- Implementation: 12-hour TTL cache system in
utils/event-cache.tswith AsyncStorage
- Implementation: 12-hour TTL cache system in
- Implement fallback data for API failures
- Implementation: 3 hardcoded sample events (Phoenix/Austin/Seattle) when API fails
- Add rate limiting and retry logic
- Implementation: 3 retry attempts with exponential backoff (1s, 2s, 4s), respects Retry-After header
- Trigger generation on location change or manual refresh
- Implementation: DiscoveryEventsContext with
fetchEvents()andrefreshEvents()methods
- Implementation: DiscoveryEventsContext with
- The API search doesn't really work every time, logs an error with the API fetch. Figure out why these are happening. The solution was adding a 60 second cooldown between searches. UPDATE: Cooldown removed as requested.
- Should remove the fallback test cards and instead just show the search failed, with a retry button
- Should have visual indicators of which card you're at and how many are left
- Something that's engaging to see when AI response is loading
- This will use Perplexity Sonar Pro to create the back of the cards when view details is clicked
- Implement "View Details" backend that triggers on card flip
- Generate back-of-card data structure:
- Top section: Venue name, full address (with map link), organizer, website link
- Bottom section: "Impact of This Event" paragraph, three pre-generated Q&A pairs (Who is this for?, Why does it matter?, What should I expect?) under that similar to recently asked question in the google ui when viewing search results
- I'm not able to scroll the card when the text get's longer than the horizontal limits of the card viewport
- The scrolling on the front of the card is not working when starting on the middle of the screen. Might not be super user friendly since people don't know where to start scrolling
- The current scrolling mechanism on the back of the card where you start from the close details card might not be super intuitive.
- Add loading animation trigger point before API call
- Add AI text generation animation trigger point after API response
- Cache detailed view data per event to avoid regenerating
- Set up Unsplash API integration for event images
- Implement 15 fallback curated images for common event types
- Create image URL validation and error handling, if image api doesn't return an image, use the fallback image
- Implement progressive loading, the loader that was initally for the perplexity response should now also include the images loading
- Install expo-notifications package
- Configure notification permissions and settings in app.json
- Implement local notification scheduling for saved events
- Add reminder preference options (1 hour, 1 day, 1 week before)
- Create notification tap handling to navigate to events
- Add notification management (cancel, update) for removed events
- Initialize Supabase project and configure connection
- Create database schema for users, saved events, location preferences
- Implement Row Level Security (RLS) policies for data protection
- Set up Supabase Storage for cached images and user data
- Add cross-device sync for saved events
- Configure environment variables for Supabase credentials
-
@react-native-async-storage/async-storage -
expo-location -
expo-notifications -
@supabase/supabase-js - Any additional utility packages for API handling
-
PERPLEXITY_API_KEY- For AI content generation -
EXPO_PUBLIC_SUPABASE_URL- Supabase project URL -
EXPO_PUBLIC_SUPABASE_KEY- Supabase public key -
UNSPLASH_ACCESS_KEY- For event images (optional)
- Perplexity AI API access and key configuration
- Unsplash API access for images
- Supabase project creation and configuration
- Test API connections and rate limits
- Users can save events that persist across app restarts
- Location detection works and filters events appropriately
- AI generates relevant civic events with accurate details
- Images load reliably and are contextually appropriate
- Push notifications work for saved events
- App functions offline with cached data