Skip to content

bustakar/next-easy

Repository files navigation

Next Easy πŸš€

A production-ready Next.js starter template with authentication, database, payments, and beautiful UI components. Build your SaaS faster with batteries included.

Features ✨

  • ⚑ Next.js 15 - App Router, Server Components, and Turbopack
  • πŸ” Better Auth - Modern authentication with magic links, OAuth, and sessions
  • πŸ—„οΈ Drizzle ORM + PostgreSQL - Type-safe database with migrations
  • πŸ’³ Stripe Integration - Subscriptions and payment handling ready
  • 🎨 shadcn/ui - Beautiful, accessible components built with Radix UI
  • πŸ“§ Resend - Transactional emails with React Email templates
  • 🎭 Motion - Smooth animations and transitions
  • πŸŒ— Dark Mode - Built-in theme support
  • πŸ“± Responsive - Mobile-first design
  • πŸ”’ Type-Safe - Full TypeScript coverage

Tech Stack πŸ› οΈ

  • Framework: Next.js 15
  • Language: TypeScript
  • Database: PostgreSQL with Drizzle ORM
  • Authentication: Better Auth
  • Payments: Stripe
  • Styling: Tailwind CSS 4
  • UI Components: shadcn/ui + Radix UI
  • Email: Resend + React Email
  • Animations: Motion (Framer Motion)

Quick Start πŸƒ

1. Clone and Install

git clone <your-repo-url>
cd next-easy
npm install

2. Environment Setup

Create a .env file:

# Database
DATABASE_URL="postgresql://user:password@localhost:5432/dbname"

# Better Auth
BETTER_AUTH_SECRET="your-secret-key-here"
BETTER_AUTH_URL="http://localhost:3000"

# Stripe
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."

# Email
RESEND_API_KEY="re_..."
EMAIL_FROM="Your App <noreply@yourdomain.com>"

3. Database Setup

# Push schema to database
npm run db:push

# Or generate and run migrations
npm run db:generate
npm run db:migrate

# Open Drizzle Studio to view your data
npm run db:studio

4. Run Development Server

npm run dev

Open http://localhost:3000 to see your app.

Project Structure πŸ“

next-easy/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                      # Next.js app router
β”‚   β”‚   β”œβ”€β”€ components/           # Landing page components
β”‚   β”‚   β”œβ”€β”€ dashboard/            # Dashboard pages
β”‚   β”‚   β”œβ”€β”€ api/                  # API routes
β”‚   β”‚   └── page.tsx              # Home page
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ ui/                   # shadcn/ui components
β”‚   β”‚   └── email/                # Email templates
β”‚   β”œβ”€β”€ db/
β”‚   β”‚   β”œβ”€β”€ schema.ts             # Drizzle schema
β”‚   β”‚   └── migrate.ts            # Migration runner
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ db.ts                 # Database client
β”‚   β”‚   β”œβ”€β”€ auth.ts               # Auth configuration
β”‚   β”‚   β”œβ”€β”€ auth-client.ts        # Client-side auth
β”‚   β”‚   β”œβ”€β”€ email.ts              # Email utilities
β”‚   β”‚   └── utils.ts              # Helper functions
β”‚   └── hooks/                    # Custom React hooks
β”œβ”€β”€ drizzle/                      # Generated migrations
β”œβ”€β”€ drizzle.config.ts             # Drizzle configuration
└── DATABASE.md                   # Database documentation

Documentation πŸ“š

Available Scripts πŸ“

# Development
npm run dev              # Start dev server with Turbopack
npm run build            # Build for production
npm run start            # Start production server
npm run lint             # Run ESLint

# Database
npm run db:generate      # Generate migration files
npm run db:migrate       # Run migrations
npm run db:push          # Push schema (dev only)
npm run db:studio        # Open Drizzle Studio

Features in Detail πŸ”

Authentication

  • Magic link (passwordless) authentication
  • Secure session management

Database

  • Type-safe queries with Drizzle ORM
  • PostgreSQL with full schema
  • Automatic migrations
  • User, session, and subscription tables
  • Visual database browser (Drizzle Studio)

Payments

  • Stripe integration ready
  • Subscription management tables
  • Payment history tracking
  • Webhook endpoint structure

UI Components

  • Pre-built landing page
  • Dashboard layout with sidebar
  • Responsive navigation
  • Animated components
  • Form components
  • Card layouts
  • Buttons, inputs, and more

Email

  • Magic link emails
  • React-based templates
  • Resend integration
  • Easy to customize

Deployment πŸš€

Vercel (Recommended)

  1. Push your code to GitHub
  2. Import project to Vercel
  3. Add environment variables
  4. Deploy!

Database Hosting

Recommended PostgreSQL providers:

Customization 🎨

Branding

Update the logo and branding in:

  • src/app/components/logo.tsx
  • src/app/layout.tsx (metadata)
  • Email templates

Styling

  • Tailwind config: tailwind.config.js
  • Global styles: src/app/globals.css
  • Theme colors: Update CSS variables

Landing Page

Edit components in src/app/components/:

  • hero-section.tsx - Hero with CTA
  • features-1.tsx - Feature showcase
  • pricing.tsx - Pricing tiers
  • call-to-action.tsx - Final CTA
  • footer.tsx - Footer with links

Contributing 🀝

Contributions are welcome! Please feel free to submit a Pull Request.

License πŸ“„

MIT License - feel free to use this template for your projects!

Support πŸ’¬


Built with ❀️ using Next.js and modern web technologies.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors