You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2026. It is now read-only.
Issue #618 adds the visitor analytics schema and #619 adds the helper layer. This issue wires analytics collection into the request lifecycle.
AWCMS-Mini already uses src/middleware.ts as the request-level choke point for correlation ID propagation, security headers, admin route guarding, and SSR context resolution. Visitor analytics should hook into that flow carefully without making analytics writes a critical dependency for admin/public page rendering.
Objective
Collect lightweight visitor telemetry for admin and public requests, updating visitor presence and inserting visit events while preserving offline/LAN behavior and fail-open safety.
Context
Issue #618 adds the visitor analytics schema and #619 adds the helper layer. This issue wires analytics collection into the request lifecycle.
AWCMS-Mini already uses
src/middleware.tsas the request-level choke point for correlation ID propagation, security headers, admin route guarding, and SSR context resolution. Visitor analytics should hook into that flow carefully without making analytics writes a critical dependency for admin/public page rendering.Objective
Collect lightweight visitor telemetry for admin and public requests, updating visitor presence and inserting visit events while preserving offline/LAN behavior and fail-open safety.
Scope
Modify:
src/middleware.tsAdd application service:
src/modules/visitor-analytics/application/collector.tsCollector behavior:
VISITOR_ANALYTICS_ENABLED=true./admin/*whenVISITOR_ANALYTICS_COLLECT_ADMIN=true.VISITOR_ANALYTICS_COLLECT_PUBLIC=true.VISITOR_ANALYTICS_COLLECT_API=true.awcms_mini_visitor_sessions.awcms_mini_visit_events.last_seen_atfor presence.Astro.locals.correlationIdor equivalent request correlation ID.Recommended online presence rule:
Recommended write-throttle behavior:
Out of scope
Acceptance criteria
/adminappears as active admin presence.last_seen_atandarea.bun testpasses.bun run checkpasses.Security and privacy notes
Dependencies
Depends on #617, #618, and #619.