Production-ready template for building modern fullstack web applications with Next.js 14, React 18, TypeScript, Prisma ORM, and PostgreSQL.
Next Starter is a comprehensive web application template that combines modern frontend with backend capabilities:
- Frontend: Next.js 14 (Pages Router) + React 18 + TypeScript with Tailwind CSS & Shadcn/UI components
- Backend: Built-in API routes for server-side logic and database operations
- Database: Prisma ORM + PostgreSQL for robust data management
- State Management: Zustand for client state, TanStack Query for server state
- Forms: React Hook Form + Zod for form handling and validation
- Internationalization: i18next for multi-language support
- Animations: Framer Motion for smooth user interactions
Use this starter for:
- Fullstack web applications with server-side rendering
- Rapid prototyping and MVP development
- Teams wanting React ecosystem best practices built-in
| Concern | Package |
|---|---|
| Framework | Next.js 14 (Pages Router) + React 18 + TypeScript |
| Styling | Tailwind CSS + Shadcn/UI |
| Server State | TanStack Query (@tanstack/react-query) |
| Client State | Zustand |
| Forms | React Hook Form + Zod |
| ORM | Prisma |
| Database Driver | PostgreSQL (pg) |
| Internationalization | i18next + react-i18next |
| Animations | Framer Motion |
| Icons | Lucide React |
| Node Version | v20+ |
- Node.js: v20 or higher
- npm: v10+ or yarn/pnpm
- PostgreSQL: v12+ (local or cloud)
- Git: for version control
git clone <repository-url>
cd next-starternpm installNote: Database migration runs automatically via postinstall script.
Copy environment example file and adjust for your local configuration:
cp .env.example .env.localEdit .env.local with your values:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/next_starter"
# Authentication
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key-here"Generate
NEXTAUTH_SECRETusing:openssl rand -base64 32
npx prisma db push
npx prisma generatenpm run devOpen http://localhost:3000 to view the application.
src/
├── pages/ # Next.js Pages Router
│ ├── _app.tsx # App wrapper (TanStack Query provider)
│ ├── _document.tsx # HTML document setup
│ └── index.tsx # Home page
├── features/
│ └── {featureName}/
│ ├── types/ # TypeScript interfaces & types
│ ├── states/ # Zustand stores
│ ├── services/ # API call functions
│ ├── controllers/ # TanStack Query hooks
│ └── components/ # React components
├── shared/
│ ├── lib/
│ │ ├── prisma.ts # Prisma client singleton
│ │ └── utils.ts # cn() utility & helper functions
│ ├── styles/
│ │ └── globals.css # Tailwind base & CSS variables
│ └── locales/
│ ├── en.json # English translations
│ └── id.json # Indonesian translations
└── public/ # Static files
| Script | Description |
|---|---|
npm run dev |
Start development server with hot-reload |
npm run build |
Build for production |
npm run start |
Start production server |
npm run lint |
Run ESLint |
npm run type-check |
Run TypeScript type checking |
npm run db:push |
Push Prisma schema to database (prototyping) |
npm run db:studio |
Open Prisma Studio (database GUI) |
Complete documentation for architecture, naming conventions, and best practices is available in CODE.md.
Key Topics:
- Naming conventions (functions, files, folders)
- Layer structure (Types, States, Services, Controllers, Components)
- React component best practices
- TanStack Query (React Query) patterns
- Zustand store management
- Zod validation schema
- API integration patterns
- Fork this repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m 'feat: add your feature' - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request
MIT License - see LICENSE file for details.
Developed by Dzikri Alan's Team