This is a Next.js template that uses Hono as the API framework and Lucia for authentication. This also uses hono's Zod to OpenAPI package to generate OpenAPI schema available at /api/swagger.json
and the editor / playground at /api/scalar
.
Uses:
- Tailwind CSS for styling
- Shadcn, Radix, input-otp, Sonner, etc. for the UI components
- Hono as the API framework
- Scalar as the Swagger Editor
- Drizzle as the ORM
- Postgres as the database
- Lucia and Oslo for auth
- React Email for the email templates
- Clone this template using:
pnpm create next-app your-app-name -e https://github.com/TheBinaryGuy/next-hono-lucia
- Create a database on your local postgres instance called
example
. - Then run the following commands:
cd your-app-name
pnpm db:migrate
pnpm dev
- That's it!
Name | Description |
---|---|
NEXT_PUBLIC_DOMAIN | The domain of the website, defaults to localhost:3000 |
DATABASE_URL | Postgres connection string, defaults to postgres://postgres@localhost/example |
EMAIL_FROM | Email from address, defaults to "Example hey@example.com" |
EMAIL_PROVIDER | Email provider, console, smtp, resend, default is console |
RESEND_API_KEY | If email provider is resend, get your key from resend.com |
SMTP_HOST | If email provider is smtp |
SMTP_PORT | If email provider is smtp, defaults to 587 |
SMTP_USERNAME | If email provider is smtp |
SMTP_PASSWORD | If email provider is smtp |
SMTP_SECURE | If email provider is smtp, true or 1, defaults to true |
STANDALONE | If you want standalone output, set this to 1, if you are using the provided Dockerfile then this is already taken care of, defaults to 0 |