Architecture
Live docs URL: https://mrgionsi.github.io/ring-intercom-control/
Components
backend/: Express API, auth/session, Ring integration, SQLite persistencefrontend/: React + Vite app for admin/user/guest operationswebsite/: Docusaurus documentation site
High-level flow
- User authenticates against backend session auth.
- Frontend calls backend
/api/*endpoints. - Backend decrypts Ring refresh token and performs Ring API operations.
- Data is persisted in SQLite (
data.db) and sessions in SQLite store.
Data model highlights
- Users and roles (
admin,user) - Ring accounts per user
- Guest links with date-range and usage limits
- Unlock events and login audit trails
Security boundaries
- CSRF enforced for authenticated write routes
- Tokens encrypted at rest with
MASTER_KEY - Session cookies signed with
SESSION_SECRET
Use case: B&B check-in/check-out flow
- Host creates a guest link for a booking with
startsAt= check-in date/time andexpiresAt= check-out date/time. - Host optionally sets
maxUses(for example 1 or 2 uses per stay). - Guest receives the link and can unlock only while the link is valid.
- After check-out, the link becomes expired automatically (or can be disabled manually).
- Unlock attempts are recorded in audit logs for operational traceability.