create-can-stack
v0.0.1
Published
CLI tool to create new Can Stack projects with Next.js, Better Auth, Drizzle ORM, and more
Maintainers
Readme
create-can-stack
A CLI tool to quickly scaffold a full-stack Next.js application with modern tools and best practices.
Features
The generated project includes:
- ⚡️ Next.js 16 - React 19 with App Router and Turbopack
- 🔐 Better Auth - Type-safe authentication
- 🗄️ Drizzle ORM - Type-safe database ORM with PostgreSQL
- 🎨 shadcn/ui - Beautiful, accessible UI components
- 🎭 Tailwind CSS - Utility-first CSS framework
- 📧 Resend - Email service with React Email templates
- 🔌 oRPC - Type-safe RPC framework
- 📦 Turborepo - High-performance monorepo build system
- 🎯 TypeScript - Full type safety across the stack
Usage
Create a new project with:
# Using npm
npm create can-stack@latest
# Using pnpm
pnpm create can-stack
# Using yarn
yarn create can-stack
# With project name
npm create can-stack@latest my-appGetting Started
After creating your project:
# Navigate to your project
cd my-app
# Install dependencies
pnpm install
# Set up environment variables
cp .env.example .env
# Edit .env with your database URL and API keys
# Generate database schema
pnpm db:generate
# Start development server
pnpm devOpen http://localhost:3000 in your browser.
Project Structure
my-app/
├── apps/
│ └── app/ # Next.js application
├── packages/
│ ├── auth/ # Better Auth configuration
│ ├── db/ # Drizzle ORM database
│ ├── rpc/ # oRPC API routes
│ ├── transactional/ # Email templates
│ ├── ui/ # shadcn/ui components
│ ├── eslint-config/ # Shared ESLint config
│ └── typescript-config/# Shared TypeScript config
├── package.json # Root workspace config
├── pnpm-workspace.yaml # Workspace definition
└── turbo.json # Turborepo configurationAvailable Commands
# Development
pnpm dev # Start dev server
pnpm build # Build for production
pnpm start # Start production server
# Database
pnpm db:generate # Generate migrations
pnpm db:migrate # Run migrations
pnpm db:studio # Open Drizzle Studio
# Code Quality
pnpm lint # Run ESLint
pnpm typecheck # Run TypeScript checksEnvironment Variables
Required environment variables:
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/db
# Authentication
AUTH_SECRET=your-secret-here
AUTH_URL=http://localhost:3000
# Email (Resend)
RESEND_API_KEY=re_xxxxTech Stack Details
- Framework: Next.js 16 with React 19
- Authentication: Better Auth
- Database: PostgreSQL with Drizzle ORM (Neon Serverless)
- Styling: Tailwind CSS 4.x
- UI Components: shadcn/ui (Radix UI + CVA)
- API: oRPC for type-safe API calls
- Email: Resend with React Email templates
- Build Tool: Turborepo
- Package Manager: pnpm
Roadmap
- [ ] Payment integration (Stripe/Polar)
- [ ] Additional auth providers (OAuth)
- [ ] Alternative email providers
- [ ] Database provider options
- [ ] Deployment configurations
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
