Update README: Complete project structure documentation

Comprehensive project structure update reflecting current implementation:
- Add all API routes: admin, auth (forgot/reset/register), export, geofences, mqtt, users
- Add all admin panel pages: emails, geofences+events, mqtt, settings, setup, users
- Add all app pages: export, forgot-password, map, register, reset-password, unauthorized
- Document complete components structure: demo, map (MapView + GeofenceLayer), AuthProvider
- List all 18 lib files: geofence system, MQTT system, email service, crypto, geo-utils, etc.
- Add all 15 scripts: geofence tests, MQTT sync, SMTP test, time filter debug, schema tools
- Include new directories: emails/, mosquitto/config+logs, instrumentation.ts
- Add Docker setup: docker-compose.yml, Dockerfile
- Update data/ description: database.sqlite now includes MQTT + Geofences

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-04 11:18:44 +00:00
parent e096ba2600
commit 4fcc5b989f

124
README.md
View File

@@ -856,34 +856,132 @@ server {
location-tracker-app/
├── app/
│ ├── api/
│ │ ├── auth/[...nextauth]/ # NextAuth API
│ │ ├── devices/ # Device CRUD
│ │ ├── locations/ # Location API + Sync/Cleanup/Stats
│ │ └── system/status/ # System Status (Uptime, Memory)
│ │ ├── admin/
│ │ │ ├── emails/
│ │ ├── preview/ # Email Template Preview
│ │ │ │ └── send-test/ # Test Email versenden
│ │ │ └── settings/
│ │ │ └── smtp/ # SMTP Einstellungen + Test
│ │ ├── auth/
│ │ │ ├── [...nextauth]/ # NextAuth API
│ │ │ ├── forgot-password/ # Passwort vergessen
│ │ │ ├── register/ # User Registrierung
│ │ │ └── reset-password/ # Passwort zurücksetzen
│ │ ├── devices/
│ │ │ ├── [id]/ # Device CRUD (einzelnes Device)
│ │ │ ├── public/ # Öffentliche Device-Liste
│ │ │ └── route.ts # Device Liste + Create
│ │ ├── export/
│ │ │ └── csv/ # CSV Export von Locations
│ │ ├── geofences/
│ │ │ ├── [id]/ # Geofence CRUD (einzelner Geofence)
│ │ │ ├── events/ # Geofence Events abfragen
│ │ │ └── route.ts # Geofence Liste + Create
│ │ ├── locations/
│ │ │ ├── cleanup/ # Alte Locations löschen
│ │ │ ├── ingest/ # Location Import (MQTT)
│ │ │ ├── optimize/ # DB Optimization (VACUUM)
│ │ │ ├── stats/ # DB Statistiken
│ │ │ ├── test/ # Test-Location hinzufügen
│ │ │ └── route.ts # Location Query API
│ │ ├── mqtt/
│ │ │ ├── acl/
│ │ │ │ ├── [id]/ # ACL Rule CRUD
│ │ │ │ └── route.ts # ACL Rules Liste + Create
│ │ │ ├── credentials/
│ │ │ │ ├── [device_id]/ # MQTT Credentials CRUD
│ │ │ │ └── route.ts # Credentials Liste + Create
│ │ │ ├── send-credentials/ # Credentials per Email versenden
│ │ │ └── sync/ # Mosquitto Config Sync
│ │ ├── system/
│ │ │ └── status/ # System Status (Uptime, Memory)
│ │ └── users/
│ │ ├── [id]/ # User CRUD (einzelner User)
│ │ └── route.ts # User Liste + Create
│ ├── admin/
│ │ ├── devices/ # Device Management
│ │ ├── emails/ # Email Template Management
│ │ ├── geofences/
│ │ │ ├── events/ # Geofence Event History
│ │ │ └── page.tsx # Geofence Management
│ │ ├── mqtt/ # MQTT Provisioning
│ │ ├── settings/ # SMTP Settings (Super Admin)
│ │ ├── setup/ # Setup Guide
│ │ ├── users/ # User Management
│ │ ├── layout.tsx # Admin Layout + Navigation
│ │ └── page.tsx # Dashboard
│ ├── export/ # CSV Export Seite
│ ├── forgot-password/ # Passwort vergessen Seite
│ ├── login/ # Login-Seite
│ ├── page.tsx # Öffentliche Karte
│ ├── map/ # Karten-Seite (alternative Route)
│ ├── register/ # Registrierungs-Seite
│ ├── reset-password/ # Passwort zurücksetzen Seite
│ ├── unauthorized/ # Unauthorized Access Seite
│ ├── page.tsx # Öffentliche Karte (Home)
│ └── layout.tsx # Root Layout
├── components/
── map/
└── MapView.tsx # Leaflet Map Component
── demo/
└── DemoMap.tsx # Demo Map Component
│ ├── map/
│ │ ├── GeofenceLayer.tsx # Geofence Visualization Layer
│ │ └── MapView.tsx # Leaflet Map Component
│ └── AuthProvider.tsx # Auth Context Provider
├── lib/
│ ├── auth.ts # NextAuth Config
── db.ts # SQLite Database Layer
── crypto-utils.ts # Encryption/Decryption Utils
│ ├── db.ts # SQLite Database Layer (User/Devices)
│ ├── demo-data.ts # Demo/Test Data Generator
│ ├── devices.ts # Device Helper Functions
│ ├── email-renderer.ts # React Email Renderer
│ ├── email-service.ts # Email Service (Nodemailer)
│ ├── geofence-db.ts # Geofence Database Layer
│ ├── geofence-engine.ts # Geofence Detection Engine
│ ├── geofence-notifications.ts # Geofence Notification Handler
│ ├── geo-utils.ts # Geolocation Utils (Haversine)
│ ├── mosquitto-sync.ts # Mosquitto Config File Sync
│ ├── mqtt-db.ts # MQTT Database Layer
│ ├── mqtt-subscriber.ts # MQTT Subscriber Service
│ ├── password-reset-db.ts # Password Reset Token DB
│ ├── settings-db.ts # Settings Database Layer
│ ├── startup.ts # Application Startup Logic
│ ├── types.ts # TypeScript Type Definitions
│ └── types/
│ └── smtp.ts # SMTP Type Definitions
├── scripts/
│ ├── add-test-location.js # Test-Location hinzufügen
│ ├── cleanup-old-locations.js # Alte Locations löschen
│ ├── init-database.js # Database.sqlite Setup
│ ├── init-geofence-db.js # Geofence Tables Setup
│ ├── init-locations-db.js # Locations.sqlite Setup
│ ├── reset-admin.js # Admin User Reset
│ ├── remove-duplicates.js # Duplikate bereinigen
── cleanup-old-locations.js # Alte Daten löschen
── reset-admin.js # Admin User Reset
│ ├── show-schema.js # DB Schema anzeigen
│ ├── sync-mqtt-config.ts # MQTT Config manuell syncen
│ ├── test-geofence.js # Geofence Detektion testen
│ ├── test-geofence-email.js # Geofence Email testen
│ ├── test-geofence-notification.js # Geofence Notification testen
│ ├── test-mqtt-geofence.js # MQTT Geofence Integration testen
│ ├── test-smtp.js # SMTP Connection testen
│ └── test-time-filter.js # Zeitfilter debuggen
├── data/
│ ├── database.sqlite # User + Devices
│ ├── database.sqlite # User + Devices + MQTT + Geofences
│ └── locations.sqlite # Location Tracking
├── emails/ # React Email Templates
│ └── geofence-alert.tsx # Geofence Alert Email Template
├── mosquitto/
│ ├── config/ # Mosquitto Config Files
│ │ ├── mosquitto.conf # Broker Config
│ │ ├── password.txt # Password File (bcrypt hashes)
│ │ └── acl.txt # ACL Rules File
│ └── logs/ # Mosquitto Log Files
├── public/ # Static Assets
├── types/
│ └── location.ts # TypeScript Interfaces
── middleware.ts # Route Protection
│ └── (deprecated - moved to lib/types.ts)
── middleware.ts # Route Protection Middleware
├── instrumentation.ts # Next.js Instrumentation Hook
├── docker-compose.yml # Docker Compose Setup
├── Dockerfile # App Docker Image
└── package.json # Dependencies + Scripts
```
---