AI
Habit Tracker Lite
Habit plan via AI plus Redis/memory check-ins and streak helpers in logic.ts.
Run this experiment yourself
Demos are not embedded on this site. Deploy a standalone copy on Vercel or run the experiment app locally.
Local development
cd apps/experiments/habit-tracker-lite pnpm install pnpm dev
Then open http://localhost:3010.
This is an experimental demo. Use it as a starting point for your own projects.
Habit Tracker Lite is a Batch G vertical mini composition lab. Pure helpers live in logic.ts; AI calls return an honest 503 when no provider is configured.
Features
- AI weekly plan
- Redis/memory check-ins
- computeStreak helper
Server Reference
POST /api/plan
{ "habit": "..." }| Status | Cause |
|---|---|
200 | Success (or stream) |
400 | Missing / invalid input |
503 | No AI provider (AI_GATEWAY_API_KEY or OPENAI_API_KEY) |
Optional Redis persistence endpoints degrade to in-memory when unset.
Limitations
- Not a health device.
- Memory resets on cold start without Redis.
Deployment
Local Development
cd apps/experiments/habit-tracker-lite
pnpm install
pnpm devConfiguration
| Variable | Required | Purpose |
|---|---|---|
AI_GATEWAY_API_KEY | Yes (or OpenAI) | Preferred AI provider |
OPENAI_API_KEY | No | Fallback |
AI_MODEL | No | Model override |
UPSTASH_REDIS_REST_URL / UPSTASH_REDIS_REST_TOKEN | No | Persistence |