NextJS codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API. This implementation uses Incremental Static Generaration (ISR) for Articles.
This codebase is created to demonstrate a simple blogging app including CRUD operations, authentication, static site generation routing, pagination, and more using Incremental Static Regenation (ISR) kind of data fetching in NextJS and PRISMA.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
Architecture | Stack
- Database : MongoDB
- ORM : PRISMA
- Backend : NextJS API pages
- Front : NextJS (React) pages
The pages (e.g. /home
with params) are generated at build time based on expected props using getStaticPaths
but also regenerated after configured time using
getStaticProps
and its revalidate
configuration property.
npm install
npm run dev
(Dev server for demo and APIs required for build)npm run build
(Prod build generates pages from getStaticPaths )npm run start
(Starts a server from above build) Pages can be seen statically generated and in case changes are made to data, pages would only be updated after specified time usingrevalidate