# 🏗️ Angular monorepo with Nx + pnpm > ⚠️ This guide is **pending revision**: the placeholder workspace name (`my-workspace`) and app name (`web`) must be replaced with project-specific values, and the procedure must be extended to cover the Node API / BFF side. Treat the steps below as a baseline only. ## Goal Create a scalable and maintainable architecture. --- ## 1) Workspace creation ```bash cd ~/dev pnpm dlx create-nx-workspace@latest my-workspace \ --preset=angular-monorepo \ --pm=pnpm \ --appName=web \ --style=scss \ --routing=true \ --unitTestRunner=vitest ``` --- ## 2) Recommended layout ```text apps/ web/ libs/ shared/ui/ shared/data-access/ shared/util/ feature/auth/ ``` --- ## 3) Generate libraries ```bash pnpm nx g @nx/angular:library shared-ui pnpm nx g @nx/angular:library feature-auth ``` --- ## 4) Main commands ```bash pnpm nx serve web pnpm nx build web pnpm nx test web pnpm nx lint web ``` --- ## 5) Workspace-wide commands ```bash pnpm nx run-many -t lint test build pnpm nx affected -t lint test build ``` --- ## 6) Prettier `.prettierrc`: ```json { "singleQuote": true, "semi": true, "printWidth": 100 } ``` --- ## 7) Git hooks ```bash pnpm add -D husky lint-staged pnpm exec husky init ``` --- ## 8) CI/CD > ⚠️ The original procedure targeted GitLab CI. The project repository now lives on Gitea, so this section needs to be rewritten for Gitea Actions (or the chosen CI runner). Tracked under the next round of CI ADRs. --- ## 9) Daily workflow ```bash pnpm install pnpm start pnpm nx g component login pnpm nx affected -t lint test build ``` --- ## Result * Scalable monorepo * Optimized builds * Fast CI * Clear architecture