A modern, feature-rich SvelteKit starter template that helps you build production-ready applications faster.
# Clone the repository
git clone https://github.com/yourusername/svelte-template.git my-app
# Navigate to the project directory
cd my-app
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Start development server
npm run dev -- --open
Create a .env
file with the following variables:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/dbname"
# Authentication
JWT_SECRET="your-secret-key"
EMAIL_FROM="your-email@example.com"
SENDGRID_API_KEY="your-sendgrid-api-key"
# Stripe
STRIPE_SECRET_KEY="your-stripe-secret-key"
STRIPE_WEBHOOK_SECRET="your-stripe-webhook-secret"
STRIPE_MONTHLY_SUBSCRIPTION_PRICE_ID="your-price-id"
STRIPE_CREDIT_PACK_100_PRICE_ID="your-price-id"
PUBLIC_STRIPE_PUBLISHABLE_KEY="your-stripe-publishable-key"
# Formspark
PUBLIC_FORMSPARK_FORM_ID="your-form-id"
# SEO
SEO_TITLE="Your Site Name"
SEO_DESCRIPTION="Your site description"
SEO_CANONICAL="https://your-site.com"
SEO_OPENGRAPH_TITLE="Your Site Name"
SEO_OPENGRAPH_DESCRIPTION="Your site description"
SEO_OPENGRAPH_IMAGE="https://your-site.com/opengraph-image.jpg"
SEO_TWITTER_CARD="summary_large_image"
SEO_TWITTER_SITE="@yourhandle"
SEO_TWITTER_TITLE="Your Site Name"
SEO_TWITTER_DESCRIPTION="Your site description"
SEO_TWITTER_IMAGE="https://your-site.com/twitter-image.jpg"
# Public URL
PUBLIC_URL="https://your-site.com"
The development server includes:
# Start development server
npm run dev
# Start with network access
npm run dev -- --host
# Open in browser automatically
npm run dev -- --open
# Run tests
npm run test
# Create production build
npm run build
# Preview production build locally
npm run preview
This template can be deployed to any platform that supports Node.js. You may need to install an adapter for your target environment:
@sveltejs/adapter-vercel
@sveltejs/adapter-netlify
@sveltejs/adapter-static
@sveltejs/adapter-node
my-app/
โโโ src/
โ โโโ lib/ # Your components and utilities
โ โ โโโ components/ # Reusable UI components
โ โ โโโ server/ # Server-side utilities
โ โ โโโ i18n/ # Internationalization
โ โโโ routes/ # Page components and API routes
โ โ โโโ api/ # API endpoints
โ โ โโโ (auth)/ # Authentication routes
โ โโโ app.html # HTML template
โโโ static/ # Static assets
โโโ tests/ # Playwright test files
โโโ prisma/ # Database schema and migrations
โโโ svelte.config.js # SvelteKit configuration
This template includes Playwright for end-to-end testing:
# Run tests
npm run test
# Run tests in UI mode
npm run test:ui
# Run tests in headed mode
npm run test:headed
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with sv
, the official SvelteKit project creator.