# Dev Setup Notes (Local) This file captures the local development setup used in this session so future work can resume quickly. ## Project Location - Main working copy: `/Users/averyfelts/Desktop/DevSmokeWebsite` - Old typo folder exists but unused: `/Users/averyfelts/Desktop/DevSmokWebsite` ## Runtime Choice - Use Cloudflare Worker dev flow (not plain `next dev`) for D1-backed features. - Dev server is pinned to port `3000` to avoid conflicts with Signet tooling. ## Commands From `/Users/averyfelts/Desktop/DevSmokeWebsite`: ```bash bun install bun run d1:migrate bun run build:worker bun run dev:worker ``` Expected URL: - `http://localhost:3000` ## Key Local Changes Made 1. `package.json` - Updated script: - `dev:worker` from `wrangler dev` to `wrangler dev --port 3000` 2. `.gitignore` - Added `.dev.vars` so local worker env secrets are not tracked. 3. `src/app/logo-black.png/route.ts` - Added compatibility route to stop `GET /logo-black.png 404`. - Route redirects `/logo-black.png` to `/icons/icon-192.png`. ## Env File Notes - Local app env file: `.env.local` - Local wrangler env file: `.dev.vars` - Both are intended for local development. - Keep secrets out of git. ## Cloudflare/D1 - Wrangler auth verified for this machine. - Local D1 migrations were applied via `bun run d1:migrate`. ## Known Warnings - Wrangler/OpenNext may print duplicate object key warnings from generated `.open-next` output. - These warnings did not block startup in this session. ## Session Preferences to Preserve - Keep file reads tightly scoped to explicit paths when requested. - Avoid broad folder crawling unless asked. ## Latest Session Changes ### Product and UX - Reworked mobile dashboard into dedicated swipe pages: - Mood (+ Daily Inspiration) - Quit Journey Plan - Usage Stats - Health Recovery - Achievements - Savings - Usage Calendar - Removed mobile side arrow buttons; swipe + dots are now primary navigation. - Moved floating `Log Usage` button above the mobile swipe indicator and centered it on mobile. - Updated profile menu to top-right and moved quick actions (notifications/install/theme) into menu. - Expanded Quit Journey Plan sections (no dropdown collapse), showing both nicotine and weed plans. - Replaced old theme token set with updated light/dark OKLCH theme variables in `src/app/globals.css`. ### Reliability and Auth - Added explicit dashboard/substance data load error handling and retry surface. - Fixed hourly reminders edge cases for overnight windows. - Added reminder API input validation for time/frequency values. - Implemented real password reset initiation via WorkOS endpoint and UI wiring in login/settings. ### Achievements - Added inline unlock guidance text under each achievement tile. - Added completed/locked status treatment directly in the tile. - Added unlock safeguards to avoid duplicate global `first_day` unlock behavior: - `first_day` now normalizes to `substance: both` - dedupe normalization in achievements API GET - API validation for badge/substance input - `INSERT OR IGNORE` safety in D1 write path ## Validation Commands Used ```bash bun run build bun run build:worker bun run dev:worker ``` ## Quick Troubleshooting - If UI changes do not appear in worker mode: 1. `bun run build:worker` 2. `bun run dev:worker` 3. hard refresh browser (`Cmd + Shift + R`) - If mobile swipe feels off: - swipe behavior is controlled in `src/app/globals.css` under `.swipe-container` and `.swipe-item`.