How vxnavi71/guardian-link works
Purpose and Entry Points
Guardian Link is a Python-backed web application for monitoring Instagram-related activity and detecting grooming-risk signals. The primary process entry point is run.py; application assembly and runtime configuration are centered in backend/app.py.
Web Application Layer
The backend exposes browser-facing routes for authentication, dashboard access, and monitoring workflows. Routing is separated from app creation:
• backend/app.py
• backend/routes.py
• backend/auth.py
Server-rendered pages use a shared template layout and dashboard view:
• frontend/templates/base.html
• frontend/templates/dashboard.html
• frontend/templates/login.html
Authentication and User Boundary
Authentication is a distinct subsystem, likely handling registration, login, session/identity checks, and access control before users reach protected monitoring functions. Its UI boundary is represented by registration and login templates, while backend enforcement resides in:
• backend/auth.py
• frontend/templates/login.html
• frontend/templates/register.html
Monitoring and Instagram Integration
Instagram is treated as an external data-source boundary. The application’s Instagram adapter should isolate API acquisition and normalization from route/UI concerns:
• backend/instagram_api.py
• backend/routes.py
This stage feeds account, conversation, or activity data into the risk-analysis path rather than coupling external API behavior directly to templates.
Grooming Detection and ML Analysis
Risk detection is split between grooming-specific logic and a machine-learning model wrapper:
• backend/grooming_detector.py
• backend/ml_model.py
The expected core flow is: Instagram-derived content enters detector/model analysis, is classified or scored for suspicious grooming behavior, and returns findings for presentation and alerting. Keeping these modules separate supports evolving detection rules independently of model inference.
Alerts and Persistence
Detection results can trigger alert handling, while database access is centralized behind a persistence boundary:
• backend/alerts.py
• backend/db.py
• backend/mock_data.json
mock_data.json suggests a development/demo data path may exist when live external data or database records are unavailable. Alert generation should consume detector outputs rather than recompute detection logic.
Frontend Delivery
The frontend is server-rendered HTML with static CSS and JavaScript enhancements, not a separately listed SPA runtime:
• frontend/templates/dashboard.html
• frontend/static/js/main.js
• frontend/static/css/style.css
The dashboard is the primary visualization/control surface for monitored activity, risk findings, and likely alerts. Browser interactions cross the backend route boundary; they should not communicate directly with Instagram or model internals.
Main entry points: routes.py Monitoring routes · grooming_detector.py Grooming detector · app.py App assembly · alerts.py Alert handling
Components 13
Web application
- App assembly · Configures the backend runtime.
backend/app.py - Monitoring routes · Serves protected monitoring workflows.
backend/routes.py - Authentication · Enforces user access before monitoring actions.
backend/auth.py - Page templates · Shared layout plus login and dashboard pages.
frontend/templates/base.html - Dashboard enhancements · Browser-side dashboard presentation and interactions.
frontend/static/js/main.js
Risk analysis
- Grooming detector · Coordinates grooming-specific signal detection.
backend/grooming_detector.py - ML model wrapper · Classifies or scores suspicious content.
backend/ml_model.py - Alert handling · Creates alerts from detection findings.
backend/alerts.py
Data and integrations
- Instagram adapter · Acquires and normalizes Instagram activity.
backend/instagram_api.py - Persistence · Centralized application data boundary.
backend/db.py - Demo data · Fallback data for demo or unavailable live sources.
backend/mock_data.json
Other components
- Process entry
run.py - Browser user
Connections 16
- Process entry → App assembly: starts
- App assembly → Monitoring routes: registers
- App assembly → Authentication: configures
- Browser user → Monitoring routes: requests
- Monitoring routes → Authentication: checks access
- Monitoring routes → Page templates: renders
- Page templates → Dashboard enhancements: loads
- Monitoring routes → Instagram adapter: requests activity
- Instagram adapter → Grooming detector: normalized content
- Grooming detector → ML model wrapper: scores content
- ML model wrapper → Grooming detector: risk score
- Grooming detector → Alert handling: findings
- Monitoring routes → Alert handling: retrieves alerts
- Monitoring routes → Persistence: reads and writes
- Alert handling → Persistence: stores alerts
- Persistence → Demo data: demo fallback