FamilyFlow AI is a staged Next.js web app for family planning. Stage 5A added role-aware household management, Stage 5B hardened the deployment path, and the current build now uses PostgreSQL through Prisma for production persistence.
- Stage 1: dashboard, pantry-aware meals, budget planner
- Stage 2: chores, reminders, and reusable routines
- Stage 3: AI assistant, AI meal planning, and AI budget coaching
- Stage 4: authenticated household workspaces with invite codes and persistent database storage
- Stage 5A: household roles, member management, and invite controls
- Stage 5B: production hardening and deployment readiness
- Stage 5C: PostgreSQL persistence for production deployment
- Review
.envor copy.env.examplevalues into your local environment. - Set
OPENAI_API_KEYif you want the AI features enabled. - Run
npm run dev. - Open
http://localhost:3000. - Create a household workspace or join one with an invite code.
npm run dev: start the development servernpm run lint: run ESLintnpm run build: production buildnpm run check:env: verify deployment env settings and database path
- Set
DATABASE_URLto a PostgreSQL connection string. - Set
NEXTAUTH_URLto the final public app URL. - Set
NEXTAUTH_SECRETto a long random value of at least 32 characters. The deployed app now requires this explicitly. - Set
OPENAI_API_KEYif AI features should be enabled in production. - Set
RESEND_API_KEYandREMINDER_FROM_EMAILif reminder emails, password reset, and email verification should be enabled. - Set
REMINDER_DISPATCH_SECRETif you want a cron job or external scheduler to trigger reminder emails outside the app. - Run
npm run check:env. - Run
npm run db:generate. - Run
npm run build.
- Create a new Railway project from this GitHub repo.
- Add a Railway PostgreSQL service to the project.
- Set
DATABASE_URLon the web service to the PostgreSQL connection string from Railway. - Set
NEXTAUTH_SECRETto a long random value. - Set
NEXTAUTH_URLto your Railway public URL, or rely onRAILWAY_PUBLIC_DOMAIN. - Set
OPENAI_API_KEYif you want AI features enabled. - Set
RESEND_API_KEYandREMINDER_FROM_EMAILif you want reminder emails, password reset, and email verification enabled. - Set
REMINDER_DISPATCH_SECRETif you want Railway cron or another scheduler to call dispatch-pending route. - Railway will use railway.json, build with
npm run build, runnpm run db:migrate, start withnpm run start, and health check health route at/api/health.
src/app/page.tsx: session-aware entry pagesrc/components/auth-panel.tsx: sign-in / create / join flowsrc/components/familyflow-app.tsx: authenticated household workspace UIsrc/app/api/auth/[...nextauth]/route.ts: Auth.js routesrc/app/api/auth/register/route.ts: household registration and join routesrc/app/api/auth/forgot-password/route.ts: password reset request routesrc/app/api/auth/reset-password/route.ts: password reset completion routesrc/app/api/auth/resend-verification/route.ts: resend verification email routesrc/app/api/auth/verify-email/route.ts: email verification routesrc/app/api/health/route.ts: Railway health check routesrc/app/api/reminders/dispatch-pending/route.ts: background reminder email dispatch routesrc/app/api/workspace/route.ts: household workspace persistence routesrc/app/api/assistant/route.ts: OpenAI-backed planning routesrc/app/reset-password/page.tsx: reset password pagesrc/app/verify-email/page.tsx: email verification pagesrc/lib/db.ts: Prisma client setupsrc/lib/account-security.ts: verification and password reset helperssrc/lib/env.ts: shared environment and database path helperssrc/lib/email.ts: shared outgoing mail helpersrc/lib/validation.ts: API input validation helperssrc/lib/auth.ts: Auth.js configurationsrc/lib/reminders.ts: reminder email dispatch helperssrc/lib/workspace.ts: shared household persistence helpersprisma/schema.prisma: PostgreSQL data modelprisma/migrations/20260314071000_init_postgres/migration.sql: initial production schema
- Production persistence now expects PostgreSQL through
DATABASE_URL. - AI actions still work only when
OPENAI_API_KEYis set. - Email verification and password reset turn on automatically when
RESEND_API_KEYandREMINDER_FROM_EMAILare configured. If mail is not configured, new accounts stay usable for local/dev sign-in. - Resend requires the
fromaddress to match a verified sending domain. See Resend's domain mismatch guidance. next.config.tsnow applies baseline security headers for all routes.railway.jsonconfigures Railway build, start, restart, and healthcheck settings.- The SQLite-based deployment path has been replaced for production usage; Railway should now use PostgreSQL.