yarn global add nx
# start with an empty monorepo and use nx as the cli (vs angular)
yarn create nx-workspace [monorepo_name] --preset=empty --cli=nx
# start with empty monorepo using yarn package manager and js/ts plugin installed
yarn create nx-workspace --package-manager=yarn --preset=ts
cd [monorepo_name]
If starting a fresh project w/ yarn preferred, consider removing package-lock.json and running yarn
.
yarn add -D @nrwl/next
yarn add -D @nrwl/nest
nx generate @nrwl/next:application client
nx generate @nrwl/nest:application api --frontendProject client
You may wish to add a script to package.json for the API:
"start:api": "nx serve api"
nx commands reference: https://nx.dev/latest/node/getting-started/nx-cli