You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install Angular CLI globally if not already installed:
pnpm add -g @angular/cli
Now scaffold Angular projects inside apps:
cd apps/web
ng new web --directory . --skip-install
pnpm install
cd ../admin
ng new admin --directory . --skip-install
pnpm install
Update apps/web/angular.json and apps/admin/angular.json with different outputPath if needed to avoid conflicts.
5. Create Express API App
Go to apps/api and initialize:
cd ../api
pnpm init -y
pnpm add express
Create a simple index.js:
// apps/api/index.js
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
app.get('/api/hello', (req, res) => {
res.json({ message: 'Hello from Express API' });
});
app.listen(PORT, () => {
console.log(`API running at http://localhost:${PORT}`);
});
If you need shared TypeScript interfaces or services, create packages/shared:
mkdir -p packages/shared
pnpm init -y
Add a shared file like interfaces.ts, and reference it via tsconfig.paths in Angular and Express apps.
8.Run All Projects
pnpm dev:all
Runng URL's
http://localhost:4200 - Web Application
http://localhost:4201 - Admin Portal
http://localhost:3000 - API