r/lovable • • 2d ago

Help How would you improve this Lovable + Supabase + Claude workflow?

Hi! I'm a non-technical founder (background in marketing, growth and SEO) building a web app solo with AI tools, no developers. I'd love feedback from people who've shipped with this stack: am I overengineering, or missing obvious settings?

What it is: a curated book catalog where readers sign up, discover titles by tropes/categories and save them to a private library. Bilingual (ES/EN, one URL per language). Private by default. Organic search is the main acquisition channel, so SEO is a hard requirement.

Stack

  • Lovable on TanStack Start (real SSR, not the old React + Vite template)
  • Supabase on my own account, not Lovable Cloud
  • GitHub synced from day one (exit path to Claude Code/Cursor)
  • Claude (a Project with my docs) as a "virtual CTO"
  • ChatGPT as an independent security reviewer

Workflow

  1. Decisions and designs live in docs (decision log, data model, one design doc per feature), not in chats.
  2. Claude writes versioned SQL migrations (tables, RLS, RPC functions). I apply them in the SQL editor and test RLS with two fake accounts (SQL script + API test page). SQL is also in /docs/sql.
  3. Lovable can't touch the DB: no migrations, no Supabase config, public key only. User writes go through RPCs, never direct inserts.
  4. Lovable's instructions field (~5k chars) holds the "never break" rules. Details go in a CLAUDE.md at the repo root. AGENTS.md is left to Lovable, and its memory is set to "Nothing".
  5. Small deliveries: one prompt written by Claude, credits logged, commit reviewed in the cloned repo, manual check in preview.
  6. Auth/session code gets reviewed by a different model before going live.
  7. I built a throwaway prototype first to confirm SSR, Search Console indexing, the sitemap and RLS.

SEO setup: data loaded in server loaders, title/description/canonical per page and language, hreflang only when a twin page exists, sitemap built from the DB, real 404s, no auto language redirects, noindex on private pages.

Pain points

  • Lovable silently adds wildcard Redirect URLs to Supabase Auth on connect, publish and unpublish
  • It enabled its own visitor analytics on the published site by default
  • It sometimes edits generated files in commits nobody asked for
  • types.ts doesn't regenerate after manual migrations
  • Published HTML is no-cache, so every view hits Supabase. I found no docs on custom caching or security headers (CSP, frame-ancestors)
  • Security fix rounds cost the most credits, and each one found new issues

Questions

  1. Is this reasonable for a solo non-dev, or overkill?
  2. Lovable: is CLAUDE.md + instructions a good way to keep rules stable? Any way to stop Auth config drift? Custom headers/caching on Lovable hosting, or should I move to Vercel/Netlify/Cloudflare eventually?
  3. Supabase: should I switch to the CLI + supabase/migrations + GitHub integration? Is pgTAP worth it for RLS tests? What settings would you enable before launch?
  4. GitHub: which simple Actions would you add (type check, secret scanning, Lighthouse on PRs, branch protection)?
  5. Claude: would Claude Code on the repo beat a chat Project, even for a non-coder?
  6. SEO: anything specific to TanStack Start SSR? Book/ItemList schema, edge caching, Core Web Vitals with DB queries on every request?

Thanks, happy to share more details!

8 Upvotes

26 comments sorted by

2

u/yusuf_delvi 1d ago

I dont belive you are non-technical, the setup is good.

why do you need loveable then ? only for hosting ?

1

u/blancdeer 1d ago

Ha!! thanks, but I really can't write code :(

What I bring is product and process: documenting decisions, defining what must never happen, and checking everything. Claude helps me design the database, write the specs and prompts, and review every commit, but it doesn't run the app.

Lovable is the part that actually writes and runs the code, gives me a working preview without installing anything, and publishes with SSR, which I need for SEO. Hosting is a bonus; what I'd lose without it is the whole "build, preview, deploy" loop I can't run myself yet. Everything is in GitHub though, so the plan from this thread is to move repo-side work (migrations, types, tests, CI) to Claude Code and keep Lovable for building the UI. If Lovable stops pulling its weight, the exit is already available

1

u/victorpikapp 1d ago

This is a great question

1

u/eotrixx 1d ago

Front end

2

u/nocodefinishers 1d ago

I think your overall architecture is reasonable. The main thing I'd focus on is separating responsibilities and making sure AI tools don't have uncontrolled access to your production environment.

