This is an example project showcasing authentication processes using Lucia for state management and Drizzle for ORM (Object-Relational Mapping) in a SvelteKit application.
This project demonstrates how to implement authentication features such as user signup, login, logout, and protected routes using Lucia for state management and Drizzle for ORM.
Clone the repository:
git clone https://github.com/hrasekj/sveltekit-with-lucia-auth.git
Navigate into the project directory:
cd sveltekit-auth-example
Install dependencies:
pnpm install
Use .env.example to create a new .env file:
cp .env.example .env
Initialize database:
docker-compose up -d
Push migrations to the database:
npx drizzle-kit push:mysql
Start the development server:
pnpm dev
# or start the server and open the app in a new browser tab
pnpm dev --open
In browser navigate to http://localhost:5173.
Explore the authentication features implemented in the application.
To create new migration files, run:
npx drizzle-kit generate:mysql
Then push the new migration to the database.
Here are some resources that helped me create this project:
This project is licensed under the MIT License - see the LICENSE file for details.