svelte-auth Svelte Themes

Svelte Auth

Register, login, reset password, confirm email functions

Svelte-auth

Sveltekit-auth app made with Sveltekit and Mongodb Cloud on top of refact0r/sveltekit-todos.

This includes:

  • Registration
  • Login/Logout
  • Confirm email
  • Reset password

Geting started one by one

Install SvelteKit:

npm init svelte@next sveltekit-demo 
cd sveltekit-demo
npm i

Install Tailwind CSS:

npx svelte-add@latest tailwindcss
npm i

Run it:

npm run dev

Install Flowbite and Flowbite-svelte

npm i -D flowbite flowbite-svelte
npm i -D @lukeed/uuid @sendgrid/mail cookie dotenv jsonwebtoken jwt-decode mongodb nodemailer nodemailer-sendgrid string-hash uuid

Clone

git clone [email protected]:shinokada/svelte-auth.git 
cd svelte-auth 
npm install

Change .env.example to .env and update it

MONGODB_URI="your-mongodb-uri" 
NODE_ENV="development" 
SECRET="your-secret"
MAILTRAP_USER="your-mailtrap-user"
MAILTRAP_PASS="your-mail-trap-pass"
DEV_URL="http://localhost:3000" 
EMAIL_FROM="[email protected]" 
NAME_FROM="John Doe"
SENDGRIP_API="sendgrid-api-key"

You need to have a MongoDB running or create a free new account. I used Mailtrap for development. You need to create a free new account for development. If you are not using Mailtrap, you need to update the src/lib/nodemailer.js file.

Run npm run dev

npm run dev

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes