DarkPattern is a Flask and MongoDB based Web Usage Mining project that detects suspicious website dark patterns using clickstream analysis and Decision Tree Machine Learning.
The system analyzes user navigation behavior to identify manipulative UI patterns such as:
- Forced Actions
- Confirmation Loops
- Hidden Opt-Outs
- Subscription Traps
- Clickstream dataset preprocessing
- Decision Tree Machine Learning integration
- Dark pattern detection engine
- MongoDB database storage
- Interactive analytics dashboard
- Session analysis and alerts
- User ID search and filtering
- Charts and clickstream visualization
- Manual event ingestion support
- CSV dataset upload support
- Python
- Flask
- MongoDB
- Scikit-learn
- Pandas
- Chart.js
- HTML/CSS/JavaScript
darkminingproject/
│
├── app.py
├── config.py
├── requirements.txt
│
├── database/
│ └── db.py
│
├── services/
│ ├── dataset_loader.py
│ ├── detection_engine.py
│ ├── analytics.py
│ └── ml_model.py
│
├── routes/
│ ├── stats_routes.py
│ ├── session_routes.py
│ ├── chart_routes.py
│ ├── alert_routes.py
│ ├── clickstream_routes.py
│ ├── ingest_routes.py
│ └── upload_routes.py
│
├── templates/
│ ├── index.html
│ ├── login.html
│ └── register.html
│
└── static/The project uses a Decision Tree Classifier to classify sessions as suspicious or normal based on clickstream behavior features such as:
- Bounce Rate
- Exit Rate
- Product Related Duration
- Session Length
- Visitor Type
pip install -r requirements.txtMake sure MongoDB is running locally or use MongoDB Atlas.
python app.pyhttp://127.0.0.1:5000- Overview Dashboard
- Alerts Page
- Sessions Analysis
- Charts Visualization
- Raw Clickstream Monitoring
- Ingest Event Page
- API Reference
- Real-time website tracking
- SaaS deployment
- Advanced ML algorithms
- Automated dark pattern auditing
- Multi-company dashboard support
Harshitha Manjunath
This project is developed for academic and educational purposes.