create-codehuddle-nextjs
v1.4.12
Published
π Interactive CLI tool to generate modern Next.js 15 apps with authentication, payments, dashboard, PWA, and more. Choose your stack with TypeScript, Tailwind CSS, shadcn/ui, and enterprise features.
Maintainers
Readme
π create-codehuddle-nextjs
The ultimate CLI tool for generating modern, production-ready Next.js applications with enterprise-grade features, modular architecture, and best practices built-in.
β¨ What Makes This Special?
create-codehuddle-nextjs is not just another Next.js starter template. It's a modular, interactive CLI tool that lets you build exactly what you need, when you need it. Choose your authentication, payments, features, and more through an intuitive command-line interface.
π― Interactive Project Generation
npx create-codehuddle-nextjs my-app
# β¨ Interactive prompts guide you through:
# π Authentication: NextAuth.js, Supabase, or None
# π³ Payments: One-time, Subscriptions, or None
# π Dashboard: Include analytics dashboard
# π± PWA: Progressive Web App features
# π Storybook: Component development
# π³ Docker: Containerization
# π Sentry: Error monitoring
# π Dark Mode: Theme switchingπ Quick Start
Prerequisites
- Node.js >= 20.0.0
- npm, yarn, or pnpm
Complete CLI Flow
Run the command and follow the interactive prompts:
npx create-codehuddle-nextjs my-awesome-appHere's the complete interactive flow you'll experience:
π Welcome to create-codehuddle-nextjs!
Let's create your modern Next.js application
π Choose your authentication provider:
β― NextAuth.js - Complete auth with OAuth providers
Supabase Auth - Real-time auth with database
None - Add authentication later
π₯ Enable Role-Based Authentication (Admin/User roles)?
β― No
π Enable dark mode toggle in your app?
β― Yes
π³ Choose your Stripe integration:
β― None - Add payments later
One-time payments - Single payments and purchases
Subscriptions - Recurring billing and subscriptions
π© Include Email module (Nodemailer) for transactional emails?
β― Yes
π Include a Dashboard page (graphs, tables, stats)?
β― Yes
π Include Storybook for UI component development?
β― Yes
π± Include PWA (Progressive Web App) support?
β― Yes
π³ Include Docker configuration for containerization?
β― Yes
π Include Sentry for error monitoring and performance tracking?
β― Yes
π Creating project in 'my-awesome-app'...
π Project created successfully!
π Configuration Summary:
π Auth: NextAuth
π³ Payments: None
π© Email: Enabled
π Dashboard: Enabled
π± PWA: Enabled
π Storybook: Enabled
π³ Docker: Enabled
π Sentry: Enabled
π Dark Mode: Enabled
π Next Steps:
cd my-awesome-app
npm install
cp .env.example .env.local
# Configure environment variables in .env.local
npm run dev
π‘ Tip: Visit http://localhost:3000 to see your app!
Made with π by CodeHuddle
Lets build the future together!β‘Setup & Run
cd my-awesome-app
npm install
cp .env.example .env.local
npm run devπ That's it! Visit http://localhost:3000 to see your application.
ποΈ Architecture & Features
π Modular Authentication System
Choose from multiple authentication providers, each with complete implementations:
| Provider | Features | Best For | |----------|----------|----------| | NextAuth.js | OAuth, credentials, session management | Full-featured apps with multiple providers | | Supabase | Real-time auth, database integration | Modern apps with real-time features | | Supabase + Roles | Role-based access control (Admin/User) | Enterprise applications | | None | No authentication | Simple apps or custom auth later |
Example CLI Flow:
π Choose your authentication provider:
β― NextAuth.js - Complete auth with OAuth providers
Supabase Auth - Real-time auth with database
None - Add authentication laterπ³ Flexible Payment Integration
Integrated Stripe payments with complete flows:
| Integration | Features | Pages Included |
|-------------|----------|----------------|
| One-time Payments | Single payments, purchases | /test-payment, /payment/success, /payment/cancel |
| Subscriptions | Recurring billing, subscription management | /test-subscription, /payment/success, /payment/cancel |
| None | No payment integration | - |
Interactive Landing Page: When you select Stripe integration, your landing page automatically includes clickable links to test payment functionality.
π Optional Dashboard Module
Modern analytics dashboard with:
- KPI Cards with metrics and trends
- Interactive Charts using Recharts
- Activity Timeline for user actions
- Sales Table with data visualization
- Responsive Design with sidebar navigation
π± Progressive Web App (PWA)
Complete PWA implementation:
- Web App Manifest for app-like experience
- Service Worker for offline functionality
- Install Prompt component for app installation
- Offline Support with caching strategies
π Storybook Integration
Component development environment:
- Pre-configured Storybook setup
- Component Stories for UI development
- Interactive Documentation for your design system
- Visual Testing capabilities
π³ Docker Containerization
Production-ready containerization:
- Multi-stage Build for optimized images
- Development Environment with hot reloading
- Production Configuration for deployment
- Generic Templates - easily customizable
π Sentry Error Monitoring
Comprehensive error tracking and performance monitoring:
- Error Tracking with automatic error capture
- Performance Monitoring for optimization insights
- Source Maps for detailed stack traces
- Session Replay for debugging user interactions
- Custom Configuration - easily customizable
π Smart Dark Mode
Intelligent theme system:
- System Preference Detection
- localStorage Persistence
- Smooth Transitions with CSS variables
- Conditional Inclusion - only adds toggle if enabled
π οΈ Technology Stack
Core Framework
- Next.js 15 - Latest React framework with App Router
- React 19 - Latest React with concurrent features
- TypeScript - Full type safety
- Tailwind CSS v4 - Utility-first styling
UI & Components
- shadcn/ui - Beautiful, accessible components
- Radix UI - Low-level UI primitives
- Lucide React - Beautiful icon library
- Class Variance Authority - Component variants
State Management
- Zustand - Lightweight state management
- TanStack Query - Server state management
- React Hook Form - Performant forms
- Zod - TypeScript-first validation
Development Tools
- Vitest - Fast unit testing
- Playwright - E2E testing
- ESLint - Code linting
- Prettier - Code formatting
- Husky - Git hooks
- Commitizen - Conventional commits
Production Ready
- Bundle Analysis with @next/bundle-analyzer
- Docker configuration
- CI/CD templates
- SEO Optimization
- Performance Monitoring ready
π Project Structure
my-awesome-app/
βββ src/
β βββ app/ # Next.js App Router
β β βββ [locale]/ # Internationalization
β β β βββ (auth)/ # Authentication routes
β β β β βββ sign-in/ # Sign in pages
β β β β βββ sign-up/ # Sign up pages
β β β β βββ dashboard/ # Dashboard (if enabled)
β β β β βββ admin/ # Admin routes (Supabase Roles)
β β β β βββ user/ # User routes (Supabase Roles)
β β β βββ test-payment/ # Stripe test pages
β β β βββ test-subscription/ # Subscription test
β β β βββ test-email/ # Email testing
β β βββ api/ # API routes
β βββ components/ # Reusable components
β β βββ ui/ # shadcn/ui components
β β βββ auth/ # Authentication components
β β βββ dashboard/ # Dashboard components
β βββ lib/ # Utility libraries
β βββ hooks/ # Custom React hooks
β βββ stores/ # Zustand stores
β βββ types/ # TypeScript definitions
β βββ validations/ # Zod schemas
β βββ locales/ # Translation files
βββ public/ # Static assets
βββ tests/ # Test files
βββ .storybook/ # Storybook configuration
βββ docs/ # Documentationπ― Available Scripts
| Script | Description |
|--------|-------------|
| npm run dev | Start development server with Turbo |
| npm run build | Build for production |
| npm run start | Start production server |
| npm run lint | Run ESLint |
| npm run lint:fix | Fix ESLint errors |
| npm run test | Run unit tests with Vitest |
| npm run test:e2e | Run E2E tests with Playwright |
| npm run storybook | Start Storybook development |
| npm run generate:component | Generate new component |
| npm run build-stats | Build with bundle analysis |
π Internationalization
Built-in i18n support with next-intl:
- Multiple Languages - English, French, and more
- Locale-based Routing -
/en/,/fr/paths - Dynamic Translations - Server and client components
- SEO-friendly - Proper meta tags per locale
π§ͺ Testing Strategy
Comprehensive testing setup:
Unit Testing (Vitest)
npm run test
# Fast unit tests with React Testing LibraryE2E Testing (Playwright)
npm run test:e2e
# End-to-end testing across browsersComponent Testing (Storybook)
npm run storybook
# Visual component development and testingπ§ Configuration Examples
Environment Variables
The CLI automatically generates .env.example with the right variables for your selected modules:
# Authentication (NextAuth.js)
NEXTAUTH_SECRET=your-secret-here
NEXTAUTH_URL=http://localhost:3000
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
# Stripe
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
# Email (Nodemailer)
RESEND_API_KEY=re_...π Production Deployment
Vercel (Recommended)
# Deploy to Vercel
npx vercel
# Set environment variables in Vercel dashboardDocker
# Build Docker image
docker build -t my-app .
# Run container
docker run -p 3000:3000 my-appOther Platforms
- Netlify - Static site generation
- Railway - Full-stack deployment
- AWS - Container deployment
- DigitalOcean - App Platform
π€ Contributing
We welcome contributions! Please see our Contributing Guide for details.
π License
This project is licensed under the ISC License - see the LICENSE file for details.
π₯ Developers
Meet the team behind create-codehuddle-nextjs:
π Acknowledgments
- Next.js Team - For the amazing framework
- Vercel - For hosting and deployment
- shadcn/ui - For beautiful components
- Radix UI - For accessible primitives
- Tailwind CSS - For utility-first styling
π Made with β₯ by CodeHuddle
π Happy coding β’ Join our amazing community!
β Star us on GitHub β’ π¦ NPM Package β’ π¦ Follow us
