- First, install Next.js:
npm install next@latest react@latest react-dom@latest
-
Create an
.env.local
file and copy and paste the variables from.env.defaults.
Fill in the values as appropriate. -
For use of the Compost Chatbot, install openai:
npm install openai
Then generate a secret key on your OpenAI account to access the API. Insert the key into your .env.local file.
- To start the frontend of the app, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
This is a template for Next.js pages router + Mantine. If you want to use app router instead, see next-app-template.
This template comes with the following features:
- PostCSS with mantine-postcss-preset
- TypeScript
- Storybook
- Jest setup with React Testing Library
- ESLint setup with eslint-config-mantine
dev
– start dev serverbuild
– bundle application for productionexport
– exports static website toout
folderanalyze
– analyzes application bundle with @next/bundle-analyzer
typecheck
– checks TypeScript typeslint
– runs ESLintprettier:check
– checks files with Prettierjest
– runs jest testsjest:watch
– starts jest watchtest
– runsjest
,prettier:check
,lint
andtypecheck
scripts
storybook
– starts storybook dev serverstorybook:build
– build production storybook bundle tostorybook-static
prettier:write
– formats all files with Prettier