MotirBuilding in public
MOTIR · moooon
onMotir
You’re viewing a public project. Anyone can view it — no account needed. Sign in to submit, upvote, or comment on requests.View-only — you can’t edit work items
MOTIR-25

1.1.8 Snapshot Story-1.1 auth into `nextjs-prisma-vercel-starter` (bare starter)

Done
Description

Estimate: 22m · Depends on: 1.1.7

Snapshot the auth code shipped in Story 1.1 from motir-core into moooon-B-V/nextjs-prisma-vercel-starter (the bare starter), stripping anything Motir-specific so the starter remains a generic baseline. Same pattern as Subtasks 1.0.6 and 1.0.5.6: this is a snapshot push to main of an existing repo, not a fork into a new repo. After this Subtask, every future "Use this template" click on the bare starter (whether by the Motir planner or an external user) yields a project with email/password + Google OAuth wired in by default.

Why this is a Subtask of Story 1.1, not a separate Story: The backport is mechanical — copy the relevant files from motir-core, run the strip, smoke-test, push. It depends on Story 1.1's auth code existing, so it belongs inside the Story; making it a separate Story would just create coordination overhead. Same logic that put 1.0.5.6 inside Story 1.0.5.

Why parallel with 1.1.9 and not sequential: Both backport Subtasks depend only on 1.1.7 (the E2E test passing); they touch separate repos and don't share files. Running in parallel saves a day of wall-clock time. If a strip mistake surfaces in one starter, fix-forward in the other rather than serializing.

What you'll do: Locally rsync the relevant files from motir-core/ into a sibling clone of the bare starter: lib/auth/*, lib/users/repo.ts, lib/email.ts, app/api/auth/[...all]/route.ts, app/(auth)/*, middleware.ts, the User + OAuthAccount + PasswordResetToken Prisma models (added to the bare starter's schema alongside the existing MigrationMarker placeholder — keep the placeholder so the starter's initial migration story is preserved), and any new .env.example keys (BETTER_AUTH_SECRET, BETTER_AUTH_URL, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, EMAIL_PROVIDER=console). Strip out any Motir-as-consumer references (mirror the 1.0.6 / 1.0.5.6 strip pattern). Generate a fresh migration for the new auth tables. Verify all 4 quality gates pass (lint, format:check, typecheck, build). Run the end-to-end "Use this template" smoke test: create throwaway repo → clone → install → db-up → migrate dev → dev → sign up with email/password → sign in with Google (using throwaway Google Cloud OAuth creds) → delete throwaway. Then push the single commit to main; CI must stay green.

Acceptance criteria

  • moooon-B-V/nextjs-prisma-vercel-starter's main branch advances with a single commit that adds the auth code from Story 1.1. isTemplate stays true.
  • Code shipped: Better-Auth setup, email/password method, Google OAuth provider, User + OAuthAccount + PasswordResetToken tables (User-only schema — no Workspace/multi-tenancy), password-hash helper, user repo, sign-up / sign-in / reset-password pages (unstyled — the bare starter has no design system), email abstraction with dev console provider only.
  • All Motir-as-consumer references stripped: no "Motir" in app/page.tsx wordmark; no "motir-core" in README; no Story/Subtask references in comments; app.theme.* not motir.theme.* for any localStorage keys carried over.
  • Fresh Prisma migration generated for the auth tables; applies cleanly to the bare starter's existing MigrationMarker table. MigrationMarker retained as the placeholder convention.
  • .env.example documents all new env vars with comments pointing the user (and the planner) to where each comes from — particularly the "Google Cloud OAuth credentials" + "email provider choice" callouts directing to planner pre-plan Stories.
  • README updated to document the auth baseline: list what ships, link to the design-system-and-auth starter as the styled alternative, name the planner-handled choices (multi-tenancy, email provider, Google Cloud OAuth credentials).
  • All 4 quality gates green: pnpm lint, pnpm format:check, pnpm typecheck, pnpm build.
  • End-to-end "Use this template" smoke test passes: throwaway repo → clone → install → db-up → migrate dev → dev → email/password sign-up + sign-in works → Google OAuth sign-in works (with throwaway Google Cloud creds) → throwaway deleted.
  • GitHub Actions CI green on the snapshot commit.

Context refs

  • motir-core/lib/auth/*, motir-core/lib/users/repo.ts, motir-core/lib/email.ts, motir-core/app/api/auth/*, motir-core/app/(auth)/*, motir-core/middleware.ts, motir-core/prisma/schema.prisma — source files to snapshot
  • Local clone of moooon-B-V/nextjs-prisma-vercel-starter — destination
  • Subtask 1.0.6's PR + commit — the precedent for the bare starter's strip pattern
  • Subtask 1.0.5.6's PR + commit — the precedent for the snapshot-from-motir-core pattern (this one is conceptually identical but for auth instead of design)
  • MOTIR.md — planner-as-consumer principle (what to bake in vs. leave to the planner)
Status
Done
Type
Sub-task