This is a ready-to-go starter template for Strapi projects. It combines the power of Strapi, NextJS, Shadcn/ui libraries with Turborepo setup and kickstarts your project development.
apps/ui
- UI web app based on NextJS 14 and shadcn/ui (Tailwind) - README.mdapps/strapi
- Strapi v5 API with prepared page-builder components - README.mdpackages/eslint-config
: ESLint configurations for client side applicationspackages/prettier-config
: Prettier configuration with import sort plugin and tailwind plugin includedpackages/typescript-config
: tsconfig JSONs used throughout the monorepo (not used in "strapi" app for now)package.json
change name
and description
according to new project name. Optionally change names in apps and packages too. Keep @repo
prefix if you don't prefer different scope/company.README.md
files of apps to be less general (eg. update projects names, customize tech stack). Project-specific READMEs should not contain general leftovers from the template.apps/
READMEs to set up each app.Procfile
(s) from repository.[After this preparation is done, delete this section from README]
Install extensions listed in the .vscode/extensions.json file and have a better development experience.
# in root
(nvm use) # switch to correct nodejs version (v20)
# install deps for apps and packages that are part of this monorepo
yarn
# Ignore warning "Workspaces can only be enabled in private projects."
# https://github.com/yarnpkg/yarn/issues/8580
It will install dependencies for all packages/
and apps/
:
packages/
don't require any additional setupapps/
probably do and the instructions are described in their READMEs (UI, Strapi). Please, follow them first (e.g. set env vars)After installing dependencies and setting up projects (previous step), you can control all apps using Turbo CLI. Some common commands are wrapped into yarn
scripts. You can find them in root package.json
file. For example:
# run all apps in dev mode (this triggers `yarn dev` script in each app from `/apps` directory)
yarn dev
# build all apps
yarn build
# dev run of specific app(s)
yarn dev:ui
yarn dev:strapi
Husky is installed by default and configured to run following tasks:
lint
(eslint) and format
(prettier) on every commit (pre-commit
hook). To do that, lint-staged library is used. This is a fast failsafe to ensure code doesn't get committed if it fails linting rules and that when it does get committed, it is consistently formatted. Running linters only on staged files (those that have been added to Git index using git add
) is much faster than processing all files in the working directory. The format
task is configured in root .lintstagedrc.js
and run globally for whole monorepo. The lint
task is configured in each app individually and Strapi is skipped by default.
commitlint
on every commit message (commit-msg
hook). It checks if commit messages meet conventional commit format.
yarn commit
- interactive commit message generator π₯. How? Stage files you want to commit (e.g. using VS Code Source Control) and then run this script in the terminal from root and fill in the required information.yarn format
- format code using prettier in whole monorepo. Prettier formats package.json
files too.bash ./scripts/utils/rm-modules.sh
- Remove all node_modules
folders in the monorepo. Useful for scratch dependencies installation.bash ./scripts/utils/rm-all.sh
- Remove all node_modules
, .next
, .turbo
, .strapi
, dist
folders../scripts/heroku/heroku-postbuild.sh
- Script for Heroku deployment to decide which app to build. It can be removed if not deploying to Heroku.This repo was created based on @dev-templates-public. If you encounter a problem with the template code during development, or something has changed/is being done differently in the meantime, or you have implemented a useful feature that should be part of that template, please create an issue with a description or PR in that repository. So we can keep those templates updated and great features. Thanks.