### Install Node.js Project Dependencies Source: https://github.com/skolaczk/next-starter/blob/main/README.md After cloning the repository, run this command to install all necessary Node.js packages and libraries defined in `package.json`. This is a prerequisite for running the application. ```bash npm install ``` -------------------------------- ### Preview Next.js Production Build Locally Source: https://github.com/skolaczk/next-starter/blob/main/README.md Execute a full build and then start the production server to preview the application as it would run in a deployed environment. Useful for final checks before deployment. ```bash npm run preview ``` -------------------------------- ### Start Next.js Development Server Source: https://github.com/skolaczk/next-starter/blob/main/README.md Launch the Next.js development server with hot-reloading enabled. Access the application in your browser at `http://localhost:3000/` for local development and testing. ```bash npm run dev ``` -------------------------------- ### Run Next.js Production Server Source: https://github.com/skolaczk/next-starter/blob/main/README.md Start the Next.js application in production mode using the pre-built assets. This command is typically executed after `npm run build` to serve the optimized application. ```bash npm run start ``` -------------------------------- ### Clone Next.js Starter Repository with Git Source: https://github.com/skolaczk/next-starter/blob/main/README.md Alternatively, clone the repository directly using Git to get a local copy of the entire starter template. This method provides full control over the repository history. ```bash git clone https://github.com/Skolaczk/next-starter my-project-name ``` -------------------------------- ### Run Unit Tests in Watch Mode Source: https://github.com/skolaczk/next-starter/blob/main/README.md Start unit tests in watch mode, which automatically re-runs tests when source files or test files change. This provides immediate feedback during active development. ```bash npm run test:watch ``` -------------------------------- ### Configure Husky Git Hooks Source: https://github.com/skolaczk/next-starter/blob/main/README.md Execute this command to set up Husky, which automates pre-commit and pre-push checks like linting and formatting. This ensures code quality standards are enforced before changes are committed. ```bash npm run prepare ``` -------------------------------- ### Initialize Next.js Project with create-next-app Source: https://github.com/skolaczk/next-starter/blob/main/README.md Use this command to quickly scaffold a new Next.js application based on this starter template. It leverages `create-next-app` to set up the project structure and initial files. ```bash npx create-next-app -e https://github.com/Skolaczk/next-starter my-project-name ``` -------------------------------- ### Generate Application Sitemap Source: https://github.com/skolaczk/next-starter/blob/main/README.md Create or update the sitemap for the deployed application. This command is typically run after a successful build to help search engines discover and index all public pages. ```bash npm run postbuild ``` -------------------------------- ### Build Next.js Application for Production Source: https://github.com/skolaczk/next-starter/blob/main/README.md Compile and optimize the Next.js application for production deployment. This command generates the necessary static assets and server-side code for efficient serving. ```bash npm run build ``` -------------------------------- ### Execute Unit Tests with Jest Source: https://github.com/skolaczk/next-starter/blob/main/README.md Run all unit tests configured for the project, typically using Jest and React Testing Library. This verifies the functionality of individual components and modules. ```bash npm run test ``` -------------------------------- ### Next.js Starter Project Directory Structure Source: https://github.com/skolaczk/next-starter/blob/main/README.md This outline provides a visual representation of the project's main directories and their contents. It helps developers quickly understand the organization of the codebase. ```bash .\n├── .github # GitHub folder\n├── .husky # Husky configuration\n├── prisma # Prisma schema and migrations\n├── public # Public assets folder\n└── src\n ├── __tests__ # Unit and e2e tests\n ├── actions # Server actions\n ├── app # Next JS App (App Router)\n ├── components # React components\n ├── lib # Functions and utilities\n ├── styles # Styles folder\n └── env.mjs # Env variables config file ``` -------------------------------- ### Lint Next.js Project Code with Eslint Source: https://github.com/skolaczk/next-starter/blob/main/README.md Run Eslint to identify and report problematic patterns found in JavaScript/TypeScript code. This helps enforce coding standards and catch potential errors early. ```bash npm run lint ``` -------------------------------- ### Execute End-to-End Tests with Playwright Source: https://github.com/skolaczk/next-starter/blob/main/README.md Run the project's end-to-end tests using Playwright. These tests simulate user interactions across the entire application to ensure full system functionality. ```bash npm run e2e ``` -------------------------------- ### Automatically Format Code with Prettier Source: https://github.com/skolaczk/next-starter/blob/main/README.md Apply automatic code formatting to ensure consistency across the codebase, usually with Prettier. This command modifies files to match the defined style guidelines. ```bash npm run format:write ``` -------------------------------- ### Check Code Formatting with Prettier Source: https://github.com/skolaczk/next-starter/blob/main/README.md Verify that the project's code adheres to the defined formatting rules, typically using Prettier. This command checks for formatting inconsistencies without modifying files. ```bash npm run format:check ``` -------------------------------- ### Run End-to-End Tests with Playwright UI Source: https://github.com/skolaczk/next-starter/blob/main/README.md Execute end-to-end tests with Playwright's UI mode, providing a visual debugger and trace viewer. This is highly useful for debugging complex test failures. ```bash npm run e2e:ui ``` -------------------------------- ### Automatically Fix Eslint Linting Errors Source: https://github.com/skolaczk/next-starter/blob/main/README.md Attempt to automatically fix fixable linting issues reported by Eslint. This command helps quickly resolve common code style and quality violations. ```bash npm run lint:fix ``` -------------------------------- ### Type-Check TypeScript Files Source: https://github.com/skolaczk/next-starter/blob/main/README.md Perform a static type analysis of TypeScript files to catch type-related errors. This command ensures type safety without compiling the code into JavaScript. ```bash npm run typecheck ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.