3.3 KiB
3.3 KiB
Backend Handoff
This is a handoff snapshot, not the product SSOT.
Product SSOT: mall-docs report-notebooklm docs, snapshot date: 2026-06-03.
Current State
The backend is a runnable Phase 1 scaffold for the public read surface. It is not production-ready yet.
Implemented:
- FastAPI app and API prefix.
- SQLAlchemy models for the Phase 1 table set.
- Alembic initial migration.
- Seed import script.
- Public read API for feed, reports, module detail, institutions, and listen list.
- Tests for current seed behavior and public response boundaries.
Not implemented:
- Authentication.
- User personal-state routes.
- Audio stream signing.
- Outbound attribution route.
- Internal management routes.
- Production object storage integration.
- Real Redis cache invalidation.
- Production deployment config.
Repository Map
| Path | Purpose |
|---|---|
app/main.py |
FastAPI app, CORS, router registration. |
app/config.py |
Environment-driven settings. |
app/db.py |
Async SQLAlchemy engine and session dependency. |
app/cache.py |
Redis client helper and key prefixing. |
app/models/entities.py |
SQLAlchemy table models. |
app/routers/ |
HTTP route handlers. |
app/services/catalog.py |
Public catalog response assembly. |
migrations/ |
Alembic environment and migration files. |
scripts/import_seed_content.py |
Seed data importer and module fixture builder. |
tests/test_public_api.py |
Current API and seed behavior tests. |
docs/ |
Engineering handoff documentation. |
Solved Decisions
- Technical identifiers stay
report-notebooklm/rnb; display name is研听. - Public API responses expose
cache_version, notdisplay_versionor moduleversion. study_guidereplaces legacyfaq.- Heavy modules use preview cards plus full-module endpoint.
- Raw artifacts stay internal; App consumes reviewed display artifacts only.
- Gray broker sources may be audio-ized only after the latest product decision and compliance review.
- Phase 1 has no interpretation-content download feature.
Known Gaps
GET /audio/{audio_id}/streamneeds signed playback URL behavior.- Auth and personal state APIs need implementation.
POST /outbound/eventsneeds implementation and validation forclick_id/tracking_id.- Internal publish/hide/import management endpoints need implementation.
- Cursor pagination and cache invalidation are seed-scale placeholders.
- Object storage policy needs a production decision for public vs signed module content.
- Release/deploy settings need staging and production environment values.
- Compliance must re-review gray-source audio and generated media rules before launch.
Suggested Handoff Order
- Read
docs/PROJECT_BRIEF.md. - Read
docs/API_AND_DATA.md. - Run the backend locally with seed data using
docs/RUNBOOK.md. - Run
pytest -qand smoke the three core public endpoints. - Pair with
report-notebooklm-app/and verifyRNB_API_BASEpoints to this service. - Choose the next work item from
docs/ROADMAP_AND_OPEN_ISSUES.md.
Definition of Done for Next Backend Work
- New API behavior has tests.
- Public responses do not expose internal/raw fields.
- Migrations include downgrade.
- New config is environment-driven.
- Seed data remains useful for App development.
- Documentation is updated when contract behavior changes.