A complete Milestone 1 implementation using Next.js (App Router) and Redis (Upstash).
- Sign up and login flow with password hashing.
- Redis-backed user storage and notification preferences.
- Session auth via signed JWT cookie.
- Protected
/homeroute. - Milestone 1 tabs:
- Meditation: 30-second breathing routine (5 in, 10 hold, 5 out, 10 hold)
- Self Love: quotes/mantras/affirmations feed
- Settings: notification toggle + logout
- Next.js 14 + TypeScript
- Redis via
@upstash/redis - Zod for validation
- bcryptjs for password hashing
- jose for session token signing
Create .env.local:
UPSTASH_REDIS_REST_URL="https://..."
UPSTASH_REDIS_REST_TOKEN="..."
SESSION_SECRET="use-a-long-random-secret"npm install
npm run devOpen http://localhost:3000.
app/actions.ts: server actions for auth and settings updateslib/db.ts: Redis persistence layerlib/auth.ts: cookie + JWT session helperscomponents/AuthForm.tsx: reusable login/signup formcomponents/HomeTabs.tsx: Milestone 1 tab UI and behavior