An auction platform built with SvelteKit 5. Users create book auctions, upload cover images, place bids in real time, and track sales and payments.
npm install
npm run dev
npm run check # type check
npm run test # unit tests
npm run build && npm run preview
Set in .env (private) or .env.local:
BETTER_AUTH_SECRET — long random secretBETTER_AUTH_URL — app base URL (e.g. http://localhost:5173)DATABASE_URL — Turso/LibSQL URLDATABASE_AUTH_TOKEN — Turso auth tokenPUBLIC_SUPABASE_URL — Supabase project URLPUBLIC_SUPABASE_PUBLISHABLE_KEY — Supabase anon keySECRET_STRIPE_KEY — Stripe secret keyPUBLIC_FRONTEND_URL — public base URL used by Stripe redirectsRESEND_API_KEY, EMAIL_FROMGOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRETDrizzle with LibSQL/Turso.
npm run db:generate # generate SQL
npm run db:migrate # apply migrations
npm run db:studio # inspect
Schema in src/lib/server/db/schema.ts.
src/lib/auth.ts enables email/password. src/hooks.server.ts mounts Better Auth and populates event.locals.user/session.src/lib/auth-client.ts provides authClient for login and social sign-in.socialProviders in src/lib/auth.ts and set provider callback URLs (e.g. http://localhost:5173/api/auth/callback/google and /github).await authClient.sendVerificationEmail({ email: userEmail, callbackURL: "/" });
Enable on server via emailAndPassword.requireEmailVerification and emailVerification.sendOnSignIn.
Supabase Storage holds images. Previews use the public URL from the stored fileKey.
SSE at routes/api/realtime/bids streams bid events. Client store in src/lib/stores/realtime.ts manages connection and updates.
routes/api/checkout/+server.ts creates Stripe sessions.paid/succeeded/completed)BETTER_AUTH_URL and PUBLIC_FRONTEND_URL to your domain.