dApp (Privy)
A Web3 dApp starter using Privy for wallet authentication and user management. Includes wagmi for Ethereum interactions, a tRPC API layer for wallet-user sync, and a Drizzle schema designed for wallet-based accounts.
Composition
Apps:
web— Next.js (→ docs) + shadcn/ui (→ module), Next Themes (→ module), TanStack Query (→ module), tRPC (→ module)
Project addons:
- Database: → PostgreSQL
- ORM: → Drizzle
Architecture
Blueprint-specific files:
scripts/
└── seed.ts # Database seed script
src/
├── app/
│ ├── page.tsx # Landing page with connect button
│ └── protected/
│ ├── layout.tsx # Protected layout with cookie check
│ └── page.tsx # Wallet info dashboard
├── components/
│ ├── app-providers.tsx # Privy + wagmi providers
│ └── header.tsx # Header with wallet info
├── lib/
│ ├── db/
│ │ ├── schema.ts # Wallet-specific DB schema
│ │ └── types.ts # DB types
│ └── wagmi.ts # Wagmi config
├── proxy.ts # Middleware with PUBLIC_ROUTES
└── trpc/
├── init.ts # tRPC context with verifyAuthToken
└── routers/
├── _app.ts # Root router
└── user.ts # User router with sync mutationWhat's included
- Privy authentication with embedded wallet support and cookie-based session persistence
- Wagmi integration configured through Privy's wagmi connector for chain interactions
- Protected routes using a
protectedroute group with server-side cookie verification - Wallet-user sync via a tRPC
user.syncmutation that upserts wallet addresses on login - Custom DB schema with wallet address fields instead of traditional email/password columns
- tRPC context using Privy's
verifyAuthTokenfor server-side token validation
Extra dependencies
| Package | Purpose |
|---|---|
@privy-io/react-auth | Privy React SDK for wallet authentication UI |
@privy-io/wagmi | Privy wagmi connector for chain interactions |
@privy-io/server-auth | Server-side token verification |
wagmi | React hooks for Ethereum |
viem | TypeScript Ethereum library |
Environment variables
| Variable | Description |
|---|---|
NEXT_PUBLIC_PRIVY_APP_ID | Privy application ID (from Privy dashboard) |
NEXT_PUBLIC_PRIVY_CLIENT_ID | Privy client ID of an app client, optional (same dashboard) |
PRIVY_APP_SECRET | Server-side Privy secret for token verification (same dashboard) |
.env.example leaves all three blank, because they come from your own Privy account and a made-up value would start the SDK against an app that does not exist. While NEXT_PUBLIC_PRIVY_APP_ID is blank the app shows a setup message that names the variable and the dashboard instead of the wallet UI, so build and dev run with a clean console. A request that carries a privy-token cookie fails with an error naming PRIVY_APP_SECRET while that one is blank. The generated README.md and AGENTS.md list the same sources.
CLI usage
bunx create-faster my-dapp \
--blueprint dapp-privy-nextjs \
--linter biome \
--git \
--pm bunAgent context
This blueprint ships AGENTS.md + docs/agents/ guides (architecture, wallet auth, data layer) so AI coding agents understand the project out of the box. See Agent Context.
Showcase
SEO/GEO-optimized SaaS landing page with blog, programmatic persona pages, analytics, and consent management.
dApp (RainbowKit)
A Web3 dApp starter using RainbowKit for wallet connection and Sign-In with Ethereum (SIWE) for authentication. Combines Better Auth's SIWE plugin with wagmi for a full wallet-based auth flow backed by a persistent database session.

