svelte-cloudflare-survey-app Svelte Themes

Svelte Cloudflare Survey App

Feedback App

A modern anonymous feedback application built with SvelteKit, Cloudflare Workers, and Drizzle ORM.

Features

  • πŸ”’ Anonymous feedback collection
  • ⚑ Real-time feedback management
  • πŸ” Authentication via One Time Password or Single-Sign On
  • πŸ“§ Email notifications via Resend
  • πŸ—„οΈ SQLite (Local Dev) / Cloudflare D1 (Production) database with Drizzle ORM
  • ☁️ Deployed on Cloudflare Workers
  • πŸ› Error monitoring with Sentry
  • πŸ“˜ TypeScript support
  • πŸ§ͺ TODO:Comprehensive testing suite

Tech Stack

  • Framework: SvelteKit
  • Runtime: Cloudflare Workers
  • Database: SQLite (Local Dev) / Cloudflare D1 (Production) with Drizzle ORM
  • Authentication: Better Auth
  • Email: Resend
  • Styling: TailwindCSS with svelte-shadcn
  • TODO:Testing: Vitest + Playwright
  • Monitoring: Sentry

Prerequisites

  • Node.js 18+
  • Yarn package manager
  • Cloudflare account (for deployment)

πŸ—οΈ Developing

  1. Clone the repository and install dependencies:
yarn install
  1. Configure the required environment variables

  2. Set up the database:

yarn db:migrate
yarn db:seed
  1. Start the development server:
yarn dev

# or start the server and open the app in a new browser tab
yarn dev --open

🏒 Building

To create a production version of your app:

yarn build

You can preview the production build with yarn preview.

TODO:πŸ§ͺ Testing

Run unit tests:

yarn test:unit

Run end-to-end tests:

yarn test:e2e

Run all tests:

yarn test

πŸ—„οΈ Database Management

  • Push schema changes: yarn db:push
  • Generate migrations: yarn db:generate
  • Run migrations: yarn db:migrate
  • Open database studio: yarn db:studio
  • Seed database: yarn db:seed

πŸš€ Deployment

Deploy to Cloudflare Workers:

yarn deploy

βš™οΈ Environment

☁️ Cloudflare Variables

For local development put these in .dev.vars

AUTH_AUTH0_ID
AUTH_AUTH0_SECRET
AUTH_SECRET
AUTH_MAX_AGE=86400
RESEND_API_KEY
[email protected]

πŸ› Sentry Config

To upload source maps during yarn build put this in .env.sentry-build-plugin

SENTRY_AUTH_TOKEN
SENTRY_ORG=jmidd-dev
SENTRY_PROJECT=feedback-app

πŸ”§ Non-Secret Variables

These go in your .env

DATABASE_URL=file:local-tenant.db
DISABLE_EMAIL=true

πŸ“š Documentation

Additional documentation can be found in the /docs directory:

🧰 Development Tools

  • Code Formatting: Biome
  • Type Checking: yarn check
  • Cloudflare Types: yarn cf-typegen
  • Auth Schema Generation: yarn auth:schema

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: yarn test
  5. Submit a pull request

TODO:πŸ“„ License

[Add your license information here]

```

Top categories

Loading Svelte Themes