sveltekit-auth-cookies Svelte Themes

Sveltekit Auth Cookies

šŸŖ SvelteKit authentication using cookies

SvelteKit Auth

āœļø https://joyofcode.xyz/sveltekit-authentication-using-cookies

Learn SvelteKit authentication using cookies.

Project Setup

šŸ§‘ā€šŸ¤ā€šŸ§‘ Clone the project

git clone https://github.com/joysofcode/sveltekit-auth-cookies.git

šŸ“¦ļø Install dependencies

You can use npm or pnpm.

pnpm i

Database

āœļø Rename .env.example to .env

DATABASE_URL="file:./dev.db"

šŸ”Ø Create the database from the Prisma schema

pnpx prisma db push

šŸ”Ž Inspect your database with Prisma Studio

pnpx prisma studio

šŸ§‘ Add user roles

Open Prisma Studio at http://localhost:5555/ and inside the Roles table press Add record to add the ADMIN and USER roles by entering the role name and pressing Save for each one.

Development

šŸ¦„ Start the project and open http://localhost:5173/

pnpm run dev

Production

šŸ”Ø Build and preview

pnpm run build && pnpm run preview

Top categories

Loading Svelte Themes