How mikekuriger/dreamr-backend works
Dreamr is a Flask backend for a mobile dream-journaling and analysis app. The mobile client calls the API for authentication and profile access, dream journaling, AI interpretation and imagery, chat, insights, and subscription management. In the main application, request handlers coordinate domain services, moderation, quota checks, and persistence; Apple notifications also verify signed events before updating subscription state. The README documents additional billing, reporting, admin, and Google Play flows whose internal routes were not sampled, so those are represented at the API boundary without guessed call paths.
Main entry points: app.py Flask REST API · apple_notifications.py Apple notifications · moderation.py Content moderation · quota.py Credit accounting
Components 20
API and accounts
- Flask REST API
app.py - Accounts and profiles
app.py - Reports and admin
app.py
Dream experiences
- Dream journal
app.py - Dream interpretation
app.py - Persona prompts
prompts.py - Dream imagery
app.py - Follow-up chat
app.py - Chat sessions
sessions.py - Dream insights
app.py
Plans and billing
- Subscription service
app.py - Apple notifications
apple_notifications.py - Billing and webhooks
app.py
Shared services
- Content moderation
moderation.py - Credit accounting
quota.py - Application database
app.py
Other components
- Mobile app
- Apple App Store
- Google Play
- OpenAI API
Connections 28
- Mobile app → Flask REST API: calls API
README.md - Flask REST API → Accounts and profiles: routes account requests
README.md - Flask REST API → Dream journal: routes dream requests
README.md - Flask REST API → Dream interpretation: handles AI requests
README.md - Dream interpretation → Persona prompts: uses personas
app.py - Dream interpretation → Content moderation: screens content
app.py - Dream imagery → Credit accounting: checks and decrements
app.py - Flask REST API → Dream imagery: routes image requests
app.py - Flask REST API → Follow-up chat: routes chat requests
README.md - Follow-up chat → Chat sessions: stores history
README.md - Flask REST API → Dream insights: routes insight requests
README.md - Flask REST API → Billing and webhooks: routes billing requests
README.md - Billing and webhooks → Subscription service: handles purchases
README.md - Apple App Store → Apple notifications: sends notifications
apple_notifications.py - Apple notifications → Application database: updates subscription records
apple_notifications.py - Billing and webhooks → Apple notifications: verifies transactions
apple_notifications.py - Billing and webhooks → Google Play: verifies purchases
README.md - Billing and webhooks → Content moderation: screens generated content
app.py - Content moderation → OpenAI API: checks content
moderation.py - Dream interpretation → OpenAI API: requests interpretations
README.md - Dream imagery → OpenAI API: generates imagery
README.md - Flask REST API → Credit accounting: checks image credits
app.py - Accounts and profiles → Application database: reads and writes
app.py - Dream journal → Application database: reads and writes
app.py - Dream insights → Application database: reads and writes
app.py - Subscription service → Application database: reads and writes
app.py - Credit accounting → Application database: accounts credits
quota.py - Flask REST API → Reports and admin: routes reports and ops
README.md