@next-friday/create-app
v5.0.0
Published
Create a Next Friday project from a template.
Maintainers
Readme
@next-friday/create-app
Create a Next Friday project with the company's tooling, Git hooks, CI, and agent rules already in place.
pnpm create @next-friday/appAnswer the prompts for a project name and a stack. To skip the prompts, pass both:
pnpm create @next-friday/app my-api --stack nestjsWithout a terminal, as in CI or an agent, the name and --stack are required. Pass . as the name to create the project in the current directory, for example in a fresh clone.
Stacks
| --stack | Starts with |
| :---------- | :---------------------------------------------------------------- |
| nodejs | A TypeScript HTTP server on node:http with a /health endpoint |
| nestjs | A NestJS app with a Terminus /health endpoint |
| nextjs | A Next.js App Router app with React and Tailwind CSS |
| payload | Payload CMS on Next.js with PostgreSQL |
| turborepo | A Turborepo workspace with a Next.js app and a Payload backoffice |
Every stack is built from templates/base, which holds the shared company setup, plus its own directory under templates/, which holds the stack-specific files.
What every project includes
- Code quality: TypeScript, ESLint and Prettier with the Next Friday configs, Vitest with coverage, fast-check, Knip, dependency-cruiser, editorconfig-checker, and sort-package-json.
- Git hooks: Husky runs gitleaks and lint-staged before each commit, commitlint on each message, and
pnpm checkbefore each push. Commits and pushes tomainare blocked after the first one. - CI: GitHub Actions run the static checks, tests with patch coverage, the build, end-to-end tests for Next.js and Payload, a container build and vulnerability scan, Semgrep, OSV-Scanner, CodeQL, dependency review, OpenSSF Scorecard, gitleaks, TruffleHog, zizmor, and pull request title validation. Dependabot keeps dependencies current.
- Deployment: a
Dockerfilethat runs as thenodeuser, and a Railway workflow that promotes one commit throughdev,uat, andprod. - Agent rules:
CLAUDE.mdimportsAGENTS.md. Shared rules live in.agents/rules, with hooks that enforce them in Claude Code and Cursor, and a Cursor Bugbot configuration.
Requirements
- Node.js 24.22.1, the version in the generated
.nvmrc. The CLI itself runs on the range inpackage.json#engines. - pnpm:
npm install --global pnpm. The generated project pins its pnpm version inpackage.json#packageManager. - Git 2.28 or later.
- gitleaks 8.19 or later and jq, which the generated project's Git hooks need for the first commit.
Options
pnpm create @next-friday/app [name] [--stack nodejs|nestjs|nextjs|payload|turborepo]| Option | Description |
| :--------------- | :---------------------------------------------------------------------------- |
| name | Project directory and package name. Asked when left out. |
| --stack | nodejs, nestjs, nextjs, payload, or turborepo. Asked when left out. |
| --skip-git | Do not run git init. |
| --skip-install | Do not run pnpm install. |
| -v, --version | Print the version. |
| -h, --help | Print the usage. |
The name must:
- use lowercase letters, digits,
.,_, or-, and start with a letter or digit; - not end in
., and not benode_modules,favicon.ico, or a name that Windows reserves, such ascon; - point to a directory that does not exist or is empty, apart from
.git.
What the CLI does
Copies the template into the project directory and replaces the template's package name with the project name.
Writes
.envfrom.env.example. For Payload and Turborepo, it setsPAYLOAD_SECRETto a random secret.Runs
git init --initial-branch=main, unless the directory is already in a Git repository.Runs
pnpm install, which also installs the Git hooks.Prints the next steps, for example:
cd my-api pnpm start:devThe development script is
pnpm devfor Next.js, Payload, and Turborepo, andpnpm start:devfor Node.js and NestJS.
Then follow After creating a project from this template in the project's README.md to make the first commit and set up the repository.
Troubleshooting
pnpm installfails: the CLI keeps the project and exits with 1. Fix the printed error, such as a Node.js version outside the project'spackage.json#engines, then runpnpm installin the project.--skip-git: rungit init --initial-branch=mainbeforepnpm install, so the install can set up the Git hooks.--skip-install: the Git hooks are not set up until you runpnpm install.- Cancelling: Ctrl+C exits with 130. During the copy, it also removes the partly copied project.
- Payload: set
DATABASE_URLin.envto a PostgreSQL database before you start the app.
Contributing
See CONTRIBUTING.md.
