Skip to content

Add Spam Analytics Dashboard #7

@shashankashekharnayak2006-stack

Description

🚀 Add Spam Analytics Dashboard

Description

Currently, the Spam Detection System provides spam predictions for SMS and Email messages but does not offer any analytics or historical insights.

The goal of this issue is to implement a Spam Analytics Dashboard that visualizes spam detection statistics and trends. This will help users monitor system usage, understand spam patterns, and evaluate detection performance over time.

Objectives

Create a dashboard that displays:

  • Total messages scanned
  • Total spam messages detected
  • Total non-spam (ham) messages detected
  • Spam vs Ham distribution chart
  • Daily scan activity trend
  • Source-wise detection statistics (SMS, Email, URL in future)

Backend Tasks

  • Create a scan_logs database table
  • Store prediction history automatically
  • Create analytics APIs
  • Aggregate statistics from stored logs

Suggested APIs:

GET /api/analytics/summary
GET /api/analytics/trends
GET /api/analytics/distribution

Example Response:

{
  "totalScans": 1200,
  "spamCount": 450,
  "hamCount": 750
}

Frontend Tasks

Create a dashboard page displaying:

Statistics Cards

  • Total Scans
  • Spam Detected
  • Ham Detected

Charts

  • Spam vs Ham Pie Chart
  • Daily Detection Trend Line Chart

Recommended Libraries:

  • Recharts
  • Chart.js

Database Schema (Suggested)

CREATE TABLE scan_logs (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    source_type TEXT,
    prediction TEXT,
    confidence REAL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Acceptance Criteria

  • Prediction results are logged automatically.
  • Analytics APIs return aggregated statistics.
  • Dashboard displays real-time analytics.
  • Charts render correctly on desktop and mobile devices.
  • Code follows project coding standards.
  • Documentation is updated.

Bonus Features

  • Export analytics as CSV
  • Most common spam keywords
  • Date range filters
  • Dark mode support

Difficulty

Medium

Skills Required

  • React.js
  • Node.js / Express.js
  • SQLite
  • REST APIs
  • Data Visualization

Expected Outcome

A fully functional analytics dashboard that provides meaningful insights into spam detection activity and system usage.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions