Skip to content

Commit 77ef3bb

Browse files
Merge pull request #129 from Sitecore/develop
Helix Examples Release #6
2 parents 22f1414 + 836c88e commit 77ef3bb

File tree

415 files changed

+71801
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

415 files changed

+71801
-174
lines changed

docs/examples/helix-basic-company.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ the site.
2323
it likely would not merit application of Sitecore Helix practices, or perhaps would be
2424
implemented as a single Project-layer module.*
2525

26-
The customer is also utilizing a third-party agency for the website front-end implementation,
27-
and thus HTML, CSS, and JS are being provided by an external team with no knowledge of
28-
Sitecore or Sitecore Helix practices.
29-
3026
## Implementations
3127

3228
### [Helix Basic Company - ASP.NET Core and Sitecore Content Serialization](https://github.com/Sitecore/Helix.Examples/tree/master/examples/helix-basic-aspnetcore)
@@ -38,6 +34,17 @@ This is a [ASP.NET Core Rendering SDK](https://doc.sitecore.com/developers/100/d
3834
* [Helix Publishing Pipeline](https://github.com/richardszalay/helix-publishing-pipeline) is used for building and deploying code for CM/CD, and is configured to auto-deploy on build.
3935
* The Rendering Host projects do not need Helix Publishing Pipeline, because ASP.NET Core / SDK-style projects support sharing content assets.
4036

37+
### [Helix Basic Company - Next.js and Sitecore Content Serialization](https://github.com/Sitecore/Helix.Examples/tree/master/examples/helix-basic-nextjs)
38+
39+
This is a [Sitecore JSS / Next.js](https://jss.sitecore.com/docs/nextjs/introduction/why-nextjs) and [Sitecore Content Serialization](https://doc.sitecore.com/developers/100/developer-tools/en/sitecore-content-serialization.html) based implementation of Helix Basic Company.
40+
* The site is rendered in an independently-running rendering host, built with Next.js.
41+
* The JavaScript/Next.js solution is intentionally kept in the Project layer, in its entirety, without using Helix semantics, as to not require Sitecore solution architecture in front-end code.
42+
* The JSS project is configured for a _Sitecore-first_ workflow. It uses serialized items and not JSS _code-first_ deployment.
43+
* For mocking of Sitecore data, it uses [Storybook](https://storybook.js.org/) instead.
44+
* This solution avoids the need for back-end Sitecore code through use of GraphQL to obtain additional data. Thus the Visual Studio solution is rather sparse. It could be argued that this could be further simplified in a real-world solution.
45+
* Items are serialized using the Sitecore CLI.
46+
* [Helix Publishing Pipeline](https://github.com/richardszalay/helix-publishing-pipeline) is used for building and deploying code for CM/CD, and is configured to auto-deploy on build.
47+
4148
### [Helix Basic Company - TDS](https://github.com/Sitecore/Helix.Examples/tree/master/examples/helix-basic-tds)
4249

4350
This is a [Sitecore TDS](https://www.teamdevelopmentforsitecore.com/TDS-Classic)-based

docs/install.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ instance.
1818
1. [Clone the full repository](https://github.com/Sitecore/Helix.Examples) or [download it](https://github.com/Sitecore/Helix.Examples/archive/master.zip) and unzip into a local directory.
1919
1. Follow the `README.md` instructions for each example.
2020
1. [Helix Basic Company - ASP.NET Core](https://github.com/Sitecore/Helix.Examples/tree/master/examples/helix-basic-aspnetcore/README.md)
21+
1. [Helix Basic Company - Next.js](https://github.com/Sitecore/Helix.Examples/tree/master/examples/helix-basic-nextjs/README.md)
2122
1. [Helix Basic Company - TDS](https://github.com/Sitecore/Helix.Examples/tree/master/examples/helix-basic-tds/README.md)
2223
1. [Helix Basic Company - TDS Consolidated](https://github.com/Sitecore/Helix.Examples/tree/master/examples/helix-basic-tds-consolidated/README.md)
2324
1. [Helix Basic Company - Unicorn](https://github.com/Sitecore/Helix.Examples/tree/master/examples/helix-basic-unicorn/README.md)

examples/helix-basic-aspnetcore/.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"sitecore.cli": {
6-
"version": "2.0.0",
6+
"version": "3.0.0",
77
"commands": [
88
"sitecore"
99
]

examples/helix-basic-aspnetcore/.env

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ REGISTRY=
33
VERSION=
44

55
NETCORE_BUILD_IMAGE=mcr.microsoft.com/dotnet/core/sdk:3.1
6-
SOLUTION_BUILD_IMAGE=mcr.microsoft.com/dotnet/framework/sdk:4.8
6+
SOLUTION_BUILD_IMAGE=mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
77
SOLUTION_BASE_IMAGE=mcr.microsoft.com/windows/nanoserver:1809
88
BUILD_CONFIGURATION=debug
99

@@ -14,15 +14,15 @@ HOST_LICENSE_FOLDER=
1414
CD_HOST=cd.basic-company-aspnetcore.localhost
1515
CM_HOST=cm.basic-company-aspnetcore.localhost
1616
ID_HOST=id.basic-company-aspnetcore.localhost
17-
SITE_HOST=www.basic-company-aspnetcore.localhost
17+
RENDERING_HOST=www.basic-company-aspnetcore.localhost
1818

1919
SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/
2020
SITECORE_MODULE_REGISTRY=scr.sitecore.com/sxp/modules/
2121
SITECORE_TOOLS_REGISTRY=scr.sitecore.com/tools/
22-
SITECORE_VERSION=10.0-ltsc2019
23-
HEADLESS_SERVICES_VERSION=15.0.1-1809
24-
MANAGEMENT_SERVICES_VERSION=2.0.0-1809
25-
TOOLS_VERSION=10.0.0-1809
22+
SITECORE_VERSION=10.1-ltsc2019
23+
HEADLESS_SERVICES_VERSION=18.0-1809
24+
MANAGEMENT_SERVICES_VERSION=3.0-1809
25+
TOOLS_VERSION=10.1-1809
2626

2727
SITECORE_ADMIN_PASSWORD=
2828
SQL_SA_PASSWORD=
@@ -36,4 +36,5 @@ SITECORE_ID_CERTIFICATE_PASSWORD=
3636
SITECORE_LICENSE=
3737
TRAEFIK_IMAGE=traefik:v2.2.0-windowsservercore-1809
3838
TRAEFIK_ISOLATION=hyperv
39-
ISOLATION=default
39+
ISOLATION=default
40+
MEDIA_REQUEST_PROTECTION_SHARED_SECRET=

examples/helix-basic-aspnetcore/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ _ReSharper*/
3131
# may contain OAuth secrets, do not commit
3232
.sitecore/user.json
3333

34+
# NuGet cache for Sitecore CLI
35+
.sitecore/package-cache/
36+
3437
# Ephemeral index caches used by serialization, do not commit
3538
.scindex
3639

examples/helix-basic-aspnetcore/Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<PlatformVersion>10.0.0</PlatformVersion>
5-
<SitecoreAspNetVersion>15.0.1</SitecoreAspNetVersion>
4+
<PlatformVersion>10.1.0</PlatformVersion>
5+
<SitecoreAspNetVersion>16.0.0</SitecoreAspNetVersion>
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageReference Update="Sitecore.Nexus" Version="$(PlatformVersion)" />

examples/helix-basic-aspnetcore/docker-compose.override.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@ services:
4040
ASPNETCORE_ENVIRONMENT: "Development"
4141
ASPNETCORE_URLS: "http://*:80"
4242
Sitecore__InstanceUri: "http://cd"
43-
Sitecore__RenderingHostUri: "https://${SITE_HOST}"
4443
Sitecore__EnableExperienceEditor: "true"
4544
depends_on:
4645
- solution
4746
- cd
4847
labels:
4948
- "traefik.enable=true"
5049
- "traefik.http.routers.rendering-secure.entrypoints=websecure"
51-
- "traefik.http.routers.rendering-secure.rule=Host(`${SITE_HOST}`)"
50+
- "traefik.http.routers.rendering-secure.rule=Host(`${RENDERING_HOST}`)"
5251
- "traefik.http.routers.rendering-secure.tls=true"
5352

5453
traefik:
@@ -70,21 +69,25 @@ services:
7069
context: ./docker/build/mssql
7170
args:
7271
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-mssql:${SITECORE_VERSION}
73-
HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}jss-xm1-assets:${HEADLESS_SERVICES_VERSION}
72+
HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-xm1-assets:${HEADLESS_SERVICES_VERSION}
7473
mem_limit: 2GB
7574
volumes:
7675
- ${LOCAL_DATA_PATH}\mssql:c:\data
7776

77+
# Mount our Solr data folder.
7878
solr:
79-
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xm1-solr:${VERSION:-latest}
80-
build:
81-
context: ./docker/build/solr
82-
args:
83-
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-solr:${SITECORE_VERSION}
84-
mem_limit: 1GB
8579
volumes:
8680
- ${LOCAL_DATA_PATH}\solr:c:\data
8781

82+
# Mount our Solr data folder and use our retagged Solr image.
83+
# Some modules (like SXA) also require additions to the Solr image.
84+
solr-init:
85+
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xm1-solr-init:${VERSION:-latest}
86+
build:
87+
context: ./docker/build/solr-init
88+
args:
89+
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-solr-init:${SITECORE_VERSION}
90+
8891
id:
8992
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-id:${VERSION:-latest}
9093
build:
@@ -102,7 +105,7 @@ services:
102105
context: ./docker/build/cd
103106
args:
104107
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-cd:${SITECORE_VERSION}
105-
HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}jss-xm1-assets:${HEADLESS_SERVICES_VERSION}
108+
HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-xm1-assets:${HEADLESS_SERVICES_VERSION}
106109
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
107110
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
108111
depends_on:
@@ -113,6 +116,8 @@ services:
113116
- ${HOST_LICENSE_FOLDER}:C:\license
114117
environment:
115118
SITECORE_LICENSE_LOCATION: C:\license\license.xml
119+
## Development Environment Optimizations
120+
SITECORE_DEVELOPMENT_PATCHES: DevEnvOn,CustomErrorsOff,DebugOn,DiagnosticsOff,InitMessagesOff
116121
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"
117122

118123
cm:
@@ -121,7 +126,7 @@ services:
121126
context: ./docker/build/cm
122127
args:
123128
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-cm:${SITECORE_VERSION}
124-
HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}jss-xm1-assets:${HEADLESS_SERVICES_VERSION}
129+
HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-xm1-assets:${HEADLESS_SERVICES_VERSION}
125130
MANAGEMENT_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-management-services-xm1-assets:${MANAGEMENT_SERVICES_VERSION}
126131
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
127132
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
@@ -133,4 +138,8 @@ services:
133138
- ${HOST_LICENSE_FOLDER}:C:\license
134139
environment:
135140
SITECORE_LICENSE_LOCATION: C:\license\license.xml
141+
RENDERING_HOST_PUBLIC_URI: "https://${RENDERING_HOST}"
142+
## Development Environment Optimizations
143+
SITECORE_DEVELOPMENT_PATCHES: DevEnvOn,CustomErrorsOff,DebugOn,DiagnosticsOff,InitMessagesOff
144+
Sitecore_AppSettings_exmEnabled:define: "no" # remove to turn on EXM
136145
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"

examples/helix-basic-aspnetcore/docker-compose.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,24 @@ services:
4545
target: c:\data
4646
solr:
4747
isolation: ${ISOLATION}
48+
image: ${SITECORE_DOCKER_REGISTRY}nonproduction/solr:8.4.0-${SITECORE_VERSION}
4849
ports:
4950
- "8984:8983"
50-
image: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-solr:${SITECORE_VERSION}
5151
volumes:
5252
- type: bind
5353
source: .\solr-data
5454
target: c:\data
55+
environment:
56+
SOLR_MODE: solrcloud
57+
solr-init:
58+
isolation: ${ISOLATION}
59+
image: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-solr-init:${SITECORE_VERSION}
60+
environment:
61+
SITECORE_SOLR_CONNECTION_STRING: http://solr:8983/solr
62+
SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME}
63+
depends_on:
64+
solr:
65+
condition: service_healthy
5566
id:
5667
isolation: ${ISOLATION}
5768
image: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION}
@@ -81,7 +92,7 @@ services:
8192
depends_on:
8293
mssql:
8394
condition: service_healthy
84-
solr:
95+
solr-init:
8596
condition: service_started
8697
redis:
8798
condition: service_started
@@ -90,10 +101,11 @@ services:
90101
Sitecore_ConnectionStrings_Security: Data Source=mssql;Initial Catalog=Sitecore.Core;User ID=sa;Password=${SQL_SA_PASSWORD}
91102
Sitecore_ConnectionStrings_Web: Data Source=mssql;Initial Catalog=Sitecore.Web;User ID=sa;Password=${SQL_SA_PASSWORD}
92103
Sitecore_ConnectionStrings_ExperienceForms: Data Source=mssql;Initial Catalog=Sitecore.ExperienceForms;User ID=sa;Password=${SQL_SA_PASSWORD}
93-
Sitecore_ConnectionStrings_Solr.Search: http://solr:8983/solr
104+
Sitecore_ConnectionStrings_Solr.Search: http://solr:8983/solr;solrCloud=true
94105
Sitecore_ConnectionStrings_Redis.Sessions: redis:6379,ssl=False,abortConnect=False
95106
Sitecore_License: ${SITECORE_LICENSE}
96107
SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME}
108+
MEDIA_REQUEST_PROTECTION_SHARED_SECRET: ${MEDIA_REQUEST_PROTECTION_SHARED_SECRET}
97109
healthcheck:
98110
test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"]
99111
timeout: 300s
@@ -108,7 +120,7 @@ services:
108120
depends_on:
109121
mssql:
110122
condition: service_healthy
111-
solr:
123+
solr-init:
112124
condition: service_started
113125
id:
114126
condition: service_started
@@ -119,7 +131,7 @@ services:
119131
Sitecore_ConnectionStrings_Master: Data Source=mssql;Initial Catalog=Sitecore.Master;User ID=sa;Password=${SQL_SA_PASSWORD}
120132
Sitecore_ConnectionStrings_Web: Data Source=mssql;Initial Catalog=Sitecore.Web;User ID=sa;Password=${SQL_SA_PASSWORD}
121133
Sitecore_ConnectionStrings_ExperienceForms: Data Source=mssql;Initial Catalog=Sitecore.ExperienceForms;User ID=sa;Password=${SQL_SA_PASSWORD}
122-
Sitecore_ConnectionStrings_Solr.Search: http://solr:8983/solr
134+
Sitecore_ConnectionStrings_Solr.Search: http://solr:8983/solr;solrCloud=true
123135
Sitecore_ConnectionStrings_Sitecoreidentity.secret: ${SITECORE_IDSECRET}
124136
Sitecore_AppSettings_Telerik.AsyncUpload.ConfigurationEncryptionKey: ${TELERIK_ENCRYPTION_KEY}
125137
Sitecore_AppSettings_Telerik.Upload.ConfigurationHashKey: ${TELERIK_ENCRYPTION_KEY}
@@ -130,6 +142,7 @@ services:
130142
Sitecore_Identity_Server_CallbackAuthority: https://${CM_HOST}
131143
Sitecore_Identity_Server_Require_Https: "false"
132144
SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME}
145+
MEDIA_REQUEST_PROTECTION_SHARED_SECRET: ${MEDIA_REQUEST_PROTECTION_SHARED_SECRET}
133146
healthcheck:
134147
test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"]
135148
timeout: 300s

examples/helix-basic-aspnetcore/docker/build/dotnetsdk/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ARG NETCORE_BUILD_IMAGE
1010

1111
FROM ${NETCORE_BUILD_IMAGE} as netcore-sdk
1212
FROM ${BUILD_IMAGE}
13+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
1314

1415
# Ensure updated nuget. Depending on your Windows version, dotnet/framework/sdk:4.8 tag may provide an outdated client.
1516
# See https://github.com/microsoft/dotnet-framework-docker/blob/1c3dd6638c6b827b81ffb13386b924f6dcdee533/4.8/sdk/windowsservercore-ltsc2019/Dockerfile#L7

examples/helix-basic-aspnetcore/docker/build/solr/Dockerfile renamed to examples/helix-basic-aspnetcore/docker/build/solr-init/Dockerfile

File renamed without changes.

0 commit comments

Comments
 (0)