This repo is setup using Yarn workspaces. It is comprised of:
nuxt-app- The statically generated public website.sanity-cms- CMS powered by Sanity.
- Install Node >= 18 (or run
nvm useif using nvm) - Install Node dependencies with
yarn install - Copy the
.env.examplefiles from each workspace and rename them as.env. - At minimum, populate the
SANITY_STUDIO_PROJECT_IDvalues in the.envfiles. You are expected to usedevelopmentfor your local Sanity dataset (PUBLIC_SANITY_DATASET).
Each workspace has a yarn dev command that runs a local webserver on differing ports and features hot module reloading. You'll likely have two terminal windows running yarn --cwd=nuxt-app dev and yarn --cwd=sanity-cms dev simultaneously.
- Deployments should use
PUBLIC_SANITY_DATASET=production. - The CMS is deployed with
yarn --cwd=sanity-cms buildand thesanity-cms/distdirectory will contain the application to serve. - The public site is deployed with
yarn --cwd=nuxt-app generateand thenuxt-app/distdirectory will contain the application to serve.