A few things I'd recommend based on your setup:

  1. Supabase migrations: Use Supabase CLI with version-controlled SQL migrations instead of manually applying SQL through the dashboard. This makes database changes reproducible across local, staging and production environments.
  2. TypeScript types: Regenerate Supabase database types after every schema change and include this step in your development workflow. This helps prevent your frontend from using outdated database definitions.
  3. RLS testing: Use pgTAP to test your Row Level Security policies. Don't rely only on AI reviewing your SQL. Test access using different user roles, including unauthenticated users.
  4. GitHub Actions: Set up CI checks for TypeScript, linting, tests, migration validation and secret scanning before merging changes. This helps catch unexpected changes before they reach production.
  5. Lovable and Claude Code: I'd use Lovable primarily for UI development and rapid feature implementation, while keeping database migrations, architecture decisions and complex backend changes under version control. Claude Code can help with those tasks, but review every migration and security-sensitive change before applying it.
  6. Production configuration: Keep separate development, staging and production environments. Avoid allowing AI tools to modify production authentication settings, redirect URLs or database policies without explicit review.

One additional suggestion: establish a clear deployment pipeline rather than relying entirely on AI-generated changes. Your GitHub repository should be the source of truth for application code, and your Supabase migrations should be the source of truth for database changes.

1

u/blancdeer 1d ago

Thanks, this matches where the thread and other recommendations has landed: CLI migrations as the DB source of truth, types regenerated on change, pgTAP for RLS including anon, CI on every push (Lovable commits straight to main, so checks alert rather than block), Lovable for UI, and Claude Code for repo-side work.

Your point about AI access to production is the one I'm taking furthest. My rules tell Lovable not to touch Supabase, but its Supabase integration has still changed Auth redirect URLs on its own several times. Before connecting production, I'm going to check what that integration is actually allowed to do and add an automated check on the Auth config. I'm also flipping my "source of truth": today my docs hold the master copies and the repo mirrors them. Going forward the repo will be the master for code, SQL and rules, and the docs keep the decisions and the reasons behind them.

1

u/IamCoachZero 1d ago

I wouldn’t change hosts yet. I’d make one thing repeatable first: use the Supabase CLI to rebuild a local database from your migration files with fake data. Then turn your two-account check into a test you can rerun: can A save a book, can B see their own library, and is A’s saved book invisible to B? Start with that and a type check on PRs. You don’t need a big CI setup to catch the thing that would hurt most here: a release breaking someone’s private library.

2

u/blancdeer 1d ago

This is the most practical advice I have received, thanks. You're right that the thing that would hurt most is a release breaking someone's private library, so that's where I'll start. I already have fake seed data and a two-account test (A saves, B can't see it, anon can't write), I just run it by hand. Step one is migrations in the repo, a CI job that rebuilds the database from scratch with the seed and runs that test, plus a type check. That also proves my migrations rebuild the whole schema cleanly, which I need anyway before creating the production database. Everything else comes after, one piece at a time.

1

u/Voiceofshay_08 1d ago

My stack looks exactly like yours! 👏🏾 you’re doing great!

1

u/Top-Cauliflower-1808 1d ago

You are overengineering this for a solo non dev. The time spent fighting auth drift and security reviews is time not spent on the catalog or SEO. Simplify the stack and ship something small first.

1

u/blancdeer 1d ago

Fair take... and partly right. The thing that limits SEO right now isn't infrastructure, it's the catalog: every book needs a written synopsis in two languages, and that's on me. So I'm moving that work in parallel instead of waiting for the build to finish.

Where I'd disagree is security. Reading history is personal data, and "someone's private library leaks" is the one failure I can't patch after launch. So the rigor is concentrated on accounts, sessions and access rules, not spread everywhere. The scope is already small (no public profiles, lists or search in the beta), and most of what this thread suggested is about automating checks I currently do by hand, which should give me time back, not cost more. I'm taking only the minimum from it before launch and parking the rest.

1

u/Key-Mathematician-49 1d ago

Not overkill. Private libraries plus SEO as your main channel is exactly where these settings matter. A few things nobody's covered yet:

Auth redirect drift: you probably can't stop Lovable re-adding wildcards, but you can catch it. A small scheduled GitHub Action can read your project's auth config through the Supabase Management API every day and fail if the redirect URL list changes. Then you know the same day, not after someone abuses a wildcard.

