- https://strapi.io
- https://nextjs.org
- https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/next-js.html#create-a-next-js-app
mkdir next-js-strapi-faqs
mkdir frontend
cd frontend
- https://nextjs.org/docs/getting-started
npx create-next-app@latest --typescript
cd ../
mkdir backend
cd backend
npx create-strapi-app@latest mc-fullstack-backend
- This will open browser. Enter your details. Next time, you need to run
npm run develop
to get Strapi running. - Once you login,
- Open Content-Type Builder from the left menu
- Display name: FAQ, sa
- Add text field, give name Title
- Add another field, give name Body
- Save
- Once you create FAQ Content Type, click Content Manager on the left menu
- Select FAQ under collection types
- Click Create New Entry
- Add few entries.
- Make sure you publish the content.
- Go to Settings > Roles > Public > Permissions > FAQ > Check "find"
cd ../frontend/mc-full-stack
npm i axios
- Open frontend/mc-full-stack/pages/index.tsx
- Remove content inside
<main></main>
- Update it as per the code in git.
npm run build
npm run dev