If you want to start a project using the basic setup, this is the right repository for you. Please feel free to share and contribute.
--
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
/app
\_ /.next/
\_ /components/
\_ Button/
\_ button.spec.tsx
\_ button.styles.tsx
\_ index.tsx
\_ /pages/
\_ _api
\_ _app.tsx
\_ index.jsx
\_ /public/
\_ favicon.ico
\_ header.png
\_ /redux/ => Or any other state management tool
\_ folders...
\_ /test/
\_ pages/
\_ index.test.tsx
\_ test-utils.js/
\_ /styles/
\_ global.css
\
\_ .babelrc
\_ .eslintrc
\_ .env
\_ babel.config.js
\_ jest.config.js
\_ jest.setup.js
\_ next.config.js
\_ tsconfig.json
\_ package.json
\_ README.md
You can start editing the page by modifying pages/index.tsx
. The page auto-updates as you edit the file. You can also create your components at components folder.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.tsx
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
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.
- the Next.js GitHub repository
And the amazing tutorials I found and helped me built this boilerplate:
- Set Up Jest and React Testing Library with Next.js
- How To Quickly Add Jest To Your Next.js App
- Setting Up Testing Library with NextJS
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out the documentatiojn Next.js deployment documentation for more details.