A modern, full-stack monorepo starter built with Nx, Angular, Node.js, and Firebase. Ship web, mobile, and desktop applications from a single repository with GraphQL, real-time database integration, and enterprise-grade tooling.
nx-ng-starter is a starter template that eliminates boilerplate configuration for modern full-stack applications. It combines the monorepo power of Nx with the reactive paradigm of Angular, a scalable Node.js backend, and Firebase for authentication, database, and deployment.
Whether you're building a web application, a mobile app with Capacitor, a desktop app with Electron, or all three — this starter provides the foundation with best practices baked in.
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Angular | The framework for building scalable web applications. |
| Frontend | Angular Material | Material design components for Angular. |
| Frontend | NgRx | User Interface state management. |
| Mobile | Capacitor | Cross-platform Android applications. |
| Desktop | Electron | Cross-platform desktop applications. |
| Backend | NestJS | Node.js framework for building scalable server-side applications. |
| Backend | Express GraphQL Server | Type-safe API layer. |
| Documentation | Compodoc | Documentation tool form Angular frontends and NestJS backends. |
| Quality Assurance | Vitest | Next generation unit testing framework. |
| Quality Assurance | Cypress | Versatile browser testing framework. |
| Database | Firestore / Realtime Database | Cloud-hosted database. |
| Authentication | Firebase Auth | User identity and access control. |
| Deployment | Firebase Hosting & Cloud Functions | Serverless deployment infrastructure. |
| Containerization | Docker | Containerized services. |
| Build Tool | Nx | Monorepo build orchestration. |
| Package Manager | Yarn | Deterministic dependency management. |
| CI/CD | GitHub Actions | Software workflow automation. |
functions folder.recommendedyarn install:all:linux should install everything needed to work with the project;should work due to its similarity to Linuxyarn install:all:osx should install everything needed to work with the project;should work, but no guaranteesprotolint, see available installation options;shellcheck via PowerShell;Example :iwr -useb get.scoop.sh | iex
scoop install shellcheckGit BASH;git config --global core.autocrlf false
git config --global core.eol lfgit clone https://github.com/rfprod/nx-ng-starter.git
cd nx-ng-starteryarn setupCreate a firebase.json file in the root directory with your Firebase project credentials:
{
"projects": {
"default": "your-firebase-project-id"
}
}Alternatively, set environment variables:
Example :export FIREBASE_PROJECT_ID=your-project-id
export FIREBASE_API_KEY=your-api-keyyarn startThis will start:
Follow the Trunk Based Development methodology to propose changes to the main branch.
Using commitizen cli is mandatory.
Provided all dependencies are installed, and commitizen cli is installed as a global dependency, this command must be used.
Example :git czFind all supported commands:
Example :npx nx run tools:helpFind all supported start commands:
npx nx run tools:help --search startFind all supported build commands:
npx nx run tools:help --search buildFind all supported test commands:
npx nx run tools:help --search testFind all supported firebase commands:
npx nx run tools:help --search firebaseFind all supported docker commands:
npx nx run tools:help --search dockerThis section explains how to run the Envoy Unified Reverse Proxy locally with the api-production and client-production containers on a shared Docker network.
Built images:
rfprod/nx-ng-starter:api-production-latestrfprod/nx-ng-starter:client-production-latestrfprod/nx-ng-starter:envoy-latestThe setup uses a shared Docker network named nx-ng-apps for container-to-container communication with STRICT_DNS resolution.
The run script creates the network automatically if it does not exist.
The script automatically:
nx-ng-apps network if it doesn't existWhile it is possible to operate containers manually, it is recommended to use existing scripts.
sudo bash tools/shell/docker/run.sh api-productionThe API runs on internal port 8080 and is accessible within the network as api-production:8080.
sudo bash tools/shell/docker/run.sh client-productionThe client runs on internal port 8080 and is accessible within the network as client-production:8080.
sudo bash tools/shell/docker/run.sh envoyThe Envoy proxy listens on:
The Envoy configuration (.envoy/envoy.yml) defines two routes:
| Route | Destination | Cluster | Prefix Rewrite |
|---|---|---|---|
/api/* | API backend | api_backend → api-production:8080 | / |
/ | Web client | web_client → client-production:8080 | None |
curl http://localhost:8090/Returns the Angular UI from client-production.
curl http://localhost:8090/api/Returns the Swagger documentation from api-production, redirects to http://localhost:8090/api/index.html.
curl http://localhost:9901/statsInside the shared network, containers resolve each other by name:
api-production → reaches the API backendclient-production → reaches the web clientThis is enabled by Envoy's STRICT_DNS cluster type, which performs DNS lookups using the Docker embedded DNS resolver.
Stop all containers:
Example :sudo docker stop api-production client-production envoyRemove the network (if no longer needed):
Example :sudo docker network rm nx-ng-appsfeature librarynpx nx generate client-feature client-<feature-name> --tags=scope:client-<feature-name>,type:featureui librarynpx nx generate client-ui client-<feature-name> --tags=scope:client-<feature-name>,type:uidata-access librarynpx nx generate client-store client-store-<feature-name> --tags=scope:client-store-<feature-name>,type:data-accessutil librarynpx nx generate client-util client-util-<feature-name> --tags=scope:client-util-<feature-name>,type:utilnpx nx generate module-boundariesnpx nx dep-graphThe GitBook documentation is generated based on this GitHub repo.
Application deployments and autogenerated engineering documentation.
This project was generated using Nx.
Refer to the CONTRIBUTING.md file for guidelines.
Good luck! 👍