Skip to content

daedalusdevph/auth-sveltekit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auth Kit

An Authentication Base Application built with SvelteKit.

Libraries Used:

Goals

Registration

  • Email is only required after that a confirmation will be sent to the email address

Login

  • User can login with username/email and password
  • User can login via OTP
    • The email sent should also have a link and a state in the url

Rate limiting

  • Sending OTP, IP+UA limitation should only be 5 per 15minutes
  • Wrong OTP Verification should only be 5 per 15minutes

Documentation

  • Guide into changing database to postgres and mariadb
  • Diagrams for how the authentication flow works

Admin dashboard

  • To manage backups etc...

Demo dashboard apps

  • AI Prompt
  • Customer Maanger + Invoices
  • Chat Application

Development

In order to start the development server, run the following command:

Environment Setup

cp .env.example .env # Creates a copy of .env.example to .env
#.env
DATABASE_URL=local.db # For local development only
SMTP_HOST=smtp.example.com # your smtp host
SMTP_PORT=587 # your smtp port
SMTP_USER=your_email@example.com
SMTP_PASSWORD=password
SMTP_FROM_NAME="Auth Kit" # if with spaces
SMTP_FROM_EMAIL=noreply@example.com # only used for verifications,
SMTP_REPLY_TO=noreply@example.com #
ORIGIN="https://example.com" # your domain name
GITHUB_CLIENT_ID="" # This is provided by github
GITHUB_CLIENT_SECRET="" # This is provided by github
GITHUB_CALLBACK_URL="http://localhost:5173/login/github/callback"
GOOGLE_CLIENTID="" # This is provided by google console
GOOGLE_CLIENTSECRET="" # This is provided by google console
GOOGLE_CALLBACK_URL="http://localhost:5173/login/google/callback"

Create your Database file according to DATABASE_URL you set in .env

e.g

touch local.db
pnpm db:migrate # or npm run db:migrate

Run the development server

pnpm dev # or npm run dev

Seeding is wip but default accounts provided are seen in the migrate.ts file

pnpm migrate # or npm run migrate

Deploying

WIP but a dockerfile is included.

About

An Authentication starter for SvelteKit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Svelte 74.7%
  • TypeScript 24.0%
  • Other 1.3%