Skip to content

Latest commit

 

History

History
151 lines (116 loc) · 5.61 KB

File metadata and controls

151 lines (116 loc) · 5.61 KB

SvelteKit Omakase

Overview

Welcome to SvelteKit Omakase, the ultimate mise en place for your next SvelteKit project 🚀.

Inspired by the Rails doctrine, this project embraces an omakase approach—offering an opinionated selection of tools and a structured foundation while giving you the freedom to customize and extend as needed. Whether you're a seasoned developer or just starting out, this starter kit is carefully curated to get you up and running with SvelteKit by providing everything you need to build modern, scalable web applications with ease.

Table of Contents

Features

  • 🎨 Modern, Responsive & Accessible UI
  • 🔒 Robust Authentication
  • 🎛️ Customizable Dashboard
  • 📁 File Storage
  • 📧 Transactional Email
  • 🛠️ Developer Utilities & DX Enhancements

Tech Stack

Getting Started

Installation

# Clone the repository
git clone https://github.com/n00ki/sveltekit-omakase.git my-app
cd my-app

# Install dependencies with pnpm, or use your preferred package manager
pnpm install

# Setup environment variables
cp .env.example .env
# Edit .env with your configuration

# Initialize the database locally
pnpm db:push

# Start the development server
pnpm dev

Project Structure

src/
├── lib/
│   ├── assets/                # Static assets (logo, images)
│   ├── components/            # Svelte components
│   │   └── ui/                # shadcn-svelte primitives
│   ├── config/                # App config, messages, and adjustable defaults
│   ├── db/
│   │   ├── models/            # Drizzle schemas (User, Session, etc.)
│   │   ├── queries/           # Pure data queries
│   │   └── migrations/        # SQL migrations
│   ├── hooks/                 # Svelte hooks
│   ├── mail/                  # Email (Resend + Better Svelte Email templates)
│   ├── remote/                # Remote functions (*.remote.ts)
│   ├── server/                # Server-only code
│   │   ├── auth.ts            # Auth config + helpers
│   │   ├── database.ts        # Drizzle connection (default export)
│   │   ├── flash.ts           # Flash message helpers
│   │   ├── rate-limit.ts      # Rate limit helper
│   │   ├── security.ts        # Security and access guards
│   │   └── storage.ts         # R2/S3 upload signing
│   ├── state/                 # Global state (*.svelte.ts)
│   ├── upload/                # Upload policies and FileUploader
│   ├── utils/                 # Shared utilities
│   └── validations/           # Valibot schemas
├── routes/
│   ├── (auth)/                # Auth flows (login, register, password, challenge)
│   ├── (app)/                 # Protected routes (dashboard, settings)
│   └── api/                   # API endpoints
└── styles/
    └── app.css                # Global styles + Tailwind config

Path Aliases

$config         src/lib/config/config.ts
$config/server  src/lib/config/config.server.ts
$messages       src/lib/config/messages
$components     src/lib/components
$models         src/lib/db/models
$queries        src/lib/db/queries
$remote         src/lib/remote

Config

Config lives in src/lib/config, grouped by context. Import { config } from $config for public config, { config } from $config/server in server-only modules, and user-facing messages from $messages.

Documentation

Start with docs/architecture.md for project structure, rules of the road, remote function patterns, and common commands.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request 💪

License

This project is licensed under the MIT License. Dependencies are subject to their own licenses.

Acknowledgments

This starter kit relies on many open source projects. See Tech Stack for the main technologies used.

Special thanks to these incredible contributors to the open-source community: