Skip to content
/ next-starter Public template

πŸš€ Production-ready Next.js starter template supercharged with modern tech stack. ⚑️ Zero configuration. Just clone and code.

License

Notifications You must be signed in to change notification settings

frshaad/next-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Next.js Enterprise Template

Modern, Production-ready template powered by Next.js 15 and React 19

✨ Key Technologies

πŸ”’ Environment Variables

This template uses type-safe environment variables with Zod validation.

Required Environment Variables

# .env.local
NODE_ENV=development
DB_HOST=localhost
DB_USER=your_db_user
DB_PASSWORD=your_password
DB_NAME=your_db_name
DB_PORT=5432
DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}

Environment Schema (Zod)

export const envSchema = z.object({
  NODE_ENV: z.enum(['development', 'production']),
  DB_HOST: z.string(),
  DB_USER: z.string(),
  DB_PASSWORD: z.string(),
  DB_NAME: z.string(),
  DB_PORT: z.coerce.number(),
  DATABASE_URL: z.string().url(),
  DB_MIGRATING: z
    .string()
    .refine((s) => s === 'true' || s === 'false')
    .transform((s) => s === 'true')
    .optional(),
});

πŸ“¦ Getting Started

  1. Clone & create your project:
git clone https://github.com/frshaad/next-starter.git my-project
cd my-project
pnpm install
  1. Set up environment variables:
cp .env.example .env.local
  1. Initialize database:
pnpm db:generate   # Generate migrations
pnpm db:push      # Push schema to database
pnpm db:studio    # (Optional) Open Drizzle Studio
  1. Start development server:
pnpm dev

πŸ›  Available Scripts

pnpm dev          # Start development server
pnpm build        # Build production application
pnpm start        # Start production server
pnpm lint         # Lint code with ESLint
pnpm format       # Format code with Prettier
pnpm db:generate  # Generate Drizzle migrations
pnpm db:push      # Push migrations to database
pnpm db:studio    # Open Drizzle Studio

πŸ“ Project Structure

.
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/              # Next.js app router pages
β”‚   β”œβ”€β”€ components/       # React components
β”‚   β”‚   β”œβ”€β”€ ui/          # Shadcn UI components
β”‚   β”‚   └── shared/      # Shared components
β”‚   └── lib/             # Utility functions
β”‚       β”œβ”€β”€ db/          # Database configuration
β”‚       β”œβ”€β”€ env/         # Environment validation
β”‚       └── utils/       # Helper functions
β”œβ”€β”€ drizzle/             # Database migrations
β”œβ”€β”€ public/              # Static assets
└── types/              # TypeScript types

πŸš€ Deployment

Vercel (Recommended)

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

πŸ“„ License

MIT License - See LICENSE.md

About

πŸš€ Production-ready Next.js starter template supercharged with modern tech stack. ⚑️ Zero configuration. Just clone and code.

Topics

Resources

License

Stars

Watchers

Forks