A modern authentication starter template built with SvelteKit and Better Auth, featuring a beautiful UI powered by Tailwind CSS and shadcn-svelte components.
Clone the repository:
git clone https://github.com/yourusername/sveltekit-better-auth-starter.git
cd sveltekit-better-auth-starter
Install dependencies:
bun install
Create a .env
file in the root directory:
DATABASE_URL=postgresql://user:password@localhost:5432/your_database
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
Push the database schema:
bun run db:push
Start the development server:
bun run dev
Visit http://localhost:5173
to see your application running.
sveltekit-better-auth-starter/
āāā src/
ā āāā lib/
ā ā āāā components/ # UI components
ā ā āāā database/ # Database schema and configuration
ā ā āāā server/ # Server-side authentication logic
ā ā āāā hooks/ # Custom SvelteKit hooks
ā āāā routes/ # SvelteKit routes
āāā static/ # Static assets
āāā [Configuration files]
/dash
) require valid sessionThe project uses Drizzle ORM with PostgreSQL and includes the following tables:
users
: User informationsessions
: Active sessionsaccounts
: OAuth accountsverifications
: Email verification tokensbun run dev
- Start development serverbun run build
- Build for productionbun run preview
- Preview production buildbun run lint
- Run ESLintbun run format
- Format code with Prettierbun run db:push
- Push database schema changesbun run db:studio
- Open Drizzle StudioThis project is configured for deployment on Vercel using the SvelteKit adapter. Make sure to:
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.