A comprehensive Next.js boilerplate with TypeScript, Tailwind CSS, authentication, and AI integration foundations. Perfect for building modern AI-powered applications.
- Next.js 14 with App Router
- TypeScript for type safety
- Tailwind CSS for styling
- 40+ shadcn/ui components pre-configured
- SWR for data fetching
- Responsive design patterns
- Role-based authentication (User/Admin)
- Password-protected access
- localStorage session management
- Protected route patterns
- Clean login/logout flow
- Complete shadcn/ui component library
- Professional header/footer
- Tool card layout system
- Loading states and error handling
- Customizable themes and colors
- ESLint with comprehensive rules
- Prettier code formatting
- Husky pre-commit hooks
- TypeScript strict mode
- Quality gates (lint, format, type-check)
- Anthropic AI SDK setup
- Puppeteer for PDF generation
- Markdown Editor integration
- Icon libraries (Lucide, Phosphor)
- File handling utilities
- Node.js 18.0 or later
- npm or yarn package manager
-
Clone or download this boilerplate
git clone <your-repo-url> my-ai-app cd my-ai-app
-
Install dependencies
npm install
-
Set up environment variables
cp .env.local.example .env.local
Edit
.env.local
with your configuration. -
Start development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000
Create .env.local
with these variables:
# Authentication passwords
APP_PASSWORD=your_user_password
ADMIN_PASSWORD=your_admin_password
# AI API Keys (optional)
ANTHROPIC_API_KEY=your_anthropic_key
# Add your other API keys here
- Update
src/app/layout.tsx
metadata - Replace favicon files in
public/
- Modify header branding in
src/components/Header.tsx
- Customize Tailwind config in
tailwind.config.ts
- Update CSS variables in
src/app/globals.css
- Modify component themes in tool sections
Edit the tool definitions in src/app/page.tsx
:
const dataTools = [
{
title: "Your Tool Name",
description: "Tool description",
href: "/your-tool-route",
comingSoon: false,
},
];
βββ public/ # Static assets
βββ src/
β βββ app/ # Next.js App Router
β β βββ api/ # API routes
β β β βββ health-check/
β β β βββ verify-password/
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β β βββ not-found.tsx # 404 page
β β βββ page.tsx # Home page
β βββ components/ # React components
β β βββ ui/ # shadcn/ui components
β β βββ Header.tsx # Navigation header
β β βββ ToolCard.tsx # Tool card component
β β βββ ToolSection.tsx # Tool section wrapper
β βββ lib/
β βββ utils.ts # Utility functions
βββ .eslintrc.json # ESLint configuration
βββ .husky/ # Git hooks
βββ components.json # shadcn/ui configuration
βββ next.config.mjs # Next.js configuration
βββ package.json # Dependencies
βββ tailwind.config.ts # Tailwind configuration
βββ tsconfig.json # TypeScript configuration
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint errors
npm run format # Format code with Prettier
npm run type-check # Run TypeScript checker
npm run quality # Run all quality checks
- Create a new file in
src/app/your-page/page.tsx
- Add authentication wrapper if needed
- Update navigation or tool links
- Create
src/app/api/your-endpoint/route.ts
- Implement GET, POST, etc. handlers
- Add error handling and validation
- Create component in
src/components/
- Use existing shadcn/ui components
- Follow TypeScript patterns
- Add to exports if reusable
- Connect your repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push
- Build the application:
npm run build
- Deploy the
.next
folder andpublic/
directory - Ensure Node.js runtime is available
- Set environment variables
Update these CSS variables in globals.css
:
:root {
--primary: 221 83% 53%; /* Blue */
--secondary: 210 40% 98%;
/* Add your brand colors */
}
Modify theme configurations in components:
const themeColors = {
blue: { bg: "from-blue-50", accent: "text-blue-600" },
// Add your themes
};
- Define tools array in
page.tsx
- Add new theme to
ToolSection.tsx
- Create corresponding pages/routes
- Passwords are verified server-side only
- No sensitive data in client-side code
- Environment variables for configuration
- HTTPS recommended for production
- Regular dependency updates recommended
- Fork the repository
- Create a feature branch
- Make your changes
- Run quality checks:
npm run quality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For questions and support:
- Check the Next.js documentation
- Review Tailwind CSS docs
- Explore shadcn/ui components
After setting up the boilerplate:
- Customize branding and colors
- Add your specific tool implementations
- Integrate your preferred AI services
- Deploy to your hosting platform
- Build amazing AI-powered applications!
Happy coding! π