Serverless SvelteKit application for running group-based scavenger hunts. The app is deployed on Netlify and uses Turso (libsql) as the primary database, with Drizzle ORM for schema and migrations.
@sveltejs/adapter-netlify (serverless on Netlify)@libsql/client and drizzle-ormdrizzle-kit@google/generative-ai@aws-sdk/client-s3pnpm (preferred), or npm/yarnpnpm install
Copy the example env file and adjust values as needed:
cp .env.example .env
Key variables (see .env.example for the full list):
DATABASE_URL –local.db (libsql file in the project directory)libsql://your-db.turso.ioDATABASE_AUTH_TOKEN – Turso auth token (required for remote Turso)GEMINI_API_KEY – Google Gemini API keyJWT_SECRET – long random string for signing tokensAPP_AWS_ACCESS_KEY_ID, APP_AWS_SECRET_ACCESS_KEY, APP_AWS_REGION – AWS credentials for S3S3_BUCKET, S3_PREFIX – bucket name and key prefix for uploadsYou can run the setup script to help with initial configuration:
pnpm setup
With DATABASE_URL pointing at either a local libsql file or your Turso instance:
pnpm db:push # apply schema to the database
pnpm db:seed # seed initial scavenger-hunt data
pnpm dev
Then open the printed URL in your browser (typically http://localhost:5173).
pnpm dev – start the development serverpnpm build – build for production (Netlify adapter)pnpm preview – preview the production build locallypnpm check – typecheck and Svelte checkspnpm lint – lint + Prettierpnpm test / pnpm test:unit – run unit tests with Vitestpnpm db:push – sync Drizzle schema to the configured databasepnpm db:generate – generate Drizzle migrationspnpm db:migrate – run migrationspnpm db:seed – seed initial datapnpm setup – project setup helper (env and related tasks)Production deployments are handled by Netlify using the SvelteKit Netlify adapter. The SvelteKit server routes run as Netlify Functions, and the database is Turso (libsql) accessed over HTTPS.
High-level production flow:
pnpm build).DATABASE_URL and DATABASE_AUTH_TOKEN.For detailed deployment steps and environment configuration, see DEPLOYMENT.md.