docs: refresh stale docs to match current implementation
Documentation pass — reviewed codebase in full, identified stale references, and aligned docs with actual code state. Changes: - CLAUDE.md, PRODUCTION_SETUP.md, LAUNCH_CHECKLIST.md, src/auth.config.ts: middleware path src/middleware.ts → src/proxy.ts (Next.js 16+ convention) - CLAUDE.md, ENVIRONMENT.md, README.md: dev server port localhost:3000 → localhost:4000 (per package.json dev script 'next dev --webpack -H 0.0.0.0 -p 4000') - PRODUCTION_DEPLOYMENT_CHECKLIST.md: rewrote migration list — actual db/migrations/ contains 10 files (0000–0091), not the Supabase-era 001–092 series. Updated platform version 1.6 → 2.0 and last-updated stamp. - MEMORY.md: refreshed 'Last updated' to 2026-06-25, added current-state header flagging Auth.js v5 wiring as historical, and documented the SSH/Gitea workflow (id_ed25519_crispygoat + no API token → push-hook URL flow for opening PRs). - LAUNCH_CHECKLIST.md: added 'Last updated: 2026-06-25' header and refresh note in footer. - CLAUDE.md: new 'Gitea authentication (SSH)' subsection under 'Canonical Remote' documenting ~/.ssh/id_ed25519_crispygoat, ssh-agent setup, what works (git push) vs what doesn't (REST API without token), and the actual PR-creation workflow (push + open the URL the Gitea hook prints). Verification: - npx tsc --noEmit: pre-existing Stripe API version + test mock errors only (verified by stashing changes and re-running — same error set). - No new errors introduced.
This commit is contained in:
@@ -1,47 +1,38 @@
|
||||
# Route Commerce — Production Deployment Checklist
|
||||
|
||||
**Platform Version:** 1.6
|
||||
**Last Updated:** 2026-05-13
|
||||
**Platform Version:** 2.0
|
||||
**Last Updated:** 2026-06-25
|
||||
**Environment:** Next.js 16 (App Router) · Postgres (direct via `pg`) · Neon Auth (Better Auth) · Stripe · Square · Resend · FedEx
|
||||
|
||||
---
|
||||
|
||||
## 1. Migration Order
|
||||
|
||||
Apply migrations in number order. All numbered `001`–`092` are required.
|
||||
Apply migrations in number order. The full set lives in `db/migrations/`:
|
||||
|
||||
```bash
|
||||
# Push all migrations (sequential, no Supabase CLI required)
|
||||
npm run migrate:one 001
|
||||
npm run migrate:one 002
|
||||
# ... through ...
|
||||
npm run migrate:one 092
|
||||
|
||||
# Or push all at once
|
||||
# Push all migrations (idempotent — `_migrations` table tracks what's applied)
|
||||
npm run migrate
|
||||
```
|
||||
|
||||
**Key migrations (last 15):**
|
||||
The current migration set is consolidated (the Supabase-era 001–092 series was collapsed into `0001_init.sql` plus a handful of incremental files). If `db/migrations/` is empty after the Supabase → Postgres migration, see `MEMORY.md` "Direction Pivot" for the cutover notes.
|
||||
|
||||
**Current migrations in `db/migrations/`:**
|
||||
|
||||
| # | File | Purpose |
|
||||
|---|------|---------|
|
||||
| 078 | `wholesale_deposit_guard.sql` | Adds `amount`, `payment_method` to `wholesale_deposits` |
|
||||
| 079 | `resend_analytics.sql` | Adds Resend webhook endpoint + analytics tables |
|
||||
| 080 | `communication_segments.sql` | Adds `communication_segments` table |
|
||||
| 081 | `stop_blast_campaign.sql` | Adds `stop_blast_campaign` RPC |
|
||||
| 082 | `brand_name_in_campaign_email.sql` | Adds `brand_name` column to `communication_campaigns` |
|
||||
| 083 | `shipping_settings.sql` | Adds `shipping_settings` table |
|
||||
| 084 | `shipments.sql` | Adds `shipments` table for FedEx tracking |
|
||||
| 085 | `brand_settings.sql` | Adds `brand_settings` table (core) |
|
||||
| 086 | `brand_settings_email_integration.sql` | Adds email/webhook fields to `brand_settings` |
|
||||
| 087 | `brand_logos_bucket.sql` | Adds `brand-logos` storage bucket |
|
||||
| 088 | `brand_features.sql` | Adds `brand_features` table + RPCs for add-on system |
|
||||
| 089 | `ai_providers_custom_integrations.sql` | Adds AI provider credentials storage |
|
||||
| 090 | `storefront_settings.sql` | Adds storefront customization fields + `get_brand_settings_by_slug` RPC |
|
||||
| 091 | `091_brand_plan_tier.sql` | Adds `plan_tier`, limits, `stripe_customer_id`, `get_brand_plan_info` RPC |
|
||||
| 092 | `092_stripe_subscriptions.sql` | Adds `stripe_subscription_id/status/current_period_end`, `set_brand_subscription`, `get_brand_subscription` RPCs |
|
||||
| 0000 | `0000_qa_neon_auth_stub.sql` | QA-only stub for `neon_auth` schema (real provisioning via Neon Auth in prod) |
|
||||
| 0001 | `0001_init.sql` | Core schema: brands, products, orders, stops, customers, communication tables, water log, time tracking, RPCs, indexes, triggers. Fully re-runnable (`IF NOT EXISTS` + trigger guards). |
|
||||
| 0002 | `0002_admin_password.sql` | Adds `password_hash` column to `admin_users` |
|
||||
| 0003 | `0003_tour_rpc_functions.sql` | RPCs for tour/stop planning |
|
||||
| 0040 | `0040_command_center.sql` | Adds command-center dashboard tables |
|
||||
| 0041 | `0041_command_center_schema_fix.sql` | Schema fixup for command-center |
|
||||
| 0042 | `0042_drop_command_center.sql` | Drops command-center (rolled back) |
|
||||
| 0043 | `0043_admin_users_extra_columns.sql` | Adds `display_name`, `phone_number`, `brand_id`, `can_manage_pickup/messages/refunds/users`, `active`, `must_change_password`, `auth_provider`, `auth_subject`, `last_login` columns to `admin_users` |
|
||||
| 0090 | `0090_water_log_completion.sql` | Completes water-log tables/RPCs |
|
||||
| 0091 | `0091_dashboard_summary_rpc.sql` | `dashboard_summary` RPC for admin dashboard |
|
||||
|
||||
> **Note:** Migration 092 adds Stripe subscription tracking. Migration 091 adds plan tier billing. Apply both before deploying billing changes.
|
||||
> **Note:** The migration runner (`scripts/migrate.js`) tracks applied files in `_migrations` and skips already-applied files. `0001_init.sql` is fully re-runnable, so it is safe to re-apply on a DB that was initialized outside the runner. Stripe subscription tracking, plan-tier billing, brand settings, etc. are all part of `0001_init.sql` — they were originally separate Supabase-era migrations that were consolidated.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user