A modern, minimal Next.js 15 starter template with Motion animations, Zustand state management, Tailwind CSS v4, and TypeScript. Production-ready with built-in dark mode, engineering best practices, and automatic deployment.
Language: δΈζζζ‘£ | English
- π Next.js 15: Latest React framework with App Router and Turbopack
- π¨ Tailwind CSS v4: Next-generation utility-first CSS framework
- π» Zustand: Lightweight and scalable state management
- π Motion: Performant animations with declarative API
- π Dark Mode: Seamless theme switching with system preference support
- π TypeScript: Full type safety with strict mode enabled
- π οΈ Engineering Tools: ESLint, Prettier, Husky, lint-staged, and Commitlint
- π GitHub Actions: Automated deployment to GitHub Pages
- π¦ clsx: Conditional className utility for cleaner component code
This template provides a minimal, production-ready foundation rather than a bloated framework. It includes only the essentials, allowing you to:
- Add your preferred UI component library (shadcn/ui, Ant Design, Material-UI, etc.)
- Integrate any database solution (Prisma, Drizzle, Supabase, etc.)
- Implement authentication (NextAuth, Clerk, Auth0, etc.)
- Scale with your own backend architecture
- Node.js 18+
- pnpm (recommended) or npm/yarn
# Clone the repository
git clone https://github.com/crper/next-modern-starter.git
cd next-modern-starter
# Install dependencies
pnpm install
# Start development server with Turbopack
pnpm devOpen http://localhost:3000 to see your app.
Push to the main or master branch to automatically deploy via GitHub Actions:
- Enable GitHub Pages in your repository settings
- Set source to "GitHub Actions"
- Push your code - deployment happens automatically
Click the "Deploy with Vercel" button above or:
npx vercelThis template works with any platform that supports Next.js:
- Netlify
- Railway
- Render
- AWS Amplify
βββ .github/
β βββ workflows/
β βββ deploy.yml # GitHub Pages deployment
βββ public/ # Static assets
β βββ images/ # Optimized images
βββ src/
β βββ app/ # Next.js App Router
β β βββ layout.tsx # Root layout with providers
β β βββ page.tsx # Home page
β β βββ globals.css # Global styles and Tailwind
β βββ components/ # React components
β β βββ Counter.tsx # Counter demo with Zustand
β β βββ TodoList.tsx # Todo demo with animations
β β βββ ThemeToggle.tsx # Theme switcher
β β βββ ThemeProvider.tsx # Theme context provider
β βββ store/ # Zustand stores
β βββ index.ts # Global state management
βββ eslint.config.mjs # ESLint flat config
βββ next.config.ts # Next.js configuration
βββ tailwind.config.ts # Tailwind CSS v4 config
βββ tsconfig.json # TypeScript configuration
- Configuration via CSS
@configdirective - Automatic dark mode with
dark:variants - Custom theme variables in
globals.css - Optimized for performance
Powered by next-themes with:
- System preference detection
- Manual theme switching
- No flash on load
- Persistent selection
- CSS variables for theming
// Conditional classes
className={clsx(
'base-class',
{
'active-class': isActive,
'error-class': hasError,
}
)}
// Multiple conditions
className={clsx(
'text-sm font-medium',
isLarge && 'text-lg',
color === 'primary' && 'text-blue-600'
)}pnpm dev- Start development server with Turbopackpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLintpnpm type-check- Check TypeScript types
Zustand stores with TypeScript:
// Counter store example
const { count, increment, decrement } = useCounterStore();
// Task store with persistence
const { tasks, addTask, toggleTask } = useTaskStore();Features:
- Redux DevTools integration
- Persistence middleware
- TypeScript autocompletion
- Minimal boilerplate
Motion (Framer Motion) integration:
// Simple animation
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5 }}
>
Content
</motion.div>
// With AnimatePresence
<AnimatePresence mode="wait">
{items.map(item => (
<motion.div key={item.id} exit={{ opacity: 0 }}>
{item.content}
</motion.div>
))}
</AnimatePresence>Follow Conventional Commits:
feat:New featuresfix:Bug fixesdocs:Documentation changesstyle:Code style changesrefactor:Code refactoringtest:Test updateschore:Maintenance tasks
- ESLint with Next.js recommended rules
- Prettier for consistent formatting
- Husky for pre-commit hooks
- TypeScript strict mode
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see the LICENSE file for details.
- Next.js - The React framework
- Motion - Animation library
- Zustand - State management
- Tailwind CSS - CSS framework
- next-themes - Theme management
Happy coding! π