How mohana-575/qr-security-scanner works
QR Guard is a web application for decoding QR images and assessing the risk of URLs they contain, with account-based scan history. A user submits an image; the scan endpoint validates and decodes it, analyzes a URL, calculates risk, and saves a result. The frontend also supports registration, login, and current-user hydration. The scan and authentication route excerpts show their backend calls; frontend-to-backend wiring and several UI details are not fully shown, so those links are omitted rather than inferred.
Main entry points: scan.py Scan routes · auth.py Auth routes · main.py API application · database.py Database
Components 21
Web application
- Web app
qr-guard/frontend/src/App.jsx - Auth state
qr-guard/frontend/src/context/AuthContext.jsx - Auth API client
qr-guard/frontend/src/api/auth.js - HTTP client
qr-guard/frontend/src/api/client.js - Scan API client
qr-guard/frontend/src/api/scans.js
API and security
- API application
qr-guard/backend/app/main.py - Auth routes
qr-guard/backend/app/routes/auth.py - Scan routes
qr-guard/backend/app/routes/scan.py - Auth schemas
qr-guard/backend/app/schemas/auth.py - Scan schemas
qr-guard/backend/app/schemas/scan.py - Account service
qr-guard/backend/app/services/auth.py - Token security
qr-guard/backend/app/security/tokens.py - Auth dependencies
qr-guard/backend/app/security/dependencies.py - Configuration
qr-guard/backend/app/settings.py - Error handling
qr-guard/backend/app/utils/errors.py
Analysis and storage
- QR decoder
qr-guard/backend/app/services/qr_decoder.py - URL analysis
qr-guard/backend/app/services/url_analyzer.py - Risk engine
qr-guard/backend/app/services/risk_engine.py - Scan record
qr-guard/backend/app/models/scan.py - Database
qr-guard/backend/app/database.py
Other components
- User
Connections 22
- User → Web app: uses
- API application → Database: creates tables
qr-guard/backend/app/main.py - API application → Configuration: loads settings
qr-guard/backend/app/main.py - API application → Error handling: registers handlers
qr-guard/backend/app/main.py - API application → Auth routes: mounts routes
- API application → Scan routes: mounts routes
- Auth routes → Account service: registers, authenticates
qr-guard/backend/app/routes/auth.py - Auth routes → Database: gets session
qr-guard/backend/app/routes/auth.py - Auth routes → Token security: creates token
qr-guard/backend/app/routes/auth.py - Auth routes → Auth dependencies: gets current user
qr-guard/backend/app/routes/auth.py - Auth routes → Auth schemas: validates, responds
qr-guard/backend/app/routes/auth.py - Scan routes → QR decoder: decodes image
qr-guard/backend/app/routes/scan.py - Scan routes → URL analysis: analyzes URL
qr-guard/backend/app/routes/scan.py - Scan routes → Risk engine: calculates risk
qr-guard/backend/app/routes/scan.py - Scan routes → Database: saves scan
qr-guard/backend/app/routes/scan.py - Scan routes → Scan record: creates record
qr-guard/backend/app/routes/scan.py - Scan routes → Auth dependencies: requires user
qr-guard/backend/app/routes/scan.py - Scan routes → Scan schemas: validates, responds
qr-guard/backend/app/routes/scan.py - Auth state → Auth API client: calls auth functions
qr-guard/frontend/src/context/AuthContext.jsx - Auth API client → HTTP client: sends requests
qr-guard/frontend/src/api/auth.js - Scan API client → HTTP client: sends requests
qr-guard/frontend/src/api/scans.js - Web app → Auth state: uses provider