78 lines
1.5 KiB
Markdown
78 lines
1.5 KiB
Markdown
# QuitTraq (Stop Smoking Website v2)
|
|
|
|
QuitTraq is a Next.js + Cloudflare Workers app for tracking nicotine/marijuana usage, recovery progress, achievements, reminders, and savings.
|
|
|
|
## Tech Stack
|
|
|
|
- Next.js 16 (App Router), React 19, TypeScript
|
|
- Cloudflare Workers via OpenNext
|
|
- Cloudflare D1 (SQLite)
|
|
- WorkOS AuthKit + WorkOS User Management
|
|
- Tailwind CSS v4
|
|
|
|
## Local Development
|
|
|
|
This app should be run in Worker mode for realistic auth + D1 behavior.
|
|
|
|
```bash
|
|
bun install
|
|
bun run d1:migrate
|
|
bun run build:worker
|
|
bun run dev:worker
|
|
```
|
|
|
|
Local URL: `http://localhost:3000`
|
|
|
|
## Environment Variables
|
|
|
|
Create local env files:
|
|
|
|
- `.env.local` (Next.js runtime)
|
|
- `.dev.vars` (Wrangler runtime)
|
|
|
|
Required keys:
|
|
|
|
- `WORKOS_CLIENT_ID`
|
|
- `WORKOS_API_KEY`
|
|
- `WORKOS_REDIRECT_URI`
|
|
- `SESSION_SECRET`
|
|
- `DATABASE_URL`
|
|
|
|
Optional keys for push notifications and cron:
|
|
|
|
- `NEXT_PUBLIC_VAPID_PUBLIC_KEY`
|
|
- `VAPID_PRIVATE_KEY`
|
|
- `VAPID_SUBJECT`
|
|
- `CRON_SECRET`
|
|
|
|
## Deployment
|
|
|
|
```bash
|
|
bun run deploy:app
|
|
bun run deploy:cron
|
|
```
|
|
|
|
Or run both:
|
|
|
|
```bash
|
|
bun run deploy
|
|
```
|
|
|
|
## Database Migrations
|
|
|
|
```bash
|
|
# local D1
|
|
bun run d1:migrate
|
|
|
|
# remote D1
|
|
bun run d1:migrate:prod
|
|
```
|
|
|
|
## Recent Product/UX Updates
|
|
|
|
- Mobile dashboard uses swipe-first pages with improved snap behavior.
|
|
- Profile menu moved to top-right; quick actions are grouped in-menu.
|
|
- Daily Inspiration moved under Mood on mobile.
|
|
- Achievements cards now show unlock guidance inline.
|
|
- Achievements unlock flow hardened to avoid duplicate global first-step unlocks.
|