NOTE! THIS README WAS COPIED FROM sitecore-mvc-nextjs-starterkit and not modified (except this line)
This repo contains both the starter kit with content items and required configuration files.
This kit can be used to complete the official tutorial and to kick off a new project. There are minimal dependencies in this kit, and not functional components.
- Sitecore 9.3 - 10.x instance.
- "Uniform for Sitecore" installed and configured on your Sitecore instance. Check out the docs.
- Install the Sitecore package with items from
/sitecore/App_Data/packagesfolder. - (optional) To enable Optimize,
- modify the Views/MvcSite/Layout.cshtml according to actual Optimize documentation
- enable
uniform-mvc-kit.Uniform.Deployment.Media.Uniform.OptimizeIntegration.config.disabledconfig insitecore/App_Config/Include/zzz_uniform-mvc-kitfolder - enable and fill in
uniform-mvc-kit.Uniform.Deployment.Media.Uniform.PurgeCache.Akamai.config.disabledconfig insitecore/App_Config/Include/zzz_uniform-mvc-kitfolder - download and place
uniform.optimize.min.jsfile inpublic/scriptsfolder (important! notscriptsbutpublic/scripts)
- Deploy the configs from
/sitecore/App_Configfolder to your Sitecore instance'sApp_Configfolder (the subfolder structure should match).
Check out official docs for more scenarios and tutorial.
- Configure
.envfile according to your environment specifics (see.env-examplefile). npm install- Add
NPM_TOKENenvironment variable with the value we provided you with. npm run startto start the SSR server.npm run export:deployto run static export if used only with the Uniform Deploy-only capability.npm run export:deploy-and-optimizeto run static export if used with the Uniform Optimize capability.
-
Install
@cloudflare/wranglernpm package
npm i @cloudflare/wrangler@1.19.2 -g -
Create a Cloudflare account: https://dash.cloudflare.com/login
-
Create a Cloudflare API token:
- Follow the link: https://dash.cloudflare.com/profile/api-tokens
- Select "Create Token" button
- Select "Edit Cloudflare Workers" among API token templates
- In a new "Create Token" window don't change any Permissions (they are predefined correctly); indicate "All Accounts" in Account Resources section and "All Zones" in Zone Resources section. Client IP Address Filtering section can be skipped.
- Press "Continue To Summary" and then "Create Token" buttons.
- IMPORTANT! Copy and save your API Token somewhere. It only shown once after the initial setup.
- Finalize the worker setup: navigate to the Workers page (Click Workers link on the right pane on the Cloudflare main page) and click the Setup button next to your worker name; Choose to proceed with free account on the next page
-
Enable config:
uniform-mvc-kit.Uniform.Deployment.Hosted.z.Cloudflare.config.disabledand specify required variables:- update
CF_ACCOUNT_IDwith your Cloudflare account ID - update
CF_API_TOKENwith created Cloudflare API token - update
CF_WORKER_NAMEwith preferable worker name
- update
-
If incremental deploy configured: enable config:
uniform-mvc-kit.Uniform.Deployment.Incremental.z.Cloudflare.config.disabledand specify required variables:- update
PublicUrlwith your Cloudflare public url
- update
-
Default Cloudflare worker domain:
https://<WORKER-NAME>.<CLOUDFLARE-ACCOUNT-NAME>.workers.dev
Note: Remove or update the robots.txt if you going to use this kit in production