How ahappymosquito/love_book works
Love Book is a private shared journal for two people. The user-facing workflow is to enter the Next.js handoff, create or browse shared memories, plans, gifts, habits, and cycle records, then persist and retrieve that pair’s data through FastAPI. Backend routes own feature behavior; shared authentication, models, database, and media storage support those routes. The README documents the main capabilities, but most frontend-to-API wiring was not shown, so those links are omitted rather than inferred.
Main entry points: main.py FastAPI routing · events.py Timeline events · todos.py Todo planning · love_receipts.py Gift receipts
Components 32
Web experience
- Home and entry
web/src/app/page.tsx - Timeline memories
web/src/app/timeline/page.tsx - Create records
web/src/app/create/page.tsx - Shared Todo
web/src/app/todo/page.tsx - Habits dashboard
web/src/app/habits/page.tsx - Cycle calendar
web/src/components/cycle-calendar-dashboard.tsx - Gift events
web/src/app/love-receipts/page.tsx - Profile and content
web/src/app/me/page.tsx - Flower runner
web/src/components/xiaohua-runner.tsx
API features
- Authentication
app/api/routes/auth.py - Timeline events
app/api/routes/events.py - Todo planning
app/api/routes/todos.py - Habit tracking
app/api/routes/habits.py - Cycle records
app/api/routes/cycles.py - Gift receipts
app/api/routes/love_receipts.py - Shared content
app/api/routes/contents.py - Meeting ranges
app/api/routes/meeting_sessions.py - Game scores
app/api/routes/game.py - Administration
app/api/routes/admin.py - Admin authentication
app/api/routes/admin_auth.py
Shared backend
- FastAPI routing
app/main.py - Auth and pair access
app/api/dependencies.py - Domain models
app/models.py - Database
app/core/database.py - Media processing
app/media.py - Media storage
app/storage.py - Habit reminders
app/habits.py
External services
- LLM configuration
app/ai_config.py - AMap lookup
app/amap_mcp.py - Email delivery
app/emailer.py - SMTP service
Other components
- Two partners
Connections 42
- Two partners → Home and entry: opens
- Home and entry → Timeline memories: enters journal
- Two partners → Create records: records activity
- FastAPI routing → Authentication: registers
app/main.py - FastAPI routing → Timeline events: registers
app/main.py - FastAPI routing → Todo planning: registers
app/main.py - FastAPI routing → Habit tracking: registers
app/main.py - FastAPI routing → Cycle records: registers
app/main.py - FastAPI routing → Gift receipts: registers
app/main.py - FastAPI routing → Shared content: registers
app/main.py - FastAPI routing → Meeting ranges: registers
app/main.py - FastAPI routing → Game scores: registers
app/main.py - FastAPI routing → Administration: registers
app/main.py - FastAPI routing → Admin authentication: registers
app/main.py - FastAPI routing → Database: initializes
app/main.py - FastAPI routing → Habit reminders: schedules reminders
app/main.py - Authentication → Auth and pair access: uses access checks
app/api/routes/auth.py - Timeline events → Auth and pair access: uses pair access
app/api/routes/events.py - Todo planning → Auth and pair access: uses pair access
app/api/routes/todos.py - Habit tracking → Auth and pair access: uses pair access
app/api/routes/habits.py - Cycle records → Auth and pair access: uses pair access
app/api/routes/cycles.py - Gift receipts → Auth and pair access: uses pair access
app/api/routes/love_receipts.py - Meeting ranges → Auth and pair access: uses pair access
app/api/routes/meeting_sessions.py - Timeline events → Domain models: reads and writes
app/api/routes/events.py - Todo planning → Domain models: reads and writes
app/api/routes/todos.py - Gift receipts → Domain models: reads and writes
app/api/routes/love_receipts.py - Habit tracking → Domain models: reads and writes
app/api/routes/habits.py - Cycle records → Domain models: reads and writes
app/api/routes/cycles.py - Database → Domain models: maps schema
app/core/database.py - Timeline events → Media processing: processes images
app/api/routes/events.py - Timeline events → Media storage: stores media
app/api/routes/events.py - Todo planning → Media storage: stores media
app/api/routes/todos.py - Gift receipts → Media processing: processes images
app/api/routes/love_receipts.py - Gift receipts → Media storage: stores media
app/api/routes/love_receipts.py - Habit tracking → Habit reminders: uses habit logic
app/api/routes/habits.py - Todo planning → LLM configuration: uses classification
app/api/routes/todos.py - Todo planning → AMap lookup: requests place data
app/api/routes/todos.py - Authentication → Email delivery: sends notifications
- Timeline events → Email delivery: sends notifications
app/api/routes/events.py - Habit tracking → Email delivery: sends reminders
- Gift receipts → Email delivery: sends notifications
app/api/routes/love_receipts.py - Email delivery → SMTP service: delivers email
app/emailer.py