Skip to content

This is a demo and starter SvelteKit app that uses Prisma and has JWT auth

Notifications You must be signed in to change notification settings

chrisallenmoore/sk-prisma-jwt-auth

Repository files navigation

SvelteKit & Prisma with JWT auth

This is a starter project for using SvelteKit with JWT auth.

It has everything you need to have JWT authentication working with Prisma and SqlLite.

Tailwind CSS is also setup and is used for styling.

First, install npm Dependencies

Here's how to make this project work!

# from the root directory
npm install

Next create your database from the Prisma schema

# from the root directory
npx prisma db push

Take a look at your awesome new database with Prisma Studio

# from the root directory
npx prisma studio

Next add your jwt access secret to your .env file that was created by Prisma

In the .env file add the VITE_JWT_ACCESS_SECRET. Google JWT token generator if you need help with this.

Note: the .env file should be in your gitignore file. You don't want to save it to your repository for everyone to see.

DATABASE_URL="file:./dev.db"
VITE_JWT_ACCESS_SECRET="<your jwt access secret>"

Developing

Once you've done the above steps, run the project.

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Building

To create a production version of your app:

npm run build

About

This is a demo and starter SvelteKit app that uses Prisma and has JWT auth

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published