Sitecore JSS Next.js folder structure brief introduction

I am going to explain the the JSS Next.js Folder Structure in high level.

JSS Next.js Folder Structure

.NEXT- It is folder where build & published files are stored.

PUBLIC- We can keep public access files like image, files, documents or media assets.

SCRIPTS- It contains JSS Defaults scripts to create JSS projects and handles some prebuild functionality.

Sitecore- It contains the app definition config(where we define app site definition) and deployment secret config.

SRC- It is place where we create Components, Styles, Pages, API and other JSS supporting files. etc. We can say development folder.

.Env & .Env.Local - It is file where we define the app configurations like PUBLIC URL, JSS_EDITING_SECRET, SITECORE_API_KEY, SITECORE_API_HOST, JSS_APP_NAME .

NEXT.CONFIG.JS -? It is file where we write or define next.js configs like multilingual, rewrite modules or any plugin configs.

PACKAGE.JSON -? It is file where all the library dependencies listed.

SCJSSCONFIG.JSON - It is automatically create when we run the jss deploy config command, it contains instance path, apikey, deploysecret, deployrul, layoutservicehost.

TSCONFIG.JSON & next-env.d.ts & tsconfig.scripts.json - These files help typescript to work with JSS next.js project.



FOLDER STRUCTURE INSIDE SRC

lets try to understand the SRC folder in high level.

JSS Next.js follow the page route file based routing system and dynamic routing system. and Sitecore CMS is folder based page item structure.

ASSETS - We create styling files like CSS, SCSS files or CSS file module.

COMPONENTS - We create components for JSS application here.

_APP.TSX- Entry point for application, anything we define , take effect on application level like CS module or CSS file.

[[...PATH]].TSX - It is dynamic route, we call the optional catch-all route passes the path(routes) information to next.js components.

404.TSX- Its is 404 error page, when no route is found it redirect to 404 file.

COMPONENTBUIDLER.TS - It is file responsible for adding and mapping components(JSS & CMS) dynamically. It usually maps the jss components with the Sitecore renderings.

PAGE-PROPS_FACTORY_PLUGINGS.TS - Page Props Factory get the path/route information from dynamic optional catch-all route and makes a request to the Sitecore Layout Service REST API or Sitecore GraphQL Edge schema to fetch layout data for the item or component.


For more you get the course content from here link: https://techonlinelearning.com/courses/jss-xm-cloud-developer-introduction-course/

For JSS & XM Cloud interview questions link: https://techonlinelearning.com/courses/jss-xm-cloud-interview-question/

If you want to enroll for training session link: https://sitecoredevservices.com/sitecore-training-online-2/

For Corporate Training Program link: https://sitecoredevservices.com/corporate-sitecore-cms-training-program/

Other Sitecore CMS and JSS Articles link: https://sitecoredevservices.com/blogs/

You can find my blogs articles link: https://www.mypiblogs.com/


#jss #xmcloud #jssproject #nextjs #jssnextjs #sitecore #sitecoredeveloper #jssxmcloudintroductioncourse #headless #headlesscms #headlesssxa #headleservice


要查看或添加评论,请登录

Prem Murmu的更多文章

  • Sitecore JSS Routing and Page Composition in Next.js Apps

    Sitecore JSS Routing and Page Composition in Next.js Apps

    In Sitcore JSS, Next.js uses a file-system-based router, JSS integrates this system to render pages dynamically based…

  • Sitecore Indexing Strategies for cm & cd.

    Sitecore Indexing Strategies for cm & cd.

    I recently deployed sitecore xp solution to client on premise servers, got chance to explore more on configuring cm and…

  • Sitecore Headless Services

    Sitecore Headless Services

    The Sitecore Headless Services module enables developers to decouple the data application from the rendering…

  • Headless Development with Sitecore (Version 22.x)

    Headless Development with Sitecore (Version 22.x)

    A headless architecture separates the back end (services and APIs) from the front-end application. The front-end…

  • Complete XM Cloud Overview Course

    Complete XM Cloud Overview Course

    I have prepared XM cloud overview course, it will provide you complete overview of the XM cloud platform. Sitecore XM…

  • XM Cloud Terminology

    XM Cloud Terminology

    General concepts and terms used in XM Cloud, the Cloud Portal need to know before start work in XM Cloud projects…

社区洞察

其他会员也浏览了