Plans / Download plan

Download plan: bring everything from Lovable into D:\work\pitch25

Outcome: a complete, verifiable local copy of the Pitch 25 project - source code, database schema and data, users, storage, brand assets, screen captures and the build history - organized under lovable-export\ so the AWS rebuild never has to reach back into Lovable. Estimated hands-on time: about half a day, most of it waiting on exports and your two approvals.

What needs youApprove the ZIP download and the GitHub connection (D1.1 / D1.2, decision D5), type the admin password into the terminal prompt for the data export (D3.2; the script never stores it), and sign into the preview once for the signed-in screen captures (D6.1 / decision D9). Everything else is Claude running read-only steps.

Principles

Target folder layout

What Lovable exposes, and how each thing comes out

AssetWhere it lives in LovableExport routeNotes
Source code (167 files incl. 20 migrations, edge function, .env, bun.lock)Editor (Code view); Settings > GitSettings > Git > Download codebase (ZIP) and/or GitHub two-way sync (creates a new private repo; importing an existing repo is not supported)Export the editor state (latest), not the published bundle. Foundry needs the GitHub clone URL.
Database schemasupabase/migrations in the code; live DB in Lovable CloudMigrations come with the code; live snapshot via the Cloud SQL editor (information_schema, pg_policies, pg_proc, pg_trigger, pg_enum)Diff live vs migrations to catch direct edits made inside Lovable Cloud.
Data (37 tables)Lovable Cloud Postgres, protected by RLStools/export-lovable-data.mjs: supabase-js + publishable key + admin sign-in, 1,000-row pages per table to JSON; counts before/after; SQL editor for any table admins cannot fully readNo service-role key needed. Last resort: a temporary admin-only export edge function added through Lovable (costs credits, edits the project).
Auth usersSupabase Auth (auth.users) via Lovable Cloud > UsersUser list (id, email, created, last sign-in, metadata) via the Users panel or SQL editor; joined with user_roles / user_location_roles / employeesPassword hashes cannot be exported. Carry-over options are decision D4.
StorageBucket certifications (private)List storage.objects; download via signed URLs from the admin sessionExpected empty (no upload UI shipped). Verify.
Edge function admin-create-usersupabase/functions in the codeComes with the code; Lovable Cloud secrets (if any) are listed in Cloud > SecretsNo third-party secrets exist yet (no Stripe / Toast keys).
Design (tokens, fonts, images, logo)src/index.css, tailwind.config.ts, src/assets, Google FontsComes with the code; tokens documented; fonts downloaded for self-hosting; optional read-only crawl of pitch25.com for original brand sourcesCaptured tokens already on the Comps & design page.
ScreensPreview / published appBrowser screenshots: 14 public captures done; signed-in screens after you log in onceReference for parity testing after the rebuild.
Build history (chat, plans, decisions)Lovable chat + View historyTranscript captured (113 messages); version titles listPer-edit diffs are not exportable; the code export is the final state.
Published sitepuck-and-pint.lovable.appOptional wget mirrorLow value (SPA shell); skipped unless wanted.

Phases and tasks

Risks and how they are handled

RLS hides rows from the export

Some employee / timesheet tables are scoped to location managers; the admin account should still pass the is_admin() policies, but every table is reconciled against the SQL-editor row count and any shortfall is pulled through the SQL editor instead.

Live schema differs from the migrations

Lovable applied a few fixes directly ("Changed data", availability RLS fix). The live snapshot is diffed against the migrations and any drift becomes an extra migration file before Foundry runs.

Unpublished work

The editor is ahead of the published site. Both the ZIP and the GitHub sync export the editor state, so nothing is lost; the published bundle is ignored.

Credentials

The exported .env holds only the publishable key and project URL (safe in a private repo, never in a public one). The admin password is typed by you at runtime and not stored.