How chrisdij/prototype works
Shoplytics is a local analytics dashboard for synthetic retail transactions. A signed-in user selects dates and grouping, then views summary metrics, activity charts and tables; primary users can drill into monetary metrics, while reporting users receive restricted views. The server validates sessions and permissions, reads persisted records, computes coverage-aware analytics, adds calendar context and can render a PDF report. Feedback and audit events are persisted separately. README documents the wider calendar, export and role capabilities; unsampled browser details and setup wiring are represented only where documented.
Main entry points: server.mjs Local HTTP server · app.js Dashboard UI · database.mjs SQLite database · presentation.mjs Calendar context
Components 14
Web interface
- Dashboard UI
public/app.js - Page shell
public/index.html - Responsive styling
public/styles.css
Application service
- Local HTTP server
server.mjs - Role capabilities
permissions.mjs
Analytics and reporting
- Synthetic records
analytics.mjs - Coverage analytics
analytics.mjs - Calendar context
presentation.mjs - Grouping and series
presentation.mjs - PDF reports
report.mjs
Persistent state
- SQLite database
database.mjs - 2026 calendar
data/calendar-2026.json
Other components
- Dashboard user
- Signed-in accounts
Connections 16
- Dashboard user → Dashboard UI: uses
- Dashboard UI → Local HTTP server: API requests
- Local HTTP server → Dashboard UI: serves assets
- Dashboard UI → Page shell: loads page
- Dashboard UI → Responsive styling: loads styles
- Local HTTP server → SQLite database: authenticates; reads/writes
- Local HTTP server → Role capabilities: checks capabilities
- Local HTTP server → Coverage analytics: requests summary
- SQLite database → Coverage analytics: supplies records and coverage
- Synthetic records → SQLite database: initializes transaction data
- Local HTTP server → Grouping and series: formats results
- Grouping and series → Calendar context: adds context
- Calendar context → 2026 calendar: reads calendar
- Local HTTP server → PDF reports: renders permitted export
- PDF reports → Dashboard user: PDF download
- SQLite database → Signed-in accounts: provisions credentials