A modern, production-ready Nuxt 4 template featuring a robust authentication system, ORM integration, and a clean UI foundation.
- Nuxt 4: The latest and greatest from the Nuxt team.
- Better Auth: Comprehensive authentication with Email OTP support.
- Prisma: Type-safe ORM for interacting with the database.
- SQLite: Lightweight, zero-configuration database, ideal for development and small-to-medium projects.
- Nuxt UI v3: Beautiful, accessible, and customizable UI components built with Tailwind CSS.
- Nodemailer: Pre-configured for sending verification emails via Gmail.
- Framework: Nuxt
- Auth: Better Auth
- ORM: Prisma
- Database: SQLite
- UI Framework: Nuxt UI
- Email: Nodemailer
See the Template Usage docs. Otherwise, feel free to keep moving with the setup steps!
git clone <your-repo-url>
cd nuxt-templateThis project uses pnpm, but you can use npm as well.
pnpm installCopy the example environment file and fill in your details.
cp .env.example .envOpen .env and configure the following:
DATABASE_URL: The SQLite connection string (default:file:./dev.db).BETTER_AUTH_SECRET: A secure random string for encryption. You can generate one usingopenssl rand -hex 32.BETTER_AUTH_URL: The base URL of your application (default:http://localhost:3000).EMAIL_USER: Your Gmail address (for OTP delivery).EMAIL_PASS: Your Gmail App Password. How to generate an App Password.
Initialize your SQLite database and run migrations. You will need to run this command anytime you need to change or create a database. If there are any migrations that need to be run, the command will ask for a name for the migration. You can simply hit enter, or name your migration.
pnpm prisma:resetpnpm devYour application will be available at http://localhost:3000. This command also starts Prisma Studio automatically.
Login requires an email address that already exists in the database.
- Option A: Use the seeded user
Go to
/authand log in withemail@example.com. - Option B: Use your own email
Update
prisma/seed.tswith your email, then runpnpm prisma:resetto re-seed.
To get your OTP:
- Check your configured email inbox.
- Or, check the Prisma Studio tab in your browser and look in the
Verificationtable.
app/: Frontend code (pages, components, assets, composables).server/: Backend code (API routes, authentication logic, database utilities).prisma/: Database schema, migrations, and seed scripts.public/: Static assets.
Important: You must update the GitHub Actions workflow to point to your own repository and AWS configuration.
Add the following Secrets and Variables to your repository:
-
ACTIONS_ROLE_ARN (Secret):
arn:aws:iam::YOUR-AWS-ACCOUNT-ID:role/YOUR-ROLE-NAME -
REPOSITORY (Variable):
your-repository-name
Optionally, you may update the AWS region.
- AWS Region (line 26 in
.github/workflows/main.yml):aws-region: your-aws-region
Before the GitHub Actions will work, you need:
- AWS ECR Repository: Create a repository in Amazon ECR
- IAM Role: Create a role with GitHub Actions OIDC provider and ECR permissions
- GitHub Secrets: Ensure your repository has the necessary AWS permissions
MIT