notum-cz / strapi-next-monorepo-starter

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.
56 stars 2 forks source link
nextjs shadcn-ui strapi tailwindcss turborepo

πŸ”₯ Strapi v5 & NextJS Monorepo Starter

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.

πŸ₯ž Tech stack

✨ Features

πŸ“¦ What's inside?

Apps

Packages

πŸš€ Setup and usage

Transform this template to a project

[After this preparation is done, delete this section from README]

VSCode Extensions

Install extensions listed in the .vscode/extensions.json file and have a better development experience.

Prerequisites

Installation

# 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/:

Run - turborepo scripts

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 tasks

Husky is installed by default and configured to run following tasks:

  1. 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.

  2. commitlint on every commit message (commit-msg hook). It checks if commit messages meet conventional commit format.

πŸ“Ώ Scripts

Package.json

Utils

Heroku

πŸ’™ Feedback

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.