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/packages
folder. - (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.disabled
config insitecore/App_Config/Include/zzz_uniform-mvc-kit
folder - enable and fill in
uniform-mvc-kit.Uniform.Deployment.Media.Uniform.PurgeCache.Akamai.config.disabled
config insitecore/App_Config/Include/zzz_uniform-mvc-kit
folder - download and place
uniform.optimize.min.js
file inpublic/scripts
folder (important! notscripts
butpublic/scripts
)
- Deploy the configs from
/sitecore/App_Config
folder to your Sitecore instance'sApp_Config
folder (the subfolder structure should match).
Check out official docs for more scenarios and tutorial.
- Configure
.env
file according to your environment specifics (see.env-example
file). npm install
- Add
NPM_TOKEN
environment variable with the value we provided you with. npm run start
to start the SSR server.npm run export:deploy
to run static export if used only with the Uniform Deploy-only capability.npm run export:deploy-and-optimize
to run static export if used with the Uniform Optimize capability.
-
Install
@cloudflare/wrangler
npm 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.disabled
and specify required variables:- update
CF_ACCOUNT_ID
with your Cloudflare account ID - update
CF_API_TOKEN
with created Cloudflare API token - update
CF_WORKER_NAME
with preferable worker name
- update
-
If incremental deploy configured: enable config:
uniform-mvc-kit.Uniform.Deployment.Incremental.z.Cloudflare.config.disabled
and specify required variables:- update
PublicUrl
with 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