How echynnz/ecinamprem works
This is a web service for sending email magic links and using them to sign in and attempt premium activation. The main workflow is served through the API router: request a link, submit the link and owner message, authenticate, check prior registration, attempt activation, then record and report the outcome. Separate endpoints expose health, status, history and statistics. Turso-backed registration and activation data support these flows; an optional Telegram bot sends notifications and provides server-status and history commands. Source excerpts establish the main calls; unsampled route and storage behavior is included only where the SOURCE INDEX identifies it.
Main entry points: verify-link/route.js Verify endpoint · api/route.js API router · history.js Activation history · auth.js Auth and activation
Components 22
Web runtime
- Express server
server.js - Web client
public/index.html
API endpoints
- API router
app/api/route.js - Status endpoint
app/api/status/route.js - Send-link endpoint
app/api/send-link/route.js - Verify endpoint
app/api/verify-link/route.js - Health endpoint
app/api/health/route.js - History endpoint
app/api/history/route.js - Stats endpoint
app/api/stats/route.js
Activation services
- Auth and activation
lib/auth.js - Auth error mapping
lib/errors.js - Audit logging
lib/audit.js
Persistence
- Registration records
lib/registrations.js - Activation history
lib/history.js - Activation statistics
lib/stats.js - Turso database
lib/db.js
Telegram operations
- Telegram bot
lib/telegram.js
Other components
- Web user
- Firebase Identity Toolkit
- Purchase verification service
- Turso
- Telegram service
Connections 30
- Express server → Web client: serves static files
server.js - Express server → API router: mounts API
server.js - Express server → Telegram bot: starts bot
server.js - API router → Status endpoint: routes requests
app/api/route.js - API router → Send-link endpoint: routes requests
app/api/route.js - API router → Verify endpoint: routes requests
app/api/route.js - API router → Health endpoint: routes requests
app/api/route.js - API router → History endpoint: routes requests
app/api/route.js - API router → Stats endpoint: routes requests
app/api/route.js - Send-link endpoint → Auth and activation: requests magic link
app/api/send-link/route.js - Send-link endpoint → Auth error mapping: maps errors
app/api/send-link/route.js - Verify endpoint → Auth and activation: authenticates and activates
app/api/verify-link/route.js - Verify endpoint → Auth error mapping: maps errors
app/api/verify-link/route.js - Verify endpoint → Registration records: checks and records
app/api/verify-link/route.js - Verify endpoint → Activation history: records activation
app/api/verify-link/route.js - Verify endpoint → Activation statistics: gets statistics
app/api/verify-link/route.js - Verify endpoint → Audit logging: writes audit events
app/api/verify-link/route.js - Verify endpoint → Telegram bot: sends notifications
app/api/verify-link/route.js - History endpoint → Activation history: reads history
app/api/history/route.js - Stats endpoint → Activation statistics: gets statistics
app/api/stats/route.js - Health endpoint → Turso database: checks database
app/api/health/route.js - Auth and activation → Firebase Identity Toolkit: calls identity APIs
lib/auth.js - Auth and activation → Purchase verification service: requests verification
lib/auth.js - Registration records → Turso database: reads and writes
lib/registrations.js - Activation history → Turso database: reads and writes
lib/history.js - Activation statistics → Activation history: gets counts
lib/stats.js - Turso database → Turso: queries database
lib/db.js - Telegram bot → Activation history: reads history
lib/telegram.js - Telegram bot → Telegram service: sends messages and polls
lib/telegram.js - Web user → Web client: uses client