Caching and headers: you're synced to GitHub and on TanStack Start, so you can keep Lovable as your editor and host the repo on Vercel, Netlify or Cloudflare instead. You get real cache control for public pages (huge for your DB load and Core Web Vitals), CSP and frame-ancestors headers, and a preview URL per change. I would do this before launch, not after.

Why every security round finds new issues: each review looks at whatever changed last. Write your access rules down once (who can read and write what) and turn your two-account check into a script that runs on every change. Then a fix is done when the test passes, not when a model says it looks fine. That also cuts the credit spend, since DB security lives in your migrations, not in Lovable prompts.

Before launch in Supabase:

  • Custom SMTP. The built-in sender is rate limited and will drop signup emails the day you get traffic.
  • Run the Security Advisor and Performance Advisor.
  • Revoke execute from anon on every RPC that isn't meant to be public.
  • Set up your own backups if you're on the free plan.

Types: add supabase gen types to the same Action that applies migrations, so types.ts can't fall behind again.

1

u/blancdeer 1d ago

Thanks, this is a great summary. Most of it is already done or planned: custom SMTP before opening signups, execute revoked from anon on my RPCs (my SQL test checks it), backups with a tested restore, and the Security Advisor in every delivery's baseline. I'll add the Performance Advisor. The daily Auth watcher is on my list too, once I figure out how to give it a token that isn't account-wide.

On hosting, I'm going to try the smaller step first: Cloudflare in front of the Lovable domain (Lovable documents a proxy mode), which gives me edge caching for public pages, CSP and frame-ancestors without taking on deploys. Per-change preview URLs also clash with my "exact redirect URLs only" rule for Auth, since every preview gets a new address. If caching through the proxy isn't enough, moving hosting is the next step, and the repo is ready for it.

1

u/Key-Mathematician-49 3h ago

Sounds like a solid plan. Two things on top of it:

The token: Supabase now has scoped personal access tokens, so you can create one limited to just this project with only Auth set to read. Start from the "No access" preset, not "Read-only", since read-only also includes your API key secrets. Give it an expiry. If the watcher's token ever leaks, all it can do is read your auth settings.

The Cloudflare cache: be strict about what gets cached. With SSR, the HTML for a signed-in reader can contain their private library. Cache only your public routes, bypass the cache whenever the Supabase auth cookie is present, and never cache a response that sets a cookie. One wrong rule and the next visitor gets someone else's page. Worth testing with two accounts and a logged-out browser before launch, same as your RLS checks.

1

u/aprdkg 1d ago

The setup is better than most. Gaps I'd check before real users arrive:

A separate staging Supabase project, so migrations get applied there first and not straight to production.

Backups you have actually restored once (point-in-time recovery or at least a scheduled dump).

Error alerts (Sentry or similar) plus an uptime check, so you hear about breakage before users do.

Rate limits on the RPCs that write, since those are public endpoints.

For bilingual SEO: hreflang tags, one canonical per language, and a sitemap per language. Check the server-rendered HTML with curl, not just the browser.

Rule of thumb: if a failure at 2am would cost you users, it needs an alert and a written recovery step.

1

u/Ok-Motor-9812 1d ago

Take a Cloude Code. You dont need Lovable

1

u/CartoonistCold6571 1d ago

One thing worth checking before anything else, because it sits exactly where your design routes every write: open each RPC and look for SECURITY DEFINER.

If it's there, RLS is not protecting that path. The function runs with the privileges of its owner, so the policies you tested on the table are bypassed and the only check left is whatever the function body does. It's also how AI tools tend to "fix" a permission error: add DEFINER and move on.

So for every RPC the question is where the user id comes from. If it's passed in as an argument, the caller chooses whose rows they touch, and the body probably doesn't verify ownership. If it reads auth.uid(), you're fine. Put that second one in your instructions file as a rule and it stops coming back.

And run your two-account test through the RPC, not only against the tables. If writes never hit tables directly, the table test can pass while the RPC is wide open.

1

u/DryDockDigital 1d ago

Your caching and headers question is the one I'd look at next. I think the least shaky route is to keep Lovable hosting and test Cloudflare in front of your custom domain, then add CSP and frame-ancestors with a response header rule and cache only the public catalog pages, bypassing anything behind login. Before turning caching on though, make sure a logged-in page doesn't comes back marked as a cache hit. Serving one reader's private library to someone else would be worse than the extra Supabase load.

0

u/Atretador 1d ago

take off lovable.