diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 0000000..7fe08ed
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -0,0 +1,61 @@
+name: Deploy
+
+on:
+ push:
+ branches:
+ - main
+
+concurrency:
+ group: deploy-production-main
+ cancel-in-progress: false
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ steps:
+ - name: Check out code
+ uses: actions/checkout@v4
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: npm
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Lint
+ run: npm run lint
+
+ - name: Build
+ run: npm run build
+
+ - name: Set up Supabase CLI
+ uses: supabase/setup-cli@v1
+ with:
+ version: 2.101.0
+
+ - name: Link Supabase project
+ env:
+ SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
+ SUPABASE_PROJECT_REF: ${{ secrets.SUPABASE_PROJECT_REF }}
+ SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
+ run: supabase link --project-ref "$SUPABASE_PROJECT_REF" --password "$SUPABASE_DB_PASSWORD"
+
+ - name: Apply pending migrations and seed baseline data
+ env:
+ SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
+ run: supabase db push --linked --include-seed
+
+ - name: Set up Vercel CLI
+ run: npm install --global vercel@54.4.1
+
+ - name: Deploy to Vercel production
+ env:
+ VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
+ VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
+ run: vercel deploy --prod --yes --token "$VERCEL_TOKEN"
diff --git a/.gitignore b/.gitignore
index 473d96c..ab59853 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,12 +31,17 @@ yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
-# env files (can opt-in for committing if needed)
-.env*.local
+# env files
.env
+.env.*
+!.env.example
+!.env*.example
+!.env*.sample
+!.env*.template
# vercel
.vercel
+supabase/.temp/
# typescript
*.tsbuildinfo
diff --git a/README.md b/README.md
index 97f7659..df5513c 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ This repo currently stops at:
- environment variable template
- deployment-ready project structure
-This repo does not yet include MVP feature pages, SQL schema, avatar logic, habits, streaks, or shop logic.
+This repo does not yet include MVP feature pages, avatar logic, habits, streaks, or shop logic.
## Local setup
@@ -59,11 +59,37 @@ Create a Supabase project, then copy the project URL and anon key from **Project
The starter also supports Supabase's publishable key name, but this repo documents the anon key convention from the project plan.
+### Database workflow
+
+- Schema migrations live under `supabase/migrations/`.
+- Baseline catalog data lives in `supabase/seed.sql` and is safe to rerun during deploys because it uses idempotent upserts.
+- Local CLI config lives in `supabase/config.toml` for `supabase start`, `supabase db reset`, and related commands.
+- Production database sync runs from GitHub Actions on `main` using `supabase db push --linked --include-seed` before the app deploy relies on those changes.
+
## Deploy
-1. Push the repo to GitHub.
-2. Import the repo into Vercel.
-3. Add the same Supabase environment variables in Vercel.
-4. Deploy.
+This repo includes `.github/workflows/deploy.yml`, which runs on pushes to `main`.
+
+The workflow:
+
+- checks out the repo
+- runs `npm ci`, `npm run lint`, and `npm run build`
+- links the Supabase CLI to the production project
+- applies pending database migrations and reruns `supabase/seed.sql` via `supabase db push --linked --include-seed`
+- deploys the app to Vercel production only after the database sync succeeds
+
+### Required GitHub secrets
+
+- `SUPABASE_ACCESS_TOKEN`
+- `SUPABASE_PROJECT_REF`
+- `SUPABASE_DB_PASSWORD`
+- `VERCEL_TOKEN`
+- `VERCEL_ORG_ID`
+- `VERCEL_PROJECT_ID`
+
+### Required Vercel environment variables
+
+- `NEXT_PUBLIC_SUPABASE_URL`
+- `NEXT_PUBLIC_SUPABASE_ANON_KEY`
Frontend and backend are both served from this Next.js app. Supabase provides auth and database services.
diff --git a/app/(app)/avatar/page.tsx b/app/(app)/avatar/page.tsx
new file mode 100644
index 0000000..da2310a
--- /dev/null
+++ b/app/(app)/avatar/page.tsx
@@ -0,0 +1,19 @@
+import { AvatarStatusCard } from "@/components/avatar/avatar-status-card";
+import { DailyQuizLinkButton } from "@/components/daily-quiz/daily-quiz-link-button";
+import { HabitTracker } from "@/components/habits/habit-tracker";
+import { AppShell } from "@/components/layout/app-shell";
+
+export default function AvatarPage() {
+ return (
+
- You've successfully signed up. Please check your email to - confirm your account before signing in. + Your account is ready. You can sign in and start using Habit Pet.