How shaikirfan2904-hub/cyberguard works
CyberGuard AI is a private messaging application that screens outgoing messages for aggression before delivery. The main workflow runs from browser chat through Flask’s HTTP/Socket.IO handlers and the detection engine, then either delivers a safe message or blocks it and records a violation. The product also includes authentication, friend management, presence, chat history, notifications, and a model-training workflow. Backend routes and several database operations are only partially sampled; the broader capabilities and some connections below are documented in the README.
Main entry points: app.py Flask routes · chat.js Chat interface · train_model.py Training pipeline · auth.js Auth forms
Components 17
Browser experience
- Auth forms
static/js/auth.js - Dashboard
static/js/dashboard.js - Chat interface
static/js/chat.js - Notifications
static/js/notifications.js - Socket client
static/js/socket.js - Browser utilities
static/js/app.js
Application services
- Flask routes
app.py - Configuration
config.py - Accounts and social
app.py - Chat and presence
app.py - Notification service
app.py - Application database
database/schema.sql
AI safety
- Aggression detection
detection_engine.py - Classifier assets
model/model.pkl
Model training
- Training pipeline
train_model.py - Labeled dataset
datasets/cleaned_dataset.csv
Other components
- User
Connections 18
- User → Auth forms: submits credentials
static/js/auth.js - User → Chat interface: writes messages
README.md - Auth forms → Browser utilities: uses API
static/js/auth.js - Browser utilities → Flask routes: sends HTTP requests
static/js/app.js - Dashboard → Flask routes: loads users
static/js/dashboard.js - Chat interface → Flask routes: loads chat history
static/js/chat.js - Chat interface → Socket client: joins chat room
static/js/chat.js - Socket client → Flask routes: sends socket events
README.md - Notifications → Flask routes: loads notifications
static/js/notifications.js - Flask routes → Configuration: uses settings
app.py - Flask routes → Accounts and social: handles account actions
README.md - Flask routes → Chat and presence: handles chat events
README.md - Flask routes → Notification service: serves notifications
app.py - Flask routes → Aggression detection: checks outgoing text
app.py - Aggression detection → Classifier assets: loads model files
detection_engine.py - Flask routes → Application database: reads and writes
README.md - Training pipeline → Labeled dataset: trains from
README.md - Training pipeline → Classifier assets: produces model