5 Commits

Author SHA1 Message Date
e76082df92 feat: add ioBroker REST API integration
- New iobroker_sources + iobroker_states tables
- Source manager with discover, test, CRUD
- State poller (10s interval, getBulk endpoint)
- REST API routes under /api/iobroker
- Frontend page with search + pagination
- Sidebar link, app route

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:13:23 +02:00
e760853781 refactor: migrate from node-sqlite3-wasm to better-sqlite3
Replace all db.run(sql, [params]) calls with db.prepare(sql).run(...params)
across all source modules and test files. Also remove the node-sqlite3-wasm
import from tests/db.test.ts and update the type annotation accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 21:17:44 +02:00
9e96ecc231 feat(app): wire up Express app factory and production entry point (Task 13)
Initializes DB, creates default admin user, connects brokers/PG sources,
starts query timers, and serves frontend/dist as SPA.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 12:56:43 +02:00
f7d16c077e feat(middleware): add JWT auth module with bcryptjs login and protected routes
- src/api/middleware/auth.ts: signToken, verifyToken, authMiddleware (Bearer JWT, 24h expiry)
- src/api/routes/auth.ts: POST /api/auth/login (bcryptjs verify) and GET /api/auth/me (protected)
- src/index.ts: mount auth router at /api/auth
- tests/api/auth.test.ts: 7 tests covering login success, wrong password, no token, invalid token, valid access
- Using bcryptjs (pure JS) instead of bcrypt (requires Visual Studio on Windows)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 12:46:50 +02:00
00968a4626 feat(middleware): scaffold Node.js/Express/TypeScript project with health endpoint
- package.json with express, better-sqlite3, mqtt, pg, bcrypt, jsonwebtoken, cors
- tsconfig.json targeting ES2022/commonjs
- src/index.ts with GET /health on port 4000
- vitest.config.ts for test runner configuration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 12:40:54 +02:00