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 use
if using nvm) - Install Node dependencies with
yarn install
- Copy the
.env.example
files from each workspace and rename them as.env
. - At minimum, populate the
SANITY_STUDIO_PROJECT_ID
values in the.env
files. You are expected to usedevelopment
for 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 build
and thesanity-cms/dist
directory will contain the application to serve. - The public site is deployed with
yarn --cwd=nuxt-app generate
and thenuxt-app/dist
directory will contain the application to serve.