Sitecore JSS Disconnected Mode Development Workflow:
Working on Sitecore JSS applications in disconnected mode allows developers to build and develop front-end applications independently of a Sitecore instance, using local mock data and file-based routing, which is beneficial for early development and prototyping, especially when a Sitecore instance is not yet available
Sitecore Headless jss development workflows are
1. Disconnected Mode Development workflow
— We do not require the sitecore instance for development
— Fetching Method: Rest
2. Connnected Mode Developoment workflow
— We require the sitecore instance for development
— Fetching Method: Graphql
Lets setup the Sitecore JSS Headless Disconnected Mode project:
- Prerequsites:-
— Node JS: Latest version of nodejs should be installed. (Nodejs download)
— Sitecore JSS CLI: Install the latest Sitecore JSS CLI globally.
Create Folder for project: Name: scjssdemo & Navigate & open this on vs code, paste jss cli in terminal.
npm install -g @sitecore-jss/sitecore-jss-cli@latest
2. Project Creation
— Create project- execute command: npx create-sitecore-jss nextjs
It will appear like below:-
PS C:\Workdir\Sitecore\scjssdemo> npx create-sitecore-jss nextjs
– Where would you like your new app created? C:\Workdir\Sitecore\scjssdemo\nextjs
– Would you like to use the pre-push hook for linting check? No
Initializing ‘nextjs’…
– What is the name of your app? sitecore-jss-app
– What is your Sitecore hostname (used if deployed to Sitecore)? sitecore-jss-app.dev.local
– How would you like to fetch Layout and Dictionary data? REST
– How would you like to prerender your application? SSR
– Are you building for Sitecore XM Cloud? No
– Would you like to include any add-on initializers? nextjs-styleguide – Includes example components and setup for working
disconnected
Initializing ‘nextjs-styleguide’…
– Which additional language do you want to support (en is already included and required)? da-DK
Installing packages…
> npm install ..
JSS application sitecore-jss-app is ready!
Next steps:
* Connect to Sitecore with jss setup (optional)
* Try out your application with jss start
* Enable source control (i.e. git init) (optional)
* Check out the JSS documentation at https://jss.sitecore.com
Run this project using command jss start
– Navigate to the project folder nextjs and run command jss start
it will appear like below image:
Youtube Video Link: Click
Hire Sitecore Developer & Expert, $15/hour
Sitecore CMS Solution Development Pricing