This repository contains a typical NextJS project at Seven Sigma Group.
This is a Next.js project bootstrapped with create-next-app
and configured with:
- ESLint and Prettier
- Git hooks set up with Husky
- NextJS and React specific folders (
pages
,styles
, andlayouts
) - TypeScript
- Tailwind CSS
The app has the following structure:
components
: React components used across the app.pages
: NextJS specific pages. The pages should not contain any styles, and be limited to the page-specific logic. All the presentation and business logic should be implemented as a view.layouts
: Contains the presentation elements for the pages. Can also include data and business logic.
You have a NextJS API route available that you can call to fetch all the details.
You can see the code at src/pages/api/person
TL;DR:
- GET endpoint:
api/user?person={Person.PersonA}
- Can request values for person A, person B, or person C.
- Person A returns in one second, person B returns in 3 seconds, person C always fails.
To set up the codebase and the required dependencies, simply run npm install
;
# development
$ npm run dev
# production
$ npm run build && npm run start