api_graphql_generating - wwwsolutions/nestjs-starter-kit GitHub Wiki
// generate workspace
npx create-nx-workspace@latest --name=wwwsolutions-nest-starter --preset=empty --pm=yarn --npm-scope=wwwsolutions --nx-cloud=false
// rename wwwsolutions --> wwwsolutions-nest-starter
cd wwwsolutions-nest-starter
// Install the "json" utility
yarn add json --global
// Set the base branch to "main"
json -I -f nx.json -e "this.affected.defaultBase = 'main';"
// rename 'master' branch --> 'main'
git branch -m master main
yarn add -D @nrwl/nest
nx generate @nrwl/nest:application --name=api --standaloneConfig --tags=scope:graphql,type:api --no-interactive
nx generate @nrwl/nest:library --name=app --directory=api/graphql/config --buildable --standaloneConfig --strict --tags=type:config,scope:graphql --no-interactive
nx generate @nrwl/nest:library --name=features --directory=api/graphql/config --buildable --standaloneConfig --strict --tags=type:config,scope:graphql --no-interactive
nx generate @nrwl/workspace:library --name=docker --directory=api/graphql/config --buildable --standaloneConfig --strict --tags=type:config,scope:graphql --testEnvironment=node --unitTestRunner=none --no-interactive
nx generate @nrwl/workspace:library --name=codegen --directory=api/graphql/config --buildable --standaloneConfig --strict --tags="type:config","scope:graphql" --testEnvironment=node --unitTestRunner=none --no-interactive
nx generate @nrwl/nest:library --name=core --directory=api/graphql --buildable --service --standaloneConfig --strict --tags=type:config,scope:graphql --no-interactive
nx generate @nrwl/nest:library --name=models --directory=api/graphql/data-access --buildable --standaloneConfig --strict --tags=type:data-access,scope:graphql --no-interactive
nx generate @nrwl/nest:library --name=core --directory=api/graphql/data-access --buildable --standaloneConfig --strict --tags=type:data-access,scope:graphql --no-interactive
nx generate @nrwl/nest:library --name=prisma --directory=api/graphql/data-access --buildable --standaloneConfig --strict --tags=type:data-access,scope:graphql --no-interactive
nx generate @nrwl/nest:library --name=utils --directory=shared --buildable --standaloneConfig --strict --tags=type:util,scope:graphql --no-interactive
Disperse DDD structure {a} --> feature{a} + data-access{a}
nx generate @nrwl/nest:library --name=feature --directory=api/graphql/users --buildable --standaloneConfig --strict --tags=type:feature,scope:graphql --no-interactive
nx generate @nrwl/nest:library --name=data-access --directory=api/graphql/users --buildable --standaloneConfig --strict --tags=type:data-access,scope:graphql --no-interactive
nx generate @nrwl/nest:library --name=feature --directory=api/graphql/authentication --buildable --standaloneConfig --strict --tags=type:feature,scope:graphql --no-interactive
nx generate @nrwl/nest:library --name=data-access --directory=api/graphql/authentication --buildable --standaloneConfig --strict --tags=type:data-access,scope:graphql --no-interactive
nx generate @nrwl/nest:library --name=feature --directory=api/graphql/courses --buildable --standaloneConfig --strict --tags=type:feature,scope:graphql --no-interactive
nx generate @nrwl/nest:library --name=data-access --directory=api/graphql/courses --buildable --standaloneConfig --strict --tags=type:data-access,scope:graphql --no-interactive
nx generate @nrwl/nest:service --name=courses --project=api-graphql-courses-data-access --directory=lib --flat --no-interactive