Commit Graph

8 Commits

Author SHA1 Message Date
17aaf130a8 Add automatic documentation synchronization system
Implements Option C (Hybrid) solution to prevent outdated documentation:

New Features:
- Pre-commit git hook that validates documentation before every commit
- npm run docs:check - Validates README against current project state
- npm run docs:sync - Automatically updates NPM Scripts section in README

What gets checked:
- NPM Scripts in package.json vs README
- API routes in app/api/* vs README
- App structure (directories in app/) vs README
- Components vs README
- Scripts vs README

Workflow:
1. Make code changes
2. git commit triggers pre-commit hook
3. Hook warns if documentation is outdated
4. Run docs:sync to auto-update or edit manually
5. Commit with updated README

Benefits:
- No more forgetting to update README
- Non-blocking (can use --no-verify if needed)
- Automatic NPM scripts synchronization
- Clear warnings show exactly what needs updating

Scripts added:
- scripts/check-docs.js - Validation script
- scripts/sync-docs.js - Synchronization script
- .git/hooks/pre-commit - Git hook (not tracked)

Documentation:
- Added complete workflow section in README
- Examples and usage tips included

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 12:27:52 +00:00
4fcc5b989f 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>
2025-12-04 11:18:44 +00:00
e096ba2600 Update README: Add geofencing architecture and update tech stack
Documentation updates:
- Add geofencing feature description with capabilities
- Update database architecture ER diagram with Geofence, GeofenceEvent, and GeofenceStatus tables
- Add complete schema documentation for all geofence tables and indexes
- Update data flow diagram to show geofence monitoring pipeline
- Update component overview with Geofence Monitor
- Update Tech Stack versions: Next.js 16.0.7, React 19.2.1
- Add MQTT.js, Eclipse Mosquitto, Nodemailer, React Email to tech stack
- Update dual-database architecture description
- Add npm run db:init:geofence command documentation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 10:52:23 +00:00
40f882e4bf Remove obsolete documentation files and n8n references
- Delete GEMINI.md (obsolete notes)
- Delete MQTT_TOPIC_FIX.md (obsolete notes)
- Delete OWNTRACKS_SETUP.md (obsolete setup guide)
- Remove n8n reference from README.md

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 08:54:34 +00:00
31c0e1f572 Fix MQTT topic pattern for OwnTracks and implement privacy isolation
CRITICAL FIX: The OwnTracks app publishes to owntracks/<username>/<device_id>,
not owntracks/owntrack/<device_id>. This was causing data delivery failures
and privacy violations.

Changes:
- Fix ACL topic pattern: owntracks/<username>/# (was: owntracks/owntrack/<device_id>)
- Backend now uses MQTT_ADMIN_USERNAME for global subscription
- Update UI forms and placeholders with correct pattern
- Update email template with correct topic format
- Enable Mosquitto ACL file for user isolation
- Add migration script for existing ACL rules
- Update documentation (README, GEMINI.md)

Privacy & Security:
- Each user isolated at MQTT broker level via ACL
- Backend subscribes with admin credentials to owntracks/+/+
- Web UI filters data by parent_user_id for additional security
- GDPR compliant multi-layer defense in depth

Files changed:
- lib/mqtt-db.ts - Updated createDefaultRule() to use username
- app/api/mqtt/credentials/route.ts - Pass username to ACL creation
- app/admin/mqtt/page.tsx - UI forms and state management
- emails/mqtt-credentials.tsx - Email template topic pattern
- lib/mqtt-subscriber.ts - Use admin credentials from env
- mosquitto/config/mosquitto.conf - Enable ACL enforcement
- README.md, GEMINI.md - Documentation updates
- scripts/fix-acl-topic-patterns.js - Migration script
- MQTT_TOPIC_FIX.md - Detailed implementation guide

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 21:49:31 +00:00
e8a5f59e1d Update README with MQTT tables and parent_user_id documentation
Added documentation for:
- parent_user_id column in User table (hierarchical user management)
- mqtt_credentials table with device authentication
- mqtt_acl_rules table for topic permissions
- mqtt_sync_status table for broker synchronization
- All new database indexes
- Updated ER diagram with new relationships

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 13:53:27 +00:00
b1190e2e50 Edit files 2025-11-24 20:33:15 +00:00
843e93a274 first commit 2025-11-24 16:30:37 +00:00