Skip to content

Quick Reference Card — HEMA100 Frontend

Single-page cheat sheet for common commands and patterns.

Terminal window
# Clone and install
git clone git@github.com:HemaEcom/<repo-name>.git
cd <repo-name>
npm install
cd src && npm install
# CodeArtifact login (required for @hema packages)
npm run co:login
# Fetch environment variables
./scripts/fetch-env-from-aws.sh # or
npm run environment:set:sandbox # CMS repo
Terminal window
# Start Next.js dev server
npm run dev # from src/
# Run tests
npm run test # Vitest (unit)
npm run test:watch # Vitest watch mode
npm run playwright # Playwright E2E
# Lint & format
npm run lint
npm run lint:fix
npm run format:fix
Terminal window
# Synthesize CloudFormation templates
npm run cdk synth
# Deploy to sandbox (feature branch)
npx cdk deploy --require-approval=never
# Deploy CMS to sandbox
npm run deploy:sandbox
Terminal window
# Branch naming (required for Butler)
git checkout -b feature/cofi-123
git checkout -b fix/cofi-456
git checkout -b chore/cofi-789
# Push triggers Butler pipeline automatically
git push -u origin feature/cofi-123
# Sandbox URL pattern:
# https://frontend-<branch>.omni-web-<service>.ui-test.hema.digital/
lib/runtime/gateway-routes-config.json
{
"domains": [
{ "gatewayDomain": "nl", "locales": ["nl-nl"] },
{ "gatewayDomain": "com", "localePrefix": "always", "locales": ["nl-be", "fr-be", "fr-fr", "de-de"] }
],
"routes": [
{ "name": "zones-prefix", "type": "prefix", "enabled": true, "route": "_zones/<service-id>" }
],
"rolloutPercentage": 100
}
Terminal window
# Studio
cd omni-cms-composable-cms
npm run dev # Local studio at localhost:3333
# Schema validation
npm run validate-schema
# Deploy studio
npm run deploy:sandbox # Sandbox
npm run deploy:preprod # Pre-production
# Migrations
npx sanity migration run migrations/<name>.ts --dataset <dataset>
VariablePurpose
NEXT_PUBLIC_SANITY_PROJECT_IDSanity project ID
NEXT_PUBLIC_SANITY_DATASETDataset (production, preprod, sandbox)
NEXT_PUBLIC_SANITY_STUDIO_URLStudio URL for visual editing
SANITY_API_READ_TOKENServer-only read token (draft mode)
NEXT_PUBLIC_BASE_URLPublic domain (hema.nl / hema.com)
BASE_API_URLInternal API base URL
LOG_LEVELLogging level (error/warn/info/debug)
<repo>/
├── lib/ # CDK infrastructure
│ ├── common/ # Shared constructs (ECS, ALB, alarms)
│ ├── components/ # EcsNextJsBundle
│ ├── runtime/ # Runtime stack + gateway config
│ └── pipeline/ # CI/CD pipeline stack
├── src/ # Next.js application
│ ├── app/ # App Router pages
│ │ ├── [locale]/ # Locale-prefixed routes
│ │ └── api/ # API routes (health, draft-mode)
│ ├── components/ # React components
│ ├── repositories/ # Data access (Sanity, PODS)
│ ├── services/ # Business logic
│ ├── i18n/ # Internationalization config
│ ├── utils/ # Utilities (logger, constants)
│ ├── Dockerfile # Production container
│ ├── next.config.ts # Next.js + zone config
│ └── middleware.ts # i18n middleware
├── buildspec-ci.yaml # Butler sandbox spec
├── cdk.json # CDK configuration
└── package.json # Root (CDK deps, scripts)
PackageVersionPurpose
next16.xFramework
@hema/omni-web-app-shell-shell3.xLayout (header, footer)
@hema/omni-web-app-shell-analytics3.xGTM analytics
@hema/omni-web-app-shell-core3.xCore utilities
@hema/hds-components-react2.1.0-rcUI components
@hema/hds-tailwindcss-presets2.1.0-rcTailwind presets
@hema/hds-assets2.1.0-rcIcons, fonts
next-intl4.xi18n routing
next-sanity12.xSanity client
@hema/monitoring-logger3.xStructured logging
@hema/monitoring-constructs3.xCDK alarms
@hema/omni-web-gateway-management-library-constructs2.xGateway registration
DomainLocaleLanguageCountry
hema.nlnl-nlDutchNetherlands
hema.comnl-beDutchBelgium
hema.comfr-beFrenchBelgium
hema.comfr-frFrenchFrance
hema.comde-deGermanGermany
ProblemSolution
@hema packages not foundRun npm run co:login
CDK deploy fails with VPC errorCheck AWS SSO session: aws sso login
Sanity queries return nullVerify NEXT_PUBLIC_SANITY_DATASET matches your environment
Butler build failsCheck branch name format: feature/word-word
Gateway registration failsEnsure security credentials secret has clientId and clientSecret
Draft mode not workingCheck SANITY_API_READ_TOKEN is set and valid
HDS styles not loadingVerify @hema/hds-tailwindcss-presets in CSS: @import
ResourceURL
Sanity Studio (prod)https://hema-cms.sanity.studio
Service Cataloghttps://servicecatalog.ui.hema.digital
Gateway Preview (NL)Output from cdk deployPreviewUrlNl
Gateway Preview (COM)Output from cdk deployPreviewUrlCom
HDS StorybookCheck hema-design-system repo README