create-nexuskit-app
v1.1.0
Published
Create production-ready Next.js applications with NexusKit
Maintainers
Readme
create-nexuskit-app
Create production-ready Next.js applications with NexusKit in seconds.
Features
- 🚀 Interactive Setup Wizard - Guided configuration for all features
- 🗄️ Database Selection - Choose between SQLite (dev) or PostgreSQL (production)
- 🔐 Authentication - Pre-configured NextAuth.js with multiple providers
- 💳 Payments - Lemon Squeezy integration ready
- 📧 Email - Magic link authentication with Resend
- 🎨 UI Components - Beautiful, accessible components with Radix UI
- 📦 TypeScript - Full type safety out of the box
- 🛠️ Best Practices - ESLint, Prettier, Husky pre-configured
Quick Start
Using npm
npx create-nexuskit-app@latest
# or with app name
npx create-nexuskit-app@latest my-appUsing pnpm
pnpm dlx create-nexuskit-app@latest
# or with app name
pnpm dlx create-nexuskit-app@latest my-appUsing yarn
yarn create nexuskit-app
# or with app name
yarn create nexuskit-app my-appUsing bun
bunx create-nexuskit-app@latest
# or with app name
bunx create-nexuskit-app@latest my-appWhat You'll Get
The CLI will guide you through:
Database Configuration
- SQLite for quick development setup
- PostgreSQL for production-ready applications
- Automatic Prisma schema generation
Authentication Setup
- Email/Magic link authentication with Resend
- Google OAuth integration
- Admin user configuration
Payment Integration
- Lemon Squeezy setup for subscriptions
- Webhook configuration
- Multiple pricing tiers
Environment Configuration
- Automatic
.env.localgeneration - Secure secret generation
- Database URL configuration
- Automatic
Database Setup
SQLite (Development)
No additional setup required! The database file will be created automatically.
PostgreSQL (Production)
macOS
# Install PostgreSQL
brew install postgresql@15
brew services start postgresql@15
# Create database
createdb your_app_nameUbuntu/Debian
# Install PostgreSQL
sudo apt update
sudo apt install postgresql postgresql-contrib
# Start service
sudo systemctl start postgresql
# Create database
sudo -u postgres createdb your_app_nameWindows
Download and install from postgresql.org
Docker
docker run -d \
--name postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=your_app_name \
-p 5432:5432 \
postgres:15Environment Variables
The CLI automatically creates a .env.local file with:
# Database
DATABASE_URL="your-database-url"
# Authentication
AUTH_SECRET="auto-generated-secret"
AUTH_URL="http://localhost:3000"
# Email (Resend)
AUTH_RESEND_KEY="your-api-key"
RESEND_FROM_EMAIL="[email protected]"
# Google OAuth
AUTH_GOOGLE_ID="your-client-id"
AUTH_GOOGLE_SECRET="your-client-secret"
# Payments (Lemon Squeezy)
LEMONSQUEEZY_API_KEY="your-api-key"
LEMONSQUEEZY_STORE_ID="your-store-id"
LEMONSQUEEZY_WEBHOOK_SECRET="your-webhook-secret"Post-Installation
After setup completes:
# Navigate to your project
cd your-app-name
# Start development server
npm run dev
# or
pnpm dev
# or
yarn devYour app will be available at http://localhost:3000
Authentication Providers
Email/Magic Links (Resend)
- Sign up at resend.com
- Get your API key
- Add domain and verify
- Update
AUTH_RESEND_KEYandRESEND_FROM_EMAIL
Google OAuth
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add redirect URIs:
http://localhost:3000/api/auth/callback/google(dev)https://yourdomain.com/api/auth/callback/google(production)
- Update
AUTH_GOOGLE_IDandAUTH_GOOGLE_SECRET
Payment Setup (Lemon Squeezy)
- Sign up at lemonsqueezy.com
- Create a store
- Add products and variants
- Get API credentials from Settings > API
- Set up webhook endpoint:
/api/webhooks/lemonsqueezy - Update environment variables
Project Structure
your-app/
├── src/
│ ├── app/ # Next.js App Router
│ ├── components/ # React components
│ │ ├── ui/ # Shadcn/ui components
│ │ └── auth/ # Authentication components
│ ├── lib/ # Utilities and configs
│ └── types/ # TypeScript types
├── prisma/
│ └── schema.prisma # Database schema
├── public/ # Static assets
└── .env.local # Environment variablesAvailable Scripts
# Development
npm run dev # Start dev server with Turbopack
# Production
npm run build # Build for production
npm run start # Start production server
# Database
npx prisma studio # Open Prisma Studio
npx prisma db push # Push schema changes
npx prisma generate # Generate Prisma Client
# Code Quality
npm run lint # Run ESLint
npm run format # Format with PrettierTroubleshooting
Database Connection Issues
PostgreSQL not running:
# macOS
brew services restart postgresql@15
# Linux
sudo systemctl restart postgresql
# Check if running
pg_isreadyPermission denied:
# Update pg_hba.conf
sudo nano /etc/postgresql/15/main/pg_hba.conf
# Change "peer" to "md5" for local connectionsBuild Errors
Prisma Client not generated:
npx prisma generateDependencies issues:
rm -rf node_modules package-lock.json
npm installAuthentication Issues
"AUTH_SECRET is not set": Generate a new secret:
openssl rand -base64 32Google OAuth redirect mismatch: Ensure redirect URIs in Google Console match your app URL.
Support
License
MIT © NexusKit Contributors
