A production-ready Next.js 15 starter template with TypeScript, featuring a modern development stack with state management, API handling, and comprehensive tooling setup.
- β‘ Next.js 15 with App Router
- π· TypeScript for type safety
- π¨ Tailwind CSS v4 for styling
- π§© shadcn/ui components with Radix UI primitives
- π Redux Toolkit for state management
- π TanStack Query (React Query) for server state management
- π TanStack Table for data tables
- π Axios with interceptors for API calls
- β Zod for schema validation
- π¦ Lucide React for icons
- π§ ESLint & Prettier for code quality
- π Husky for Git hooks
- Next.js - React framework with App Router
- React - UI library
- TypeScript - Type safety
- Tailwind CSS v4 - Utility-first CSS framework
- shadcn/ui - Reusable UI components
- Redux Toolkit - State management
- React Redux - React bindings for Redux
- TanStack Query - Server state management
- Axios - HTTP client with interceptors
- Zod - Schema validation
- TanStack Table - Data tables
- ESLint - Code linting
- Prettier - Code formatting
- Husky - Git hooks
- lint-staged - Run linters on staged files
next-ts/
βββ public/ # Static assets
βββ src/
β βββ app/ # Next.js App Router
β β βββ favicon.ico
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β βββ components/ # Reusable components
β β βββ ui/ # shadcn/ui components
β β βββ button.tsx
β βββ config/ # App configuration
β β βββ index.ts # Environment variables & constants
β βββ lib/ # Utilities & configurations
β β βββ axios.ts # Axios setup with interceptors
β β βββ utils.ts # Utility functions
β βββ provider/ # Context providers
β β βββ app.tsx # App provider
β β βββ index.tsx # Combined providers
β β βββ query.tsx # TanStack Query provider
β β βββ store.tsx # Redux store provider
β βββ schemas/ # Zod validation schemas
β β βββ user.ts # User schema
β βββ services/ # API service layer
β β βββ user.ts # User API services
β βββ store/ # Redux store setup
β βββ index.ts # Store configuration
β βββ slice/ # Redux slices
β βββ user.ts # User slice
βββ .gitignore # Git ignore rules
βββ .husky/ # Husky Git hooks
β βββ pre-commit # Pre-commit hook
βββ .prettierignore # Prettier ignore rules
βββ .prettierrc # Prettier configuration
βββ components.json # shadcn/ui configuration
βββ eslint.config.mjs # ESLint configuration
βββ next.config.ts # Next.js configuration
βββ package.json # Dependencies & scripts
βββ postcss.config.mjs # PostCSS configuration
βββ tailwind.config.ts # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
- Node.js 22+
- npm, yarn, or pnpm
-
Clone the repository
git clone https://github.com/dvsxdev/next-ts.git cd next-ts
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Set up environment variables Copy
.env.example
to.env
and update the values:NEXT_PUBLIC_APP_NAME=Your App Name NEXT_PUBLIC_API_URL=http://127.0.0.1:8000
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
Script | Description |
---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run start |
Start production server |
npm run lint:check |
Check for linting errors |
npm run lint:fix |
Fix linting errors |
npm run format:check |
Check code formatting |
npm run format:fix |
Fix code formatting |
npm run prepare |
Set up Husky Git hooks |
- Path mapping configured for
@/*
imports - Strict mode enabled
- Modern ES2017 target
- Next.js core web vitals rules
- TypeScript support
- TanStack Query plugin for best practices
- Consistent code formatting
- Integrated with lint-staged
- Tailwind CSS v4
- PostCSS integration
- shadcn/ui compatible
- React Server Components support
- Lucide icons
- Gray base color with CSS variables
- Redux Toolkit: Global state management with user slice
- TanStack Query: Server state, caching, and synchronization
- Axios Configuration: Pre-configured with base URL and interceptors
- Authentication: Automatic token attachment and 401 handling
- Cookie Management: Secure token storage
- Zod Schemas: Runtime validation with TypeScript inference
- TypeScript: Comprehensive type coverage
- Husky: Pre-commit hooks for code quality
- lint-staged: Run linters only on changed files
- ESLint + Prettier: Consistent code style
- shadcn/ui: Copy-paste component system
- Radix UI: Accessible, unstyled components
- Tailwind CSS: Utility-first styling
- Feature Development: Create components in
src/components/
- State Management: Add slices in
src/store/slice/
- API Services: Define services in
src/services/
- Validation: Create schemas in
src/schemas/
- Styling: Use Tailwind classes and shadcn/ui components
npx shadcn@latest add [component-name]
# Lucide icons are included
import { IconName } from "lucide-react"
``
## π License
This project is licensed under the MIT License.