To use Vercel Next.js, you need the following tools:
- Node.js - Install Node.js 12, including the npm package management tool. NVM is recommended.
- Copy
.env.example
to.env
and add values below, then source to shell. npm run dev
- to run the Next.js app locally
Install storybook npm install storybook -g
, then npm run storybook
to start storybook.
Vercel deployment setup:
- Import git repository on Vercel
- Configure any ENV vars for production/preview apps (in web console or using vercel cli)
- Configure domain for production (set CNAME record to
cname.vercel-dns.com
, and confirm in Vercel console) - Configure integrations, like Slack for notifications
Commits pushed to any branch will automatically build and deploy a preview
app on Vercel (including PR bot posts).
Commits pushed to main
branch will automatically build and deploy the production
app on Vercel.
Local development: set values in .env
Name | Default | Description |
---|---|---|
ADD_VAR_HERE | default |
DESCRIPTION... |
Vercel can add system environment variables. Add VERCEL_GITHUB_COMMIT_SHA
(at minimum for the /api/version endpoint) and leave the value blank, and Vercel will populate these values.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.