A production-ready admin dashboard template built with SvelteKit 2, Svelte 5, Tailwind CSS 4, and Drizzle ORM. Features custom session-based authentication, optional OAuth (Google & GitHub), role-based access control, and a full suite of admin tools -- all with zero external auth dependencies.
⚡ Need workspaces, billing, AI chat, kanban, helpdesk, CRM, invoicing, MFA + passkeys?
SvelteForge Premium → — same stack, plus 30+ wired-up modules, multi-tenant from row zero. Live demo → · See feature comparison ↓
| Dashboard (Light) | Dashboard (Dark) |
![]() |
![]() |
| User Management | Analytics |
![]() |
![]() |
| Command Palette (Cmd+K) | Login |
![]() |
![]() |
SvelteForge (this repo) is the open-source core — pure SvelteKit + Drizzle + custom session auth, MIT-licensed, free forever. SvelteForge Premium clones this codebase and adds a multi-tenant SaaS layer on top: workspaces, billing, MFA + passkeys, AI chat, CRM, helpdesk, invoicing, and 30+ other production-ready modules.
| Capability | Free (this repo) | Premium → |
|---|---|---|
| Auth — username/email + password, Google + GitHub OAuth, sessions, Argon2id | ✅ | ✅ |
| Magic-link sign-in | — | ✅ |
| TOTP 2FA + recovery codes | — | ✅ |
| WebAuthn passkeys | — | ✅ |
| User impersonation ("sign in as") | — | ✅ |
| Multi-tenant workspaces + org switcher + member roster + invitations | — | ✅ |
| Custom roles + permission catalogue | — | ✅ |
| Billing — Stripe + Polar (env-switched), webhooks, customer portal | — | ✅ |
| Per-org usage metering + quota dashboards | — | ✅ |
| Inbox — multi-folder mail client with threads, snooze, scheduled send | — | ✅ |
| Team Chat — real-time SSE, presence, typing, mentions, reactions | — | ✅ |
| Calendar — month + week views, color tagging | — | ✅ |
| Kanban — drag-drop boards, columns, due dates | — | ✅ |
| Notes / Wiki — workspace markdown with folder tree | — | ✅ |
| Projects + tasks — Gantt timeline, status, priority | — | ✅ |
| Files — S3-compatible storage (AWS S3, R2, MinIO, B2) | — | ✅ |
| AI Chat — Anthropic Claude with prompt caching + tool use | — | ✅ |
| CRM — contacts directory, drag-to-stage deals, CSV import | — | ✅ |
| Helpdesk — ticket queue with SLA stamps, threaded replies | — | ✅ |
| Store — products + orders with line-item snapshots | — | ✅ |
| Invoicing — line-item editor, PDF, recurring schedules, customer portal | — | ✅ |
| Forms builder — drag-drop with conditional logic + rate-limited submit | — | ✅ |
| Status page — public services + incidents + email subscribers | — | ✅ |
| Audit log — saved-filter chips + CSV export | — | ✅ |
| API keys — prefix + hash storage, scopes, IP allowlist, per-key rate limit | — | ✅ |
| Outgoing webhooks — HMAC-signed, retries, delivery history | — | ✅ |
REST API at /api/v1 — OpenAPI 3.1 spec + Postman collection |
— | ✅ |
| Cron suite — 6 recurring endpoints (bearer-token auth) | — | ✅ |
| Slack/Discord notification channels — fan-out keyed by audit events | — | ✅ |
| Scheduled CSV reports — emailed daily/weekly/monthly | — | ✅ |
| Referrals — codes, attribution, commission accrual | — | ✅ |
| Customisable My Dashboard — drag-reorder widget grid | — | ✅ |
| Onboarding wizard + product tour primitive | — | ✅ |
| Theme customizer — brand color + typography picker | — | ✅ |
| Form wizard + Data table + CSV importer components | — | ✅ |
| Email — Resend + Cloudflare Email Sending adapters (free has console only) | console (dev) | + Resend + Cloudflare |
Documentation — /docs developer reference |
16 pages | 16 pages |
User guide at /guide — workspaces, billing, AI, every premium app |
— | 30+ chapters |
| Database tables | 7 | 7 + 49 premium |
| Demo seeder — Acme workspace + 30 tenant orgs for SaaS analytics | — | ✅ |
| License | MIT | Commercial |
| Pricing | Free forever | $69 / $149 / $349 |
▶ Try the live Premium demo → (sign in with admin / password123 · seeded with realistic data across every module)
Loved SvelteForge but need it in another stack? Check out our premium templates on DashboardPack -- built for production, backed by dedicated support.
Apex Next.js 16 + React 19 + Tailwind CSS v4. 50+ pages, full CRUD, live theme customizer, 5 dashboards. |
Zenith Next.js 16 + React 19 + Tailwind CSS v4. Achromatic design, drag-and-drop, i18n, RTL support. |
Signal Next.js 16 + React 19 + Tailwind CSS v4. 10 chart types, Storybook, 3 layout options. |
Ember Next.js 16 + React 19 + Tailwind CSS v4. Clean minimal design, Kanban, Calendar, Chat. |
Flux Next.js 16 + React 19 + Tailwind CSS v4. Gradient design, frosted glass UI, startup-native data. |
Admindek Bootstrap 5 + vanilla JS. 100+ components, theme customizer, RTL, 10 color palettes. |
Browse All Premium Templates on DashboardPack
| Layer | Technology |
|---|---|
| Framework | SvelteKit 2.59 + Svelte 5 (runes API) |
| Styling | Tailwind CSS 4 + shadcn-svelte |
| Database | SQLite via Drizzle ORM + better-sqlite3 (WAL mode) |
| Auth | Custom sessions (@oslojs/crypto) + Argon2id password hashing |
| OAuth | Arctic (Google + GitHub) -- optional, environment-driven |
| Charts | LayerChart v2 (D3-based) |
| Testing | Vitest (unit) + Playwright (E2E) |
| Linting | ESLint 10 + Prettier |
.env. No credentials = password-only login, no errors.Three built-in roles with different permission levels:
| Role | Capabilities |
|---|---|
| Admin | Full access -- manage users, change roles, delete accounts, access all settings |
| Editor | Create and manage content, view analytics and notifications |
| Viewer | Read-only access to dashboard and content |
admin role.npm install -g pnpm)# Clone the repository
git clone https://github.com/colorlibhq/svelteforge-admin.git
cd svelteforge-admin
# Install dependencies
pnpm install
# Push database schema (creates SQLite database)
pnpm db:push
# Seed the database with sample data (optional)
pnpm db:seed
# Start the development server
pnpm dev
The app will be running at http://localhost:5173.
After seeding, you can log in with:
| Username | Password | Role |
|---|---|---|
admin |
password123 |
Admin |
editor |
password123 |
Editor |
viewer |
password123 |
Viewer |
Note: If you skip seeding, the first user to register will automatically be assigned the
adminrole.
Social login is entirely optional. When no OAuth credentials are configured, the login page shows only the username/password form -- no errors, no broken buttons.
http://localhost:5173/login/google/callback.env:GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
http://localhost:5173/login/github/callback.env:GITHUB_CLIENT_ID=your-client-id
GITHUB_CLIENT_SECRET=your-client-secret
For production, update the ORIGIN environment variable to match your deployed URL:
ORIGIN=https://yourdomain.com
Redirect URIs in your OAuth apps must also be updated to use the production URL.
# Development
pnpm dev # Start dev server (http://localhost:5173)
pnpm build # Production build
pnpm preview # Preview production build
# Type Checking
pnpm check # Type-check with svelte-check
pnpm check:watch # Type-check in watch mode
# Database
pnpm db:push # Push schema changes to database
pnpm db:generate # Generate Drizzle migrations
pnpm db:studio # Open Drizzle Studio GUI
pnpm db:seed # Seed database with sample data
# Testing
pnpm test # Run unit tests (Vitest)
pnpm test:watch # Run tests in watch mode
pnpm test:e2e # Run E2E tests (Playwright)
# Code Quality
pnpm lint # Run ESLint
pnpm format # Format code with Prettier
pnpm format:check # Check formatting without writing
src/
├── app.css # Tailwind CSS 4 theme (OKLCH colors)
├── app.d.ts # TypeScript type definitions
├── hooks.server.ts # Session validation on every request
├── lib/
│ ├── assets/ # Static assets (favicon)
│ ├── components/
│ │ ├── ui/ # shadcn-svelte components
│ │ ├── animated-counter.svelte # Animated number counter (KPI cards)
│ │ ├── app-sidebar.svelte # Main navigation sidebar
│ │ ├── apps-menu.svelte # Quick-access grid menu
│ │ ├── command-palette.svelte # Cmd+K command palette
│ │ ├── data-table-pagination.svelte
│ │ ├── delete-confirm-dialog.svelte
│ │ ├── notification-bell.svelte # Notification badge + popover
│ │ ├── role-change-dialog.svelte
│ │ ├── theme-toggle.svelte # Dark/light mode toggle
│ │ └── user-form-dialog.svelte # Create/edit user form
│ ├── hooks/ # Svelte 5 reactive utilities
│ ├── server/
│ │ ├── auth.ts # Session management (token gen, validation)
│ │ ├── db/
│ │ │ ├── index.ts # Database connection (WAL mode)
│ │ │ ├── schema.ts # Drizzle schema (users, sessions, pages, etc.)
│ │ │ ├── seed.ts # Database seeder
│ │ │ └── test-utils.ts # Test database utilities
│ │ ├── id.ts # Crypto ID generator
│ │ └── oauth.ts # Arctic OAuth providers (Google, GitHub)
│ └── utils/
│ ├── export.ts # CSV/JSON export utilities
│ └── user-agent.ts # User agent parser
├── routes/
│ ├── (app)/ # Protected routes (auth required)
│ │ ├── +layout.server.ts # Auth guard + sidebar data
│ │ ├── +layout.svelte # App shell (sidebar + topbar)
│ │ ├── +page.svelte # Dashboard
│ │ ├── analytics/ # Charts and metrics
│ │ ├── content/ # CMS (pages CRUD)
│ │ ├── database/ # Database browser
│ │ ├── notifications/ # Notification center
│ │ ├── roles/ # Role management
│ │ ├── settings/ # Profile, password, sessions, app settings
│ │ └── users/ # User management
│ ├── (auth)/ # Public auth routes
│ │ ├── forgot-password/
│ │ ├── lock/
│ │ ├── login/ # Login + OAuth routes
│ │ ├── register/
│ │ └── reset-password/
│ ├── (public)/ # Public pages
│ │ └── pricing/
│ ├── api/ # API endpoints
│ └── sitemap.xml/ # Auto-generated sitemap
| Table | Description |
|---|---|
users |
User accounts (id, email, username, password hash, name, avatar, role) |
sessions |
Active sessions (hashed token ID, user agent, IP, expiry) |
pages |
CMS content (title, slug, content, template, status, author) |
notifications |
In-app notifications (title, message, type, read status) |
password_reset_tokens |
Time-limited password reset tokens (hashed) |
oauth_accounts |
OAuth provider links (Google, GitHub to user mapping) |
app_settings |
Key-value application settings |
SvelteForge Admin uses SQLite with the better-sqlite3 native module. Your hosting environment must support:
| Provider | Tier | Notes |
|---|---|---|
| Railway | Free tier available | One-click deploy, persistent volumes |
| Fly.io | Free tier available | Global edge, persistent volumes |
| Render | Free tier available | Auto-deploy from GitHub |
| VPS (DigitalOcean, Hetzner) | From ~$4/mo | Full control, Docker-friendly |
A Dockerfile is included for containerized deployments:
docker build -t svelteforge-admin .
docker run -p 3000:3000 -v ./data:/app/data svelteforge-admin
# Required
DATABASE_URL=svelteforge.db # SQLite database file path
# Required for production
ORIGIN=https://yourdomain.com # Used for OAuth redirect URIs
# Optional -- OAuth providers (omit to disable)
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# Optional -- enable demo-mode protections (see Demo Mode section below)
DEMO_MODE=false
Set DEMO_MODE=true when running a public demo of the dashboard (for
example, the live site at svelteforge.dashboardpack.com). This unlocks
two things that are invisible in a normal deployment:
src/lib/server/db/seed.ts.demo user. The seed creates a
shared demo / SvelteDemo2026! viewer account that the login page
pre-fills. When DEMO_MODE=true, the updateProfile and
changePassword settings actions refuse to touch the demo account
so one visitor can't rename it or rotate its password and lock
everyone else out.For a fully automated demo, run the seed on a schedule. The reference preview server uses a deploy-user crontab plus a small wrapper:
# /usr/local/bin/svelteforge-reset-demo
#!/usr/bin/env bash
set -euo pipefail
[ "${DEMO_MODE:-false}" = "true" ] || { echo "DEMO_MODE not enabled, refusing"; exit 1; }
cd /var/www/svelteforge
exec /usr/bin/pnpm db:seed
# crontab -e (as the deploy user)
10 * * * * /usr/local/bin/svelteforge-reset-demo >> /var/log/svelteforge-reset.log 2>&1
To make sure PM2 picks up DEMO_MODE across restarts, run from an
ecosystem file rather than pm2 start build/index.js directly:
// ecosystem.config.cjs
module.exports = {
apps: [{
name: "svelteforge",
script: "build/index.js",
cwd: "/var/www/svelteforge",
env: { NODE_ENV: "production", PORT: 3000, DEMO_MODE: "true" },
}],
};
pm2 delete svelteforge && pm2 start ecosystem.config.cjs && pm2 save
Leave DEMO_MODE unset (or false) on real deployments -- the reset
button and demo-user guard stay hidden, behaving as a normal admin
dashboard.
npx shadcn-svelte@latest add <component-name>
Components are installed to src/lib/components/ui/. Do not edit them directly -- re-run the add command to update.
Edit src/app.css to customize the color palette. SvelteForge Admin uses Tailwind CSS 4's native CSS theming with OKLCH colors and CSS custom properties for light/dark mode.
src/routes/(app)/ for protected routes+page.svelte and +page.server.ts(app)/+layout.server.ts automatically protects new routessrc/lib/components/app-sidebar.sveltesrc/lib/server/db/schema.tspnpm db:push to apply changessrc/lib/server/db/test-utils.ts SCHEMA_SQL if you have tests# Run all unit tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run E2E tests
pnpm test:e2e
Unit tests use an in-memory SQLite database created via test-utils.ts, so they don't touch your development database.
MIT
Built with SvelteKit, Svelte 5, Tailwind CSS 4, Drizzle ORM, and shadcn-svelte by Colorlib.