How atharv853/ai-based-document-malware-detection works
FEMDoc is a static attachment-risk triage application. Users authenticate, upload a supported document, and receive a format-specific risk verdict with behavioral evidence and an explanation; scan records feed history and analytics views. The map includes the documented format-aware model-training capability, though its dataset and training internals are not shown here. Backend call relationships are grounded in excerpts and the source index; unsampled implementation details are not inferred.
Main entry points: api.js API client · scan_routes.py Scan routes · App.jsx App and routing · dispatcher.py Format dispatcher
Components 24
Web application
- App and routing
frontend/src/App.jsx - Login page
frontend/src/pages/LoginPage.jsx - Upload and results
frontend/src/pages/UploadScanPage.jsx - Scan history
frontend/src/pages/HistoryPage.jsx - Analytics dashboard
frontend/src/pages/DashboardPage.jsx - Result visualizations
frontend/src/components/ScanResultChart.jsx - API client
frontend/src/services/api.js
API and triage
- Flask app and routing
backend/app.py - Authentication routes
backend/routes/auth_routes.py - Scan routes
backend/routes/scan_routes.py - Analytics routes
backend/routes/analytics_routes.py
Document analysis
- Format dispatcher
backend/extractors/dispatcher.py - Static byte utilities
backend/extractors/base_extractor.py - DOCX extraction
backend/extractors/docx_extractor.py - XLSX extraction
backend/extractors/xlsx_extractor.py - PDF extraction
backend/extractors/pdf_extractor.py - HTML extraction
backend/extractors/html_extractor.py - Prediction and triage
backend/services/prediction_service.py - Explainable indicators
backend/services/explanation_service.py
Persistence and analytics
- History service
backend/services/history_service.py - SQLite records
backend/database.py
Model lifecycle
- Format model training
backend/models/train_format_models.py - Format model artifacts
backend/models
Other components
- User
Connections 31
- User → App and routing: uses
frontend/src/App.jsx - App and routing → Login page: routes to
frontend/src/App.jsx - App and routing → Upload and results: routes to
frontend/src/App.jsx - App and routing → Scan history: routes to
frontend/src/App.jsx - App and routing → Analytics dashboard: routes to
frontend/src/App.jsx - Login page → API client: authenticates via
frontend/src/pages/LoginPage.jsx - Upload and results → API client: uploads via
frontend/src/pages/UploadScanPage.jsx - Scan history → API client: loads scans via
frontend/src/pages/HistoryPage.jsx - Analytics dashboard → API client: loads analytics via
frontend/src/pages/DashboardPage.jsx - Upload and results → Result visualizations: renders results with
frontend/src/pages/UploadScanPage.jsx - API client → Authentication routes: posts login
frontend/src/services/api.js - API client → Scan routes: calls scan endpoints
frontend/src/services/api.js - API client → Analytics routes: calls analytics
frontend/src/services/api.js - Flask app and routing → Authentication routes: registers
backend/app.py - Flask app and routing → Scan routes: registers
backend/app.py - Flask app and routing → Analytics routes: registers
backend/app.py - Authentication routes → SQLite records: queries users
backend/routes/auth_routes.py - Scan routes → Format dispatcher: extracts features
backend/routes/scan_routes.py - Scan routes → Static byte utilities: hashes upload
backend/routes/scan_routes.py - Format dispatcher → DOCX extraction: dispatches DOCX
backend/extractors/dispatcher.py - Format dispatcher → XLSX extraction: dispatches XLSX
backend/extractors/dispatcher.py - Format dispatcher → PDF extraction: dispatches PDF
backend/extractors/dispatcher.py - Format dispatcher → HTML extraction: dispatches HTML
backend/extractors/dispatcher.py - Scan routes → Prediction and triage: requests verdict
backend/routes/scan_routes.py - Prediction and triage → Explainable indicators: generates explanation
backend/services/prediction_service.py - Scan routes → History service: saves and retrieves
backend/routes/scan_routes.py - Analytics routes → History service: requests summary
backend/routes/analytics_routes.py - History service → SQLite records: reads and writes
backend/services/history_service.py - Flask app and routing → SQLite records: initializes schema
backend/app.py - Prediction and triage → Format model artifacts: loads format models
backend/services/prediction_service.py - Format model training → Format model artifacts: produces artifacts
README.md