Rank 1: Thread
Hey everyone! 👋
Building a Flutter app that sends users 1-3 location-based challenges per week based on their preferences.
The flow:
- User selects how many challenges/week they want (1-3)
- App sends notification during their free time slots
- 10 minutes to accept (can refresh once for a different challenge)
- If accepted, until midnight to complete
- Proximity notification (500-1000m) to remind them to take a memory photo
- Photos saved to user's collection
Technical approaches I'm considering:
First
- Weekly batch job that generates challenges for all active users via AI
- AI considers user location, preferences, previous trips, local events/weather
- Store generated challenges in DB with scheduled send times
- Use Appwrite's scheduled functions to trigger notifications
Second
Schedule random 1-3 times in the free time windows each week.
Real-time generation when random time arrives → AI generates 2 challenges → send notification with primary, store secondary for refresh
Third
**On signup: **immediately generate 2 challenges (primary + secondary for refresh) with scheduled function
Once user accepts/rejects both challenges → immediately create and prepare another 2 challenges
If time runs out: user has to click "prepare new challenge" button → generates new pair but just shows "Wait for the notification for the adventure" screen
This avoids inactive users costing $$ for AI calls
My questions:
- What's the absolute simplest way to architect this? Is it possible and viable to be done with Appwrite? I don't care much about costs, so if it's simpler I could skip batch processing entirely and just generate challenges on-demand when needed. It's just MVP.
- Simplest way to handle timezones? Convert everything to UTC?
- Any gotchas I should be aware of?
Since I'm inexperienced and I am learning backend as I go, any architectural guidance or simpler alternatives would be super helpful! Thanks! 🙏