How nand-o/tampt works
Tampt turns a rough idea into an editable prompt through purpose/depth selection, optional clarification, and result review; users can copy/share results and resume drafts or saved prompts from local history. The Flutter app calls a FastAPI compose service, which validates requests, reserves quota, invokes a configured provider, and validates the response. Reporting is a separate backend capability. Mobile component relationships are limited to the README’s documented workflow because mobile implementation files were not excerpted; backend links cite sampled source.
Main entry points: main.py FastAPI endpoints · session_controller.dart Session controller · base.py Provider interface · gemini.py Gemini adapter
Components 24
Flutter app
- App shell
mobile/lib/app.dart - Start and purpose
mobile/lib/features/home/home_screen.dart - Purpose and depth
mobile/lib/features/home/home_sheets.dart - Session screen
mobile/lib/features/session/session_screen.dart - Session controller
mobile/lib/features/session/session_controller.dart - Clarification view
mobile/lib/features/session/clarify_view.dart - Prompt result
mobile/lib/features/session/result_view.dart - Compose API client
mobile/lib/data/api/compose_api.dart - History screen
mobile/lib/features/history/history_screen.dart - Settings screen
mobile/lib/features/settings/settings_screen.dart
Compose service
- FastAPI endpoints
backend/app/main.py - API contracts
backend/app/schemas.py - Quota enforcement
backend/app/quota.py - Response rules
backend/app/rules.py - Model instructions
backend/app/instructions.py - Report JSONL file
backend/app/main.py
Model providers
- Provider interface
backend/app/providers/base.py - Fake provider
backend/app/providers/fake.py - Gemini adapter
backend/app/providers/gemini.py
Local state
- Session repository
mobile/lib/data/session_repository.dart - Local database
mobile/lib/data/db/tampt_database.dart - Settings store
mobile/lib/data/settings_store.dart
Other components
- App user
- Gemini API
Connections 24
- App user → Start and purpose: starts workflow
README.md - Start and purpose → Purpose and depth: chooses purpose and depth
README.md - Start and purpose → Session screen: starts session
README.md - Session screen → Session controller: manages session
README.md - Session controller → Compose API client: requests composition
README.md - Compose API client → FastAPI endpoints: sends compose request
README.md - FastAPI endpoints → API contracts: validates request
backend/app/main.py - FastAPI endpoints → Quota enforcement: reserves quota
backend/app/main.py - FastAPI endpoints → Provider interface: invokes provider
backend/app/main.py - FastAPI endpoints → Response rules: builds response
backend/app/main.py - Response rules → API contracts: validates output
backend/app/rules.py - Provider interface → API contracts: accepts compose request
backend/app/providers/base.py - Fake provider → Provider interface: implements interface
backend/app/providers/fake.py - Gemini adapter → Provider interface: implements interface
backend/app/providers/gemini.py - Gemini adapter → Model instructions: uses instructions
backend/app/providers/gemini.py - Gemini adapter → Gemini API: generates content
backend/app/providers/gemini.py - FastAPI endpoints → Report JSONL file: appends report
backend/app/main.py - Session controller → Clarification view: shows questions
README.md - Session controller → Prompt result: shows editable prompt
README.md - Prompt result → App user: copies or shares
README.md - Session controller → Session repository: resumes drafts
README.md - Session repository → Local database: stores sessions
- History screen → Session repository: opens saved prompts
README.md - Settings screen → Settings store: manages settings