=20.0.0-61DAFB?style=flat&logo=node.js title="Node" loading="lazy" />
A modern, production-ready template for building fast and maintainable web applications. This template combines the power of Next.js for server-side rendering and static site generation, Tailwind CSS for rapid UI development, and TypeScript for enhanced code quality and developer experience. Features include:
⨠Modern Stack: Built with Next.js 15, React 19, and TypeScript 5
šØ Styling: Tailwind CSS with SASS support and a responsive grid system
š ļø Developer Experience: Comprehensive VS Code setup with ESLint and Prettier
š± Responsive Design: Mobile-first approach with customizable breakpoints
š Performance: Optimized build configuration for maximum performance
š§ Tooling: Pre-configured development tools and scripts
=20.0.0-61DAFB?style=flat&logo=node.js title="Node.js" loading="lazy" />
=1.22.0-F7740D?style=flat&logo=yarn title="Yarn" loading="lazy" />
git clone [email protected]:CFsylvester/next.js-tailwind-typescript-TEMPLATE.git [your-repo-name]
cd [your-repo-name]
# Set Node.js version (if using nvm)
nvm use
yarn install
yarn dev
Open http://localhost:3000 with your browser to see the result.
When you first open this project in VS Code, you'll automatically be prompted to install the recommended extensions in the bottom right corner. You can also install all recommended extensions at once:
Cmd/Ctrl + Shift + P
This project includes a .vscode
folder with shared settings for VS Code users. These settings will:
These settings ensure that:
This project uses:
.nvmrc
for Node.js version management (currently set to v20)engines
in package.json to enforce Node.js (>=20.0.0) and Yarn (>=1.22.0) versionspackageManager
field in package.json to specify exact Yarn version (1.22.22)To automatically use the correct Node.js version:
nvm use
in the project directoryThe project is configured to use Yarn 1.22.22. When you run yarn install
, it will verify that you're using a compatible version of Yarn. If you have an incompatible version, Yarn will show an error message indicating which version you need to use.
Core styling configuration files:
tailwind.config.js - Configuration including:
src/styles/globals.scss - Global styles including:
- Automatically adds vendor prefixes to CSS rules
- Linting utility for JavaScript and TypeScript
- Code formatter for consistent code style
yarn dev
- Run development serveryarn build
- Build for productionyarn start
- Start production serveryarn lint
- Run ESLintyarn lint:fix
- Fix ESLint errorsyarn format
- Format code with Prettieryarn check-format
- Check code formattingIn your repository settings, go to Settings > Pages
Under Build and deployment:
main
and /root
for serving from repository rootmain
and /docs
if using a docs folderCreate (or update) .github/workflows/deploy.yml
:
name: Deploy to GitHub Pages
on:
push:
branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: out
next.config.js
:/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export', // Enable static exports
basePath: process.env.NODE_ENV === 'production' ? '/your-repo-name' : '',
images: {
unoptimized: true,
},
};
module.exports = nextConfig;
If using a custom domain:
CNAME
file in your repository root:your-domain.com