A modern full-stack monorepo built with pnpm workspaces, featuring Angular + Ionic for the frontend and NestJS for the backend.
starter-template/
βββ apps/
β βββ frontend/ # Angular + Ionic app
β βββ backend/ # NestJS API
βββ packages/ # Shared packages
β βββ shared/ # Common types, DTOs, interfaces
β βββ utils/ # Shared utility functions
β βββ config/ # Shared configuration
βββ pnpm-workspace.yaml # pnpm workspace configuration
βββ package.json # Root package.json
- Angular (v20+) - Modern web framework
- Ionic (v8+) - Cross-platform UI components
- Capacitor (v7+) - Native runtime for iOS/Android
- TypeScript - Type-safe development
- NestJS (v11+) - Progressive Node.js framework
- TypeScript - Type-safe development
- Express - HTTP server
- pnpm - Fast, disk space efficient package manager
- pnpm workspaces - Monorepo management
Make sure you have the following installed:
# Node.js (v18+)
node --version
# pnpm (v9+)
npm install -g pnpm
pnpm --version
# Angular CLI (global)
pnpm install -g @angular/cli
# NestJS CLI (global)
pnpm install -g @nestjs/cli
# Ionic CLI (global)
pnpm install -g @ionic/cliIf you installed node@24 via Homebrew, you may need to add it to your PATH:
echo 'export PATH="/opt/homebrew/opt/node@24/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcgit clone <your-repo-url>
cd starter-template
pnpm installThis will install dependencies for all workspaces (frontend, backend, and shared packages).
If you want to recreate this setup from scratch:
# Create Angular app
ng new frontend --package-manager=pnpm
# Choose: Sass (SCSS)
# SSR: NO
# Zoneless: NO
# AI tools: cursor (optional)
cd frontend
# Install Capacitor
pnpm install @capacitor/core
pnpm install -D @capacitor/cli
# Install Ionic
pnpm install @ionic/angular@latest
ng add @ionic/angular# From root directory
nest new backend
# Choose: pnpmCreate pnpm-workspace.yaml in the root:
packages:
- 'apps/*'
- 'packages/*'Create root package.json:
{
"name": "starter-template",
"private": true,
"scripts": {
"frontend": "pnpm --filter frontend start",
"backend": "pnpm --filter backend start",
"dev": "pnpm run --parallel --filter frontend --filter backend start"
}
}Move your apps into apps/ directory:
mkdir -p apps
mv frontend apps/
mv backend apps/Install all dependencies:
pnpm installpnpm frontend
# or
cd apps/frontend && pnpm startFrontend will be available at: http://localhost:4200
pnpm backend
# or
cd apps/backend && pnpm startBackend API will be available at: http://localhost:3000
pnpm devThis runs both frontend and backend in parallel.
pnpm build# Frontend
pnpm --filter frontend build
# Backend
pnpm --filter backend buildpnpm test# Frontend
pnpm --filter frontend test
# Backend
pnpm --filter backend testpnpm lint# Frontend
pnpm --filter frontend lint
# Backend
pnpm --filter backend lintTo create a new shared package:
- Create a new directory in
packages/ - Add a
package.jsonwith a unique name (e.g.,@starter/shared) - Run
pnpm installat the root - Import in your apps using the package name
Example:
// In frontend or backend
import { MyType } from '@starter/shared';# Add to frontend
pnpm --filter frontend add <package-name>
# Add to backend
pnpm --filter backend add <package-name>
# Add to root (dev dependencies)
pnpm add -D -w <package-name>pnpm --filter <app-name> remove <package-name>To build for mobile platforms:
cd apps/frontend
# Initialize Capacitor (if not already done)
npx cap init
# Add platforms
npx cap add ios
npx cap add androidcd apps/frontend
# Build the Angular app
pnpm build
# Sync code to native projects
npx cap sync
# Open in native IDE
npx cap open ios # Opens Xcode
npx cap open android # Opens Android Studio# iOS (requires Xcode and macOS)
npx cap run ios
# Android (requires Android Studio)
npx cap run androidCreate .env file in apps/backend/:
PORT=3000
NODE_ENV=developmentConfigure in apps/frontend/src/environments/:
export const environment = {
production: false,
apiUrl: 'http://localhost:3000'
};MIT