Zum Hauptinhalt springen

Zurück zum Devlog

Sonntag, 15. März 2026

Feature

8 Commits

7 min Lesezeit

Traces App Integration & Calendar Production Hardening

Traces App mit NestJS Backend und Expo Mobile ins Monorepo integriert. Calendar mit Security Fixes, Rate Limiting und Accessibility Verbesserungen produktionsreif gemacht.

T

Till Schneider

Autor

Intensiver Tag mit 8 Commits für eine neue App-Integration und Production Hardening:

  • Traces App - AI City Guides mit NestJS Backend und Expo Mobile
  • Calendar Security - Rate Limiting, Input Validation, CSRF Protection
  • Calendar Performance - Query Optimization, Connection Pooling
  • EAS Build Fixes - .npmrc und Dockerfile Healthcheck Ports

Traces App Integration

Traces ist eine neue App für AI-generierte City Guides. Die App wurde komplett ins Monorepo integriert.

Architektur

apps/traces/
├── apps/
│   ├── backend/     # NestJS API (Port 3012)
│   │   ├── src/
│   │   │   ├── guides/       # AI City Guide Generation
│   │   │   ├── locations/    # POI Management
│   │   │   └── routes/       # Route Planning
│   │   └── package.json
│   └── mobile/      # Expo React Native
│       ├── app/
│       │   ├── (tabs)/       # Tab Navigation
│       │   ├── guide/        # Guide Detail Screens
│       │   └── map/          # Map View
│       └── package.json
└── package.json

Backend Features

FeatureBeschreibung
AI GuidesLLM-basierte Stadtführer-Generierung
POI DatabaseSehenswürdigkeiten mit Geodaten
Route PlanningOptimierte Routen zwischen POIs
Auth Integrationmana-core-auth via shared-nestjs-auth

Mobile App

  • Expo SDK 55 mit expo-router
  • MapView Integration für Routen-Visualisierung
  • Offline-Cache für heruntergeladene Guides

Calendar Production Hardening

Der Calendar wurde mit umfassenden Security- und Performance-Fixes produktionsreif gemacht.

Security Fixes

Rate Limiting

// Rate Limiting pro Endpoint
@UseGuards(ThrottlerGuard)
@Throttle({ default: { limit: 100, ttl: 60000 } })
@Controller('api/events')
export class EventsController {
	@Throttle({ default: { limit: 10, ttl: 60000 } })
	@Post()
	async createEvent() {
		// Max 10 Events pro Minute
	}
}

Input Validation

Strikte Validation für alle API Endpoints:

export class CreateEventDto {
	@IsString()
	@MaxLength(200)
	title: string;

	@IsISO8601()
	startDate: string;

	@IsISO8601()
	endDate: string;

	@IsOptional()
	@MaxLength(5000)
	description?: string;
}

CSRF Protection

// Helmet Security Headers
app.use(helmet());
app.use(
	helmet.contentSecurityPolicy({
		directives: {
			defaultSrc: ["'self'"],
			scriptSrc: ["'self'"],
		},
	})
);

Performance Fixes

FixVorherNachher
Event QueryN+1 QueriesSingle JOIN Query
Connection PoolDefault (5)Konfigurierbar (20)
Response SizeAlle FelderSelektive Projektion

Accessibility Verbesserungen

  • ARIA Labels für alle interaktiven Elemente
  • Keyboard Navigation im Event-Dialog
  • Focus Management beim Modal-Open/Close
  • Screen Reader Announcements für Kalender-Navigation

Auto-Generate CALENDAR_ENCRYPTION_KEY

Der Encryption Key für Calendar-Daten wird in Production automatisch generiert, falls nicht gesetzt.

// Fallback Key Generation
const encryptionKey = process.env.CALENDAR_ENCRYPTION_KEY || crypto.randomBytes(32).toString('hex');

if (!process.env.CALENDAR_ENCRYPTION_KEY) {
	logger.warn('CALENDAR_ENCRYPTION_KEY not set, using generated key');
	logger.warn('Set CALENDAR_ENCRYPTION_KEY for persistent encryption');
}

Dockerfile Healthcheck Ports

Die Healthcheck-Ports in den Dockerfiles waren hardcoded und stimmten nicht mit den tatsächlichen Service-Ports überein.

- HEALTHCHECK CMD curl -f http://localhost:3000/health || exit 1
+ HEALTHCHECK CMD curl -f http://localhost:${PORT:-3000}/health || exit 1

EAS Build: .npmrc für Hoisted Mode

Für alle Mobile Apps wurde .npmrc mit node-linker=hoisted hinzugefügt, um EAS Build Kompatibilität sicherzustellen.

# .npmrc
node-linker=hoisted

patch-package Non-Fatal

In picture-mobile wurde patch-package im postinstall Script non-fatal gemacht, da fehlende Patches den EAS Build abbrechen konnten.

- "postinstall": "patch-package"
+ "postinstall": "patch-package || true"

Zusammenfassung

BereichCommitsHighlights
Traces2NestJS Backend + Expo Mobile
Calendar Security3Rate Limiting, Validation, CSRF
Calendar A11y1ARIA, Keyboard, Focus
Build Infra2Healthcheck, .npmrc, patch-package

Nächste Schritte

  1. Traces API - Weitere Guide-Endpoints implementieren
  2. Calendar E2E Tests - Playwright Tests für kritische Flows
  3. Calendar Monitoring - Error Tracking und Performance Metrics
  4. Traces TestFlight - Erster iOS Build

Tags

#traces #calendar #security #production #rate-limiting #expo #eas-build