A modern, production-ready starter template for building full-stack applications with Next.js and Convex.
- β‘ Next.js 15 with App Router and TypeScript
- π Authentication with Better Auth (email/password, OAuth)
- ποΈ Real-time Database powered by Convex
- π¨ Modern UI with Tailwind CSS and Radix UI components
- π Internationalization with next-intl
- π§ Email integration with Resend
- π Type Safety throughout the stack
- π§ͺ Testing setup with Bun
- π¦ Package Management with Bun
- π§ Developer Experience with ESLint, Prettier, and TypeScript
- Frontend: Next.js 15, React 19, TypeScript
- Backend: Convex (real-time database & API)
- Authentication: Better Auth
- Styling: Tailwind CSS, Radix UI
- Email: Resend
- Runtime: Bun
- Deployment: Vercel (frontend) + Convex (backend)
git clone <your-repo-url>
cd your-project-name
bun install
# Copy environment template
cp .env.example .env
# Or run the setup script
bun run setup
Edit .env
and add your configuration:
# Required - Get these from your Convex dashboard
NEXT_PUBLIC_CONVEX_URL="your-convex-deployment-url"
NEXT_PUBLIC_CONVEX_SITE_URL="your-convex-site-url"
NEXT_PUBLIC_SITE_URL="http://localhost:3000"
# Email (Resend)
EMAIL_FROM="noreply@yourdomain.com"
RESEND_API_KEY="your-resend-api-key"
MOCK_RESEND="true" # Set to false in production
# OAuth (optional)
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
- Create a Convex account
- Create a new project
- Initialize Convex in your project:
bunx convex dev
- Copy the generated URLs to your
.env
file
# Start the development server
bun dev
# In another terminal, start Convex
bun run dev:convex
Visit http://localhost:3000 to see your app!
βββ convex/ # Convex backend functions and schema
β βββ auth.config.ts # Authentication configuration
β βββ schema.ts # Database schema
β βββ ...
βββ src/
β βββ app/ # Next.js App Router pages
β βββ features/ # Feature-based code organization
β βββ shared/ # Shared utilities and components
β β βββ components/ # Reusable UI components
β β βββ auth/ # Authentication utilities
β β βββ utils/ # Helper functions
β βββ ...
βββ scripts/ # Development and build scripts
βββ translations/ # Internationalization files
βββ ...
This template includes a complete authentication system with:
- Email/password authentication
- OAuth providers (GitHub, Google)
- Sign-in codes (passwordless)
- Protected routes
- Session management
Authentication is configured in convex/auth.config.ts
. To enable/disable auth methods, update your .env
:
AUTH_PASSWORD="true" # Email/password auth
AUTH_SIGN_IN_CODES="true" # Passwordless sign-in codes
AUTH_OAUTH="true" # OAuth providers
Convex provides a real-time database with:
- Automatic schema validation
- Real-time subscriptions
- Built-in full-text search
- File storage
- Background jobs
Define your schema in convex/schema.ts
and create functions in the convex/
directory.
The template uses:
- Tailwind CSS for utility-first styling
- Radix UI for accessible, unstyled components
- shadcn/ui component library
- Dark mode support
# Development
bun dev # Start Next.js dev server
bun run dev:convex # Start Convex dev server
bun run setup # Run initial setup
# Building
bun run build # Build for production
bun run start # Start production server
# Code Quality
bun run lint # Run ESLint
bun run format # Format with Prettier
bun run typecheck # Type check with TypeScript
# Testing
bun test # Run tests
bun run test:watch # Run tests in watch mode
- Push your code to GitHub
- Connect your repository to Vercel
- Set your environment variables in Vercel dashboard
- Deploy!
# Deploy your Convex functions
bunx convex deploy
# Set production environment variables
bunx convex env set RESEND_API_KEY your_production_key
# ... other variables
- Create feature directories in
src/features/
- Add database tables in
convex/schema.ts
- Create Convex functions for backend logic
- Build UI components in the feature directory
- Update
convex/auth.config.ts
for auth providers - Modify
src/shared/auth/
for client-side auth utilities - Update environment variables for new providers
- Customize colors in
tailwind.config.js
- Modify component styles in
src/shared/components/ui/
- Add custom CSS in
src/shared/assets/styles/
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE for details.