Migrate backend from Lovable Cloud to own Supabase (EDU project)

- Point .env + supabase/config.toml at EDU (qgmcpounpkgsjlwosjdi)
- Replace Lovable Google-OAuth shim with native supabase.auth.signInWithOAuth
- Remove src/integrations/lovable and @lovable.dev/cloud-auth-js dependency
- Drop .lovable metadata; gitignore supabase/.temp

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-18 18:04:18 -04:00
co-authored by Claude Opus 4.8
parent c36d2b24e9
commit 45d36827d2
9 changed files with 29 additions and 58 deletions
+6 -6
View File
@@ -1,6 +1,6 @@
SUPABASE_PROJECT_ID="fvjpfhfgkhgtwtzrgcgx"
SUPABASE_PUBLISHABLE_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZ2anBmaGZna2hndHd0enJnY2d4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODI4NDE0NDIsImV4cCI6MjA5ODQxNzQ0Mn0.B7dh8P2ZfUbJMtAGVbbRyyNFk71oqhJuqd0BNki-Dqk"
SUPABASE_URL="https://fvjpfhfgkhgtwtzrgcgx.supabase.co"
VITE_SUPABASE_PROJECT_ID="fvjpfhfgkhgtwtzrgcgx"
VITE_SUPABASE_PUBLISHABLE_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZ2anBmaGZna2hndHd0enJnY2d4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODI4NDE0NDIsImV4cCI6MjA5ODQxNzQ0Mn0.B7dh8P2ZfUbJMtAGVbbRyyNFk71oqhJuqd0BNki-Dqk"
VITE_SUPABASE_URL="https://fvjpfhfgkhgtwtzrgcgx.supabase.co"
SUPABASE_PROJECT_ID="qgmcpounpkgsjlwosjdi"
SUPABASE_PUBLISHABLE_KEY="sb_publishable_NTbfdVFqAuqLls0rg6GFWA_vVcuIglp"
SUPABASE_URL="https://qgmcpounpkgsjlwosjdi.supabase.co"
VITE_SUPABASE_PROJECT_ID="qgmcpounpkgsjlwosjdi"
VITE_SUPABASE_PUBLISHABLE_KEY="sb_publishable_NTbfdVFqAuqLls0rg6GFWA_vVcuIglp"
VITE_SUPABASE_URL="https://qgmcpounpkgsjlwosjdi.supabase.co"
+4
View File
@@ -10,6 +10,10 @@ lerna-debug.log*
node_modules
dist
dist-ssr
# Supabase CLI local state
supabase/.temp
supabase/.branches
.output
.vinxi
.tanstack/**
-5
View File
@@ -1,5 +0,0 @@
{
"schemaVersion": 1,
"template": "tanstack_start_ts_current",
"revision": "tanstack_start_ts_current-40f3c252c0da"
}
-3
View File
@@ -6,7 +6,6 @@
"name": "tanstack_start_ts",
"dependencies": {
"@hookform/resolvers": "^5.2.2",
"@lovable.dev/cloud-auth-js": "^1.1.2",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-alert-dialog": "^1.1.15",
"@radix-ui/react-aspect-ratio": "^1.1.8",
@@ -232,8 +231,6 @@
"@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],
"@lovable.dev/cloud-auth-js": ["@lovable.dev/cloud-auth-js@1.1.2", "https://europe-west1-npm.pkg.dev/lovable-core-prod/sandbox-npm-cache/@lovable.dev/cloud-auth-js/-/cloud-auth-js-1.1.2.tgz", {}, "sha512-xz8ocewsgwkp8giau272/eWWU3XrchCg5uba4yQPPYtevHTXaVU3sD+fO1JjyPBHacVcOcwhmgUiU9TKHt63cg=="],
"@lovable.dev/vite-plugin-dev-server-bridge": ["@lovable.dev/vite-plugin-dev-server-bridge@1.0.2", "", { "peerDependencies": { "vite": ">=5.0.0 <9.0.0" } }, "sha512-1c4XLFkpS614VxPyq+IX0us52vm5JWxdO1NfG2L1FjH0asKvHNu5//6wpnKHWmx60Y4HR1gcLaIiLACXIdeFyg=="],
"@lovable.dev/vite-plugin-hmr-gate": ["@lovable.dev/vite-plugin-hmr-gate@1.1.1", "https://europe-west1-npm.pkg.dev/lovable-core-prod/sandbox-npm-cache/@lovable.dev/vite-plugin-hmr-gate/-/vite-plugin-hmr-gate-1.1.1.tgz", { "peerDependencies": { "vite": ">=5.0.0 <9.0.0" } }, "sha512-ySRUzOoGQYhj4Pd9EjaA7i1+2RiaS5lSVZasun72wVZZmJfFIciGYGQQDUu88HISn4icz0sugQxFRJGCNlTggg=="],
-1
View File
@@ -13,7 +13,6 @@
},
"dependencies": {
"@hookform/resolvers": "^5.2.2",
"@lovable.dev/cloud-auth-js": "^1.1.2",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-alert-dialog": "^1.1.15",
"@radix-ui/react-aspect-ratio": "^1.1.8",
-38
View File
@@ -1,38 +0,0 @@
// This file is auto-generated by Lovable. Do not modify it.
import { createLovableAuth } from "@lovable.dev/cloud-auth-js";
import { supabase } from "../supabase/client";
const lovableAuth = createLovableAuth();
type SignInOptions = {
redirect_uri?: string;
extraParams?: Record<string, string>;
};
export const lovable = {
auth: {
signInWithOAuth: async (provider: "google" | "apple" | "microsoft" | "lovable", opts?: SignInOptions) => {
const result = await lovableAuth.signInWithOAuth(provider, {
redirect_uri: opts?.redirect_uri,
extraParams: {
...opts?.extraParams,
},
});
if (result.redirected) {
return result;
}
if (result.error) {
return result;
}
try {
await supabase.auth.setSession(result.tokens);
} catch (e) {
return { error: e instanceof Error ? e : new Error(String(e)) };
}
return result;
},
},
};
+10
View File
@@ -307,3 +307,13 @@ const rootRouteChildren: RootRouteChildren = {
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>()
import type { getRouter } from './router.tsx'
import type { startInstance } from './start.ts'
declare module '@tanstack/react-start' {
interface Register {
ssr: true
router: Awaited<ReturnType<typeof getRouter>>
config: Awaited<ReturnType<typeof startInstance.getOptions>>
}
}
+8 -4
View File
@@ -2,7 +2,6 @@ import { createFileRoute, useNavigate } from "@tanstack/react-router";
import { useState } from "react";
import { z } from "zod";
import { supabase } from "@/integrations/supabase/client";
import { lovable } from "@/integrations/lovable";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
@@ -51,9 +50,14 @@ function AuthPage() {
};
const onGoogle = async () => {
const res = await lovable.auth.signInWithOAuth("google", { redirect_uri: window.location.origin });
if (res.error) toast.error(res.error.message ?? "Google sign-in failed");
else if (!res.redirected) navigate({ to: "/dashboard" });
// Native Supabase OAuth: redirects the browser to Google, then back to
// redirectTo. supabase-js (detectSessionInUrl) restores the session on
// return, and useAuth's onAuthStateChange picks it up.
const { error } = await supabase.auth.signInWithOAuth({
provider: "google",
options: { redirectTo: `${window.location.origin}/dashboard` },
});
if (error) toast.error(error.message ?? "Google sign-in failed");
};
return (
+1 -1
View File
@@ -1 +1 @@
project_id = "fvjpfhfgkhgtwtzrgcgx"
project_id = "qgmcpounpkgsjlwosjdi"