- β‘οΈ Next.js 15 (App Router)
- βοΈ React 19
- β TypeScript
- π ESLint 9 β To find and fix problems in your code
- π Prettier β Code Formatter for consistent style
- πΆ Husky β For running scripts before committing
- π Commitlint β To make sure your commit messages follow the convention
- π« lint-staged β Run ESLint and Prettier against staged Git files
- π· PR Workflow β Run Type Check & Linters on Pull Requests
- βοΈ EditorConfig - Consistent coding styles across editors and IDEs
- π Path Mapping β Import components or images using the
@
prefix - π CSP β Content Security Policy for enhanced security (default minimal policy)
- 𧳠T3 Env β Type-safe environment variables
The best way to start with this template is using Create Next App.
# yarn
yarn create next-app -e https://github.com/csorlandi/nextjs-template
# pnpm
pnpm create next-app -e https://github.com/csorlandi/nextjs-template
# npm
npx create-next-app -e https://github.com/csorlandi/nextjs-template
To start the project locally, run:
yarn dev
Open http://localhost:3000
with your browser to see the result.
- Node.js >= 20
- yarn
.github
β GitHub configuration including the CI workflow..husky
β Husky configuration and hooks.public
β Static assets such as robots.txt, images, and favicon.src
β Application source code, including pages, components, styles.
yarn dev
β Starts the application in development mode athttp://localhost:3000
.yarn build
β Creates an optimized production build of your application.yarn start
β Starts the application in production mode.yarn type-check
β Validate code using TypeScript compiler.yarn lint
β Runs ESLint for all files in thesrc
directory.yarn lint:fix
β Runs ESLint fix for all files in thesrc
directory.yarn format
β Runs Prettier for all files in thesrc
directory.yarn format:check
β Check Prettier list of files that need to be formatted.yarn format:ci
β Prettier check for CI.
TypeScript are pre-configured with custom path mappings. To import components or files, use the @
prefix.
import { Button } from '@/components/Button';
// To import images or other files from the public folder
import avatar from '@/public/avatar.png';
We use T3 Env to manage environment variables. Create a .env.local
file in the root of the project and add your environment variables there.
When adding additional environment variables, the schema in ./src/lib/env/client.ts
or ./src/lib/env/server.ts
should be updated accordingly.
The Content Security Policy (CSP) is a security layer that helps to detect and mitigate certain types of attacks, including Cross-Site Scripting (XSS) and data injection attacks. The CSP is implemented in the next.config.ts
file.
It contains a default and minimal policy that you can customize to fit your application needs. It's a foundation to build upon.
This project is licensed under the MIT License - see the LICENSE file for more information.