Prerequisites
Before installing the Angular PWA Demo application, ensure you have the following installed on your system:Node.js and npm
Node.js and npm
Node.js version 18.x or higher is required. You can verify your installation:Download from nodejs.org if not installed.
Angular CLI
Angular CLI
Angular CLI version 21.1.3 or higher is recommended:
Git (optional)
Git (optional)
Required if cloning from a repository:
Installation steps
Clone or download the project
If using Git, clone the repository:Alternatively, download and extract the source code to your desired directory.
Install dependencies
Install all required npm packages:This will install all dependencies from package.json, including:
- Angular 21.1.3 (core, common, forms, router, PWA, service worker)
- Angular Material 21.1.3
- Bootstrap 5.3.2 and ng-bootstrap 20.0.0
- Three.js 0.172.0 for 3D graphics
- Chart.js 3.9.1 and ng2-charts 3.1.2
- Socket.io 4.7.4 for real-time features
- Additional utilities (jsPDF, html2canvas, MathJS)
Development server
Start the development server to run the application locally:http://localhost:4200/. The app will automatically reload when you make changes to source files.
The
--disable-host-check flag is used in the start script for development flexibility. Remove this flag in production environments.Build for production
Create an optimized production build:dist/PWA_DEMO_ENV_PROD/ directory.
Build configuration
The production build includes optimizations defined inangular.json:
- Output hashing: All files include content hashes for cache busting
- Service worker: Automatically registered for offline support
- Budget limits:
- Initial bundle: 25MB maximum
- Component styles: 5MB maximum
Running tests
Execute unit tests via Karma:Project structure
After installation, your project structure will look like this:Configuration files
package.json dependencies
The application uses these key dependencies:Web manifest configuration
The PWA manifest (src/manifest.webmanifest) defines the app identity:
Common issues
Port already in use
Port already in use
If port 4200 is already in use, specify a different port:
Node version mismatch
Node version mismatch
Dependency installation fails
Dependency installation fails
Clear npm cache and reinstall:
Service worker not registering
Service worker not registering
Service workers only work in production mode or over HTTPS. Build and serve the production bundle:
Next steps
Now that you have the application installed, proceed to the quick start guide to create your first component and understand the application architecture.Quick start guide
Learn how to build your first Angular component and integrate it with the application