- Add SensorReading model with CO2, temperature, humidity, window state, timestamp - Add RoomService and SensorService with HTTP calls and mock data fallback - Rewrite RoomMapComponent: SVG floor plan, CO2-based coloring, tooltips, navigation - Rewrite RoomDetailsPanelComponent: sensor history table with pagination (8 rows/page) - Add FooterComponent with current year, fix header/footer sticky layout - Update LegendComponent template and styles for two-line item layout - Add provideHttpClient() to app.config.ts - Add getCO2Color() and getCO2Level() helpers to co2-levels.config.ts - Add 85 unit tests across all components, services, and config helpers Closes #28 Closes #29
PI_E2EEDA - Angular Dashboard
Angular 18 dashboard for real-time air quality visualization.
Quick Start
# Install dependencies
npm install
# Start dev server
npm start
# http://localhost:4200
# Build for production
npm run build
# dist/dashboard/
Structure
src/
├── app/
│ ├── components/ # UI Components
│ │ ├── room-map/ # Interactive 2D map
│ │ ├── room-details-panel/
│ │ ├── header/
│ │ └── legend/
│ ├── services/ # Angular services
│ │ ├── analytics.service.ts
│ │ └── websocket.service.ts
│ ├── models/ # TypeScript interfaces
│ ├── guards/ # Route guards
│ └── interceptors/ # HTTP interceptors
├── environments/ # Environment configs
└── assets/ # Images, fonts, etc.
Available Scripts
npm start # Dev server (port 4200)
npm run build # Production build
npm run lint # ESLint
npm run format # Prettier
npm test # Unit tests (Karma)
npm run e2e # E2E tests (Cypress)
Technologies
- Angular: 18.2.x
- TypeScript: 5.4.x
- RxJS: 7.8.x
- Chart.js: 4.4.x
- Angular Material: 18.2.x
Environments
Development
- API:
http://localhost:8080 - WebSocket:
ws://localhost:8080/ws
Production
- API:
https://ui.e.kb28.ch/api - WebSocket:
wss://ui.e.kb28.ch/ws
Conventions
- Components: kebab-case (
room-map) - Services: camelCase with suffix (
analytics.service.ts) - Models: kebab-case with
.model.tssuffix (room-data.model.ts) - Standalone components only
- Signals for state management
Tests
# Unit tests
npm test
# Coverage
npm run test:coverage
# coverage/index.html
Build & Deploy
# Production build
npm run build
# Output
dist/dashboard/
├── index.html
├── main.*.js
├── polyfills.*.js
└── styles.*.css
# Deploy (Docker)
docker build -t e2eeda/ui:latest .
docker run -p 80:80 e2eeda/ui:latest
Debugging
Common Issues
CORS errors:
# Proxy configured in angular.json for /api
# Or add to package.json:
"start": "ng serve --proxy-config proxy.conf.json"
WebSocket connection failed:
// Check URL in environment.ts
wsUrl: 'ws://localhost:8080/ws' // port can change