Installation Guide
This comprehensive guide covers everything you need to know about installing, configuring, and deploying Air Tracker.System Requirements
Required Software
Node.js
Version: 18.x or higher (LTS recommended)Air Tracker is tested with Node.js v24.13.1 but any version 18.x+ should work.
Package Manager
Options: npm (7+), yarn (1.22+), or pnpm (8+)npm comes bundled with Node.js.
TypeScript
Version: ~5.9.2Automatically installed as a dev dependency.
Angular CLI
Version: ^20.2.2Optional but recommended for development.
System Specifications
- OS: Windows 10+, macOS 10.15+, or Linux (Ubuntu 20.04+)
- RAM: Minimum 4GB (8GB recommended for development)
- Disk Space: At least 500MB for node_modules and build artifacts
- Browser: Modern browser with ES2022 support (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+)
Installation Steps
1. Install Node.js
If you don’t have Node.js installed:macOS Installation
macOS Installation
Using Homebrew:Using nvm (recommended):
Windows Installation
Windows Installation
Using official installer:Using nvm-windows:
- Download from nodejs.org
- Run the installer
- Verify installation:
Linux Installation
Linux Installation
Using package manager (Ubuntu/Debian):Using nvm:
2. Clone the Repository
3. Install Dependencies
package.json, including:
Core Dependencies:
@angular/core(^20.2.0) - Angular framework@angular/common(^20.2.0) - Common Angular APIs@angular/router(^20.2.0) - Routing and navigation@angular/forms(^20.2.0) - Form handling@angular/material(^20.2.14) - Material Design componentsleaflet(^1.9.4) - Interactive mapsleaflet-moving-rotated-marker(^0.0.1) - Animated flight markersrxjs(~7.8.0) - Reactive programming
@angular/cli(^20.2.2) - Angular command-line toolstypescript(~5.9.2) - TypeScript compilerjasmine-core(~5.9.0) - Testing frameworkkarma(~6.4.0) - Test runnereslint(^9.39.1) - Code linting
The installation typically takes 2-5 minutes depending on your internet connection and system performance.
Environment Configuration
Development Environment
The development environment configuration is located atsrc/environments/environment.ts:
production: Set tofalsefor development modeapiBaseUrl: Backend API endpoint (default:http://localhost:3000/api)features.enableFavorites: Enable/disable favorite flights featurefeatures.enableStats: Enable/disable statistics display
Production Environment
The production environment configuration is atsrc/environments/environment.production.ts:
Custom Configuration
To customize the configuration:-
Copy the environment file:
-
Update your values:
- Update angular.json to use your custom environment (optional)
Running the Application
Development Server
Start the development server:http://localhost:4200/.
Development Server Features:
- Hot Module Replacement (HMR)
- Source maps for debugging
- No optimization for faster builds
- Detailed error messages
Production Build
Build the application for production:ng build with the production configuration, which includes:
- Environment replacement: Swaps
environment.tswithenvironment.production.ts - Optimization: Minification, tree-shaking, and dead code elimination
- Output hashing: Cache-busting file names
- AOT compilation: Ahead-of-time compilation for faster runtime
dist/air-tracker-frontend/browser/ directory.
Running Tests
Unit Tests
Run unit tests with Karma:- Jasmine testing framework
- Chrome headless browser
- Code coverage reports
- Watch mode for continuous testing
Linting
Run ESLint to check code quality:- ESLint 9.39.1
- angular-eslint 21.0.1
- TypeScript ESLint 8.46.4
Common Installation Issues
Node version mismatch
Node version mismatch
Problem: “The engine ‘node’ is incompatible with this module”Solution:
npm install fails with EACCES
npm install fails with EACCES
Problem: Permission errors during npm installSolution:
Port 4200 already in use
Port 4200 already in use
Problem: “Port 4200 is already in use”Solution:
Leaflet CSS not loading
Leaflet CSS not loading
Problem: Map tiles not displaying correctlySolution: Verify that Leaflet CSS is included in Restart the dev server after making changes to
angular.json:angular.json.TypeScript compilation errors
TypeScript compilation errors
Problem: Strict mode TypeScript errorsSolution: The project uses strict TypeScript settings:Ensure your code follows these strict rules. Common fixes:
- Add explicit return types
- Handle all code paths in functions
- Use proper type annotations
- Avoid implicit
anytypes
Backend API connection fails
Backend API connection fails
Problem: “Failed to fetch” or CORS errorsSolution:
-
Check API is running:
-
Update environment.ts:
-
Configure CORS on your backend to allow
http://localhost:4200 -
Use proxy configuration (create
proxy.conf.json):Then run:
Build Optimization
Bundle Analysis
Analyze your bundle size:Performance Tips
Reduce Bundle Size
- Use lazy loading for routes
- Import only necessary Angular Material modules
- Enable tree-shaking in production
- Compress assets with gzip/brotli
Deployment
Static Hosting
Deploy to static hosting services:Docker Deployment
Create aDockerfile:
Additional Resources
Getting Help
If you encounter issues not covered in this guide:- Check the GitHub Issues
- Review Angular CLI documentation
- Search Stack Overflow with the
angulartag - Join the Angular community on Discord
