A Nuxt.js Authentication template (login, register, email validation, reset password and oauth) using Lucia-Auth, Prisma, PostgreSQL and Mailtrap.
MIT License
A Nuxt.js Authentication template (login, register, email validation, reset password and oauth) using Lucia-Auth, Prisma, PostgreSQL and Mailtrap.
[email protected]
) and later logs in with Google or GitHub using the same email address, they will be logged into their existing account. This ensures a unified user experience regardless of how they sign in.Configure Environment Variables:
Rename the .env.example
file to .env
:
Populate the .env
file with the following environment variables:
NODE_ENV=""
ORIGIN=""
GITHUB_CLIENT_ID=""
GITHUB_CLIENT_SECRET=""
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
DATABASE_URL=""
MAILTRAP_ENDPOINT=''
MAILTRAP_SENDER=''
MAILTRAP_PASSWORD=''
MAILTRAP_TEMPLATE_UUID_RESET_PASSWORD=''
MAILTRAP_TEMPLATE_UUID_VERIFY_EMAIL=''
COMPANY_NAME=''
COMPANY_INFO_EMAIL=''
COMPANY_SUPPORT_EMAIL=''
COMPANY_CONTACT_EMAIL=''
Make sure to install the dependencies:
npm install
After installing the dependencies, you need to set up Prisma. First, run the migration command and specify a name for the migration. You can use "init"
as the name:
npx prisma migrate dev --name init
Next, generate the Prisma client:
npx prisma generate
Start the development server on http://localhost:3000
:
npm run dev
Build the application for production:
npm run build
Locally preview production build:
npm run preview