Installation
How to setup, install and run next-forge.
Initialization
Run the next-forge
init command:
npx next-forge@latest init
pnpm dlx next-forge@latest init
yarn dlx next-forge@latest init
bun x next-forge@latest init
You will be prompted for the project name and package manager.
$ npx next-forge@latest init
┌ Let's start a next-forge project!
│
◇ What is your project named?
│ my-app
│
◇ Which package manager would you like to use?
│ pnpm
│
◇ Project initialized successfully!
│
└ Please make sure you install the Mintlify CLI and Stripe CLI before starting the project.
This will create a new directory with your project name and clone the repo into it. It will run a setup script to install dependencies and copy .env
files. You can read more about environment variables here.
Database
You will need to scaffold the database using the schema defined in packages/database/prisma/schema.prisma
:
npm run migrate
pnpm run migrate
yarn migrate
bun run migrate
For more details on the default Prisma configuration (using Neon), refer to the Database Configuration Guide.
CMS
You will need to setup the CMS. Follow the instructions here, but the summary is:
- Fork the
basehub/next-forge
template - Get your Read Token from the "Connect to Your App" page
- Add the
BASEHUB_TOKEN
to your Environment Variables
Development
Run the development server with:
npm run dev
pnpm run dev
yarn dev
bun run dev
Open the localhost URLs with the relevant ports listed above to see the app, e.g.
- http://localhost:3000/ — The main app.
- http://localhost:3001/ — The website.
- http://localhost:3002/ — The API.
- http://localhost:3003/ — Email preview server.
- http://localhost:3004/ — The docs