Registration is completed using LazorKit passkey and WebAuthn biometrics
Nextjs-Lazorkit-Starter-Template — Next.js Starter Template
By Uche44
A Web3 authentication template based on Next.js and LazorKit, using passkey registration, signed-message login, JWT sessions, and PostgreSQL persistence, and including Solana gasless transfer and transaction history examples.
Explore the design
Compare the page layouts and mobile experience. Open any screenshot for a closer look.
Actual screenshot captured by the server browser.
All pages & views 2
Screenshots show visual appearance; interactive behavior may differ.
What stands out
A quick read of the recorded project description.
Login is implemented through cryptographic signature verification of signed messages
JWT sessions are stored in httpOnly cookies
User and transaction data are persisted to PostgreSQL via Prisma
Server-side authentication checks are provided for protected routes
Includes gasless transfer and transaction history examples
Template Details
This template targets passwordless authentication scenarios for Solana dApps. The README states that it uses LazorKit passkey (WebAuthn) for registration, performs cryptographic signature verification via signed messages at login, and stores sessions as JWTs in httpOnly cookies. User data and transaction records are persisted to PostgreSQL through Prisma ORM, and server-side authentication checks are provided for protected routes.
At the feature level, it includes registration, login, a dashboard, gasless transfer (the example sends 0.00002 SOL), and transaction history. The README lists the corresponding API endpoints (/api/auth/*, /api/transactions, /api/user/profile) and the Prisma models for User and Transaction. The tech stack is Next.js App Router, React, TypeScript, Tailwind CSS, LazorKit SDK (@lazorkit/wallet), Prisma, and Solana Devnet.
Before use, you need Node.js 18+, a PostgreSQL database, and npm/yarn, and you must configure the three environment variables DATABASE_URL, JWT_SECRET, and NEXT_PUBLIC_APP_URL, then run prisma generate and prisma migrate dev. The README also provides deployment steps for Vercel, Railway, and Netlify along with production environment variable setup. The README does not provide information on performance, concurrency capacity, or actual operation in a production environment.
Is it right for your project?
Use Cases
- Adding a passwordless authentication flow to a Solana dApp
- Integrating passkey registration and signed-message login into a Next.js project
- Building a backend for user and transaction records with PostgreSQL persistence
- Referencing the implementation approach for gasless transfer and transaction history pages
Suitable For
- Web3 developers who need passwordless authentication for Solana
- Projects using Next.js App Router and TypeScript
- Teams that already have a PostgreSQL database
- Developers who want to build on an existing template
Getting started & customization
Use these recorded setup notes alongside the repository instructions for your chosen version.
- 1
Requires Node.js 18+ and a PostgreSQL database, and copy .env.example to .env
- 2
Configure DATABASE_URL, JWT_SECRET (at least 32 characters), and NEXT_PUBLIC_APP_URL
- 3
Run npx prisma generate and npx prisma migrate dev --name init to initialize the database
- 4
Run npm run dev to start the development server and visit http://localhost:3000
- 5
When deploying to Vercel, set the environment variables on the platform and run npx prisma migrate deploy
License & source material
Usage conditions & limitations
Free to use · keep license noticeThis entry covers the free version under the MIT license in a public repository; the free scope is the code of this version and does not mean that external services or third-party assets are free.
Must comply with when using
- You are allowed to use, modify, commercialize, and distribute the code of this version for free.
- When distributing copies or substantial portions of the code, retain the original author's copyright notice and the complete MIT license notice.
- The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.
Additional costs & items to verify
- Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
- External services such as domains, hosting, databases, payments, or AI may incur additional charges.
- Runtime requirements: Node.js 18 or higher must be installed.
- You must provide your own PostgreSQL database (local or hosted); the template depends on the database to run.
- You need to configure the DATABASE_URL connection string to point to an available PostgreSQL database.
- You need to generate and configure a JWT_SECRET key of at least 32 characters yourself.
- You need to configure NEXT_PUBLIC_APP_URL as the actual access address of the application.
- For quick start, using a third-party hosted PostgreSQL service is recommended, which may involve external account registration and terms of service.
- Blockchain functionality is based on Solana Devnet, not the mainnet environment.
- If email verification is needed, you must integrate a third-party email service such as Resend or SendGrid.
View Original Text Basis
Permission is hereby granted, free of charge
Original License Text
- Node.js 18+ installed
Original README
- PostgreSQL database (local or hosted - see setup options below)
Original README
DATABASE_URL="postgresql://username:password@localhost:5432/lazorkit?schema=public"
Original README
JWT_SECRET="your-super-secret-jwt-key-min-32-characters-long"
Original README
NEXT_PUBLIC_APP_URL="http://localhost:3000"
Original README
Use a free hosted PostgreSQL service:
Original README
- **Blockchain**: Solana (Devnet)
Original README
https://github.com/Uche44/Nextjs-Lazorkit-Starter-Template/blob/main/LICENSEhttps://github.com/Uche44/Nextjs-Lazorkit-Starter-Template/blob/main/README.md3. Send verification emails (use Resend, SendGrid, etc.)
Original README
Compiled by DeepSeek based on repository license and README ·2026-10-14. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.
Project checks & description sources
Template Information
- Source platforms
- GitHub
- Documentation and maintenance reference score
- More documented · 83 / 100
- Technologies
- Next.js · React
- Website type
- Starter
How this score is calculated
Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.
What to verify for this project
- Repository update recorded
- 2026-01-14
- Screenshot last checked
- 2026-10-14
A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.
The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.
Use a selection guide →How this description was prepared
AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.
Review declaration: codex-user-requested-batch-review-20261015 · 2026-10-15
Inspect the recorded source material
SHA-256: cb70f533936bb382aae44fd80896e0175d1d098cac06d816c565a012d90973c4
2026-10-14T21:19:48.512Z
Source file / repository# LazorKit Next.js Authentication Template
A production-ready Next.js template for Web3 authentication using LazorKit passkeys, complete with database persistence and session management.
> **Perfect for**: Web3 developers who want to add secure, passwordless authentication to their Solana dApps without building from scratch.
## Features
- **Passkey Authentication**: WebAuthn-based signup with biometric authentication
- **Message Signing Login**: Cryptographic signature verification for secure login
- **Session Management**: JWT tokens stored in httpOnly cookies
- **Data Persistence**: All user data and transactions stored in PostgreSQL
- **Protected Routes**: Server-side authentication checks
**Transaction History**: Track all gasless transfers
- **Production Ready**: Clean code, no debug logs, fully typed with TypeScript
## Prerequisites
- Node.js 18+ installed
- PostgreSQL database (local or hosted - see setup options below)
- npm or yarn package manager
## Quick Start
### 1. Clone and Install
```bash
git clone <your-repo-url>
cd lazorkit
npm install
```
### 2. Set Up Environment Variables
Copy the example environment file and configure it:
```bash
cp .env.example .env
```
Edit `.env` with your actual values:
```env
# Database Connection
DATABASE_URL="postgresql://username:password@localhost:5432/lazorkit?schema=public"
# JWT Secret (generate a secure random string)
JWT_SECRET="your-super-secret-jwt-key-min-32-characters-long"
# App URL
NEXT_PUBLIC_APP_URL="http://localhost:3000"
```
**Generate a secure JWT secret:**
```bash
# On Linux/Mac
openssl rand -base64 32
# Or use Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
```
### 3. Run Database Migrations
```bash
# Generate Prisma Client
npx prisma generate
# Run migrations to create database tables
npx prisma migrate dev --name init
# (Optional) Open Prisma Studio to view your database
npx prisma studio
```
### 4. Start Development Server
```bash
npm run dev
```
Visit `http://localhost:3000` to see the app!
## Database Setup Options
### Option 1: Local PostgreSQL
Install PostgreSQL locally and create a database:
```bash
# Create database
CREATE DATABASE lazorkit;
# Your DATABASE_URL will be:
DATABASE_URL="postgresql://your_username:your_password@localhost:5432/lazorkit"
```
### Option 2: Hosted Database (Recommended for Quick Start)
Use a free hosted PostgreSQL service:
- **[Supabase](https://supabase.com)**: Free tier with 500MB database
- **[Neon](https://neon.tech)**: Serverless Postgres with generous free tier
- **[Railway](https://railway.app)**: Easy deployment with PostgreSQL addon
After creating a database, copy the connection string to your `.env.local` file.
## Project Structure
```
├── app/
│ ├── api/
│ │ ├── auth/ # Authentication endpoints
│ │ ├── transactions/ # Transaction management
│ │ └── user/ # User profile
│ ├── signup/ # Signup page
│ ├── login/ # Login page
│ └── dashboard/ # Protected dashboard
├── components/
│ ├── protected-route.tsx
│ ├── gasless-transfer.tsx
│ ├── transaction-history.tsx
│ └── ...
├── contexts/
│ └── auth-context.tsx # Authentication state management
├── lib/
│ ├── prisma.ts # Prisma Client singleton
│ └── auth.ts # JWT and signature utilities
└── prisma/
└── schema.prisma # Database schema
```
## Usage Guide
### 1. Sign Up
1. Navigate to `/signup`
2. (Optional) Enter your name and email
3. Click "Create account with passkey"
4. Use your device's biometric authentication (fingerprint, Face ID, etc.)
5. You'll be automatically logged in and redirected to the dashboard
### 2. Login
1. Navigate to `/login`
2. Click "Sign in with passkey"
3. Sign the authentication message with your passkey
4. You'll be redirected to the dashboard
### 3. Dashboard
The dashboard displays:
- User information
- Wallet balance
- Gasless transfer functionality
- Message signing demo
- Transaction history
### 4. Gasless Transfers
1. From the dashboard, click "Send 0.00002 SOL (Gasless)"
2. The transaction is sent without requiring SOL for gas fees
3. Transaction is automatically saved to the database
4. View it in the transaction history table
## API Endpoints
### Authentication
- `POST /api/auth/signup` - Create new user account
- `POST /api/auth/login` - Authenticate existing user
- `POST /api/auth/logout` - Clear session
- `GET /api/auth/me` - Get current user
### Transactions
- `POST /api/transactions` - Save transaction
- `GET /api/transactions` - Get transaction history
### User Profile
- `GET /api/user/profile` - Get user profile
- `PUT /api/user/profile` - Update user profile
## Database Schema
### User Model
```prisma
model User {
id String @id @default(uuid())
smartWalletAddress String @unique
passkeyId String?
name String?
email String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
transactions Transaction[]
}
```
### Transaction Model
```prisma
model Transaction {
id String @id @default(uuid())
userId String
signature String @unique
type TransactionType @default(TRANSFER)
amount BigInt
recipient String
status TransactionStatus @default(PENDING)
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id])
}
```
## Troubleshooting
### Database Connection Issues
If you see "Can't reach database server":
1. Verify your DATABASE_URL is correct
2. Ensure PostgreSQL is running
3. Check firewall settings
4. For hosted databases, verify IP whitelist settings
### Prisma Client Not Found
Run:
```bash
npx prisma generate
```
### Migration Errors
Reset the database (⚠️ deletes all data):
```bash
npx prisma migrate reset
```
## Security Notes
- JWT tokens are stored in httpOnly cookies (not accessible via JavaScript)
- Signatures are verified server-side using Solana's nacl library
- All API routes check authentication before processing requests
- Never commit `.env.local` to version control
## Tech Stack
- **Frontend**: Next.js 16 (App Router), React 19, TypeScript
- **Authentication**: LazorKit SDK (@lazorkit/wallet)
- **Database**: PostgreSQL with Prisma ORM
- **Blockchain**: Solana (Devnet)
- **Styling**: Tailwind CSS
## Learn More
- [LazorKit Documentation](https://docs.lazorkit.com)
- [Prisma Documentation](https://www.prisma.io/docs)
- [Next.js Documentation](https://nextjs.org/docs)
- [Solana Documentation](https://docs.solana.com)
## Customization Guide
### Branding
1. **Update App Name**: Search and replace "LazorKit" with your app name in:
- `README.md`
- `package.json` (name field)
- `app/login/page.tsx` and `app/signup/page.tsx` (UI text)
- `lib/auth.ts` (authentication message)
2. **Styling**: Modify Tailwind classes in components to match your brand colors
- Primary color: `purple-600` → your brand color
- Gradients: Update in login/signup pages
### Database Schema
To add custom fields to the User model:
1. Edit `prisma/schema.prisma`:
```prisma
model User {
// ... existing fields
bio String?
avatar String?
// Add your custom fields
}
```
2. Create and run migration:
```bash
npx prisma migrate dev --name add_custom_fields
```
### Adding New Features
**Example: Add user profile page**
1. Create API route: `app/api/user/profile/route.ts`
2. Create page: `app/profile/page.tsx`
3. Use `ProtectedRoute` component for authentication
4. Access user via `useAuth()` hook
## Deployment
### Deploy to Vercel (Recommended)
1. **Push to GitHub**:
```bash
git init
git add .
git commit -m "Initial commit"
git remote add origin <your-repo-url>
git push -u origin main
```
2. **Deploy on Vercel**:
- Go to [vercel.com](https://vercel.com)
- Import your GitHub repository
- Add environment variables:
- `DATABASE_URL`
- `JWT_SECRET`
- `NEXT_PUBLIC_APP_URL` (your Vercel URL)
- Deploy!
3. **Run migrations on production**:
```bash
# Install Vercel CLI
npm i -g vercel
# Run migration
vercel env pull .env.production
npx prisma migrate deploy
```
### Deploy to Other Platforms
**Railway**:
- Connect GitHub repo
- Add PostgreSQL addon (auto-sets DATABASE_URL)
- Add JWT_SECRET environment variable
- Deploy automatically
**Netlify**:
- Connect GitHub repo
- Set build command: `npm run build`
- Add environment variables
- Deploy
### Environment Variables for Production
Ensure these are set in your deployment platform:
```env
DATABASE_URL="your-production-postgres-url"
JWT_SECRET="your-production-jwt-secret"
NEXT_PUBLIC_APP_URL="https://your-domain.com"
NODE_ENV="production"
```
## Common Customizations
### Change Session Duration
Edit `lib/auth.ts`:
```typescript
const JWT_EXPIRES_IN = '30d'; // Change from '7d' to your preference
```
And `app/api/auth/login/route.ts`:
```typescript
maxAge: 60 * 60 * 24 * 30, // 30 days instead of 7
```
### Add Email Verification
1. Add `emailVerified` field to User model
2. Create verification token system
3. Send verification emails (use Resend, SendGrid, etc.)
4. Add verification check in protected routes
### Switch to Different Blockchain
To use a different blockchain (e.g., Ethereum):
1. Replace `@solana/web3.js` with your blockchain SDK
2. Update signature verification in `lib/auth.ts`
3. Modify wallet connection in `providers/wallet-provider.tsx`
4. Update LazorKit configuration if supported
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
MIT
Explore similar templates
Compare previews and descriptions within the same stack and category.

Next.js SaaS Starter
The official Next.js SaaS starter template, integrating email/password authentication, Stripe Checkout subscriptions, a dashboard with user/team CRUD, basic Owner/Member RBAC, and activity logging.
Next.js · SaaS

Next.js Commerce
Vercel's officially maintained Next.js App Router ecommerce starter with deep Shopify integration, offering a complete product catalog, cart, and checkout flow. Core logic is modular for swapping backends, and community provider versions exist for BigCommerce, Medusa, and Saleor.
Next.js · E-commerce

Next-js-Boilerplate
A developer-first Next.js 16 starter with Tailwind CSS 4 and TypeScript, supporting both App Router and Page Router.
Next.js · Starter

tailwind-nextjs-starter-blog
A Next.js and Tailwind CSS blog starter template using Contentlayer for Markdown/MDX, with built-in SEO, code highlighting, and tags. It targets personal technical blogs and migration from Jekyll/Hugo to React, and supports one-click Vercel deployment.
Next.js · Blog

next-forge
next-forge is a Turborepo-based Next.js template maintained by Vercel, positioned as a starting point for SaaS products.
Next.js · Starter

SaaS-Boilerplate
SaaS-Boilerplate is an open-source SaaS starter template built with Next.js App Router, React 19, TypeScript, Tailwind CSS, and Shadcn UI.
Next.js · SaaS
