How tayyaba-amin/privacyguard works
PrivacyGuard is a web app for scanning text and images for sensitive information, explaining sharing risk, producing protected copies, and rescanning them. The user workflow runs from the React interface through API calls to in-memory server routes: OCR for images, deterministic detection, optional AI commentary on existing findings, and risk scoring or redaction. The graph preserves the documented image and text branches, session-only scan metadata, and optional Featherless integration. Some route and UI links are documented or indexed but their full implementations were not sampled; those links are dashed where source evidence is limited.
Main entry points: service.ts Context orchestration · app.ts Express API · rescan-image.ts Image rescan · api.ts API client
Components 24
Web application
- React interface
apps/web/src/App.tsx - API client
apps/web/src/lib/api.ts - Finding and risk view models
apps/web/src/lib/findings.ts - Results and protection panels
apps/web/src/components/ResultsPanel.tsx - Session dashboard
apps/web/src/components/Dashboard.tsx
API routes
- Express API
apps/server/src/app.ts - Text analysis
apps/server/src/routes/analyze.ts - Image analysis
apps/server/src/routes/analyze-image.ts - Text protection
apps/server/src/routes/protect.ts - Image protection
apps/server/src/routes/protect-image.ts - Text rescan
apps/server/src/routes/rescan.ts - Image rescan
apps/server/src/routes/rescan-image.ts
Detection and assessment
- Sensitive-data detectors
apps/server/src/detection/index.ts - Image OCR
apps/server/src/image/ocr.ts - Risk scoring
apps/server/src/risk/score.ts
Protection and verification
- Text redaction
apps/server/src/protection/redact.ts - Image redaction
apps/server/src/image/protect.ts
Optional AI context
- Context orchestration
apps/server/src/ai/service.ts - Finding-centered context
apps/server/src/ai/context.ts - Prompt construction
apps/server/src/ai/prompt.ts - Model response validation
apps/server/src/ai/schema.ts - Featherless provider
apps/server/src/ai/featherless.ts
Other components
- User
- Featherless API
Connections 40
- User → React interface: uses
- React interface → API client: requests
apps/web/src/App.tsx - React interface → Finding and risk view models: formats findings
apps/web/src/App.tsx - React interface → Results and protection panels: renders
apps/web/src/App.tsx - React interface → Session dashboard: shows session metadata
apps/web/src/App.tsx - API client → Express API: calls API
apps/web/src/lib/api.ts - Express API → Text analysis: routes
apps/server/src/app.ts - Express API → Image analysis: routes
apps/server/src/app.ts - Express API → Text protection: routes
apps/server/src/app.ts - Express API → Image protection: routes
apps/server/src/app.ts - Express API → Text rescan: routes
apps/server/src/app.ts - Express API → Image rescan: routes
apps/server/src/app.ts - Text analysis → Sensitive-data detectors: detects
- Text analysis → Risk scoring: scores findings
- Image analysis → Image OCR: extracts text
apps/server/src/routes/analyze-image.ts - Image analysis → Sensitive-data detectors: detects
apps/server/src/routes/analyze-image.ts - Image analysis → Risk scoring: scores findings
apps/server/src/routes/analyze-image.ts - Text analysis → Context orchestration: adds context
- Image analysis → Context orchestration: adds context
apps/server/src/routes/analyze-image.ts - Text protection → Sensitive-data detectors: finds spans
- Text protection → Text redaction: redacts text
- Image protection → Sensitive-data detectors: finds spans
apps/server/src/routes/protect-image.ts - Image protection → Image OCR: reads image
apps/server/src/routes/protect-image.ts - Image protection → Image redaction: creates protected copy
apps/server/src/routes/protect-image.ts - Text rescan → Sensitive-data detectors: checks content
- Text rescan → Risk scoring: scores findings
- Image rescan → Image OCR: extracts text
apps/server/src/routes/rescan-image.ts - Image rescan → Sensitive-data detectors: checks content
apps/server/src/routes/rescan-image.ts - Image rescan → Risk scoring: scores findings
apps/server/src/routes/rescan-image.ts - Text rescan → Context orchestration: adds context
- Image rescan → Context orchestration: adds context
apps/server/src/routes/rescan-image.ts - Context orchestration → Finding-centered context: builds batches
apps/server/src/ai/service.ts - Context orchestration → Prompt construction: builds prompt
apps/server/src/ai/service.ts - Context orchestration → Model response validation: validates response
apps/server/src/ai/service.ts - Context orchestration → Featherless provider: requests completion
apps/server/src/ai/index.ts - Featherless provider → Featherless API: calls provider
- Text protection → API client: returns protected copy
apps/web/src/lib/api.ts - Image protection → API client: returns protected image
apps/web/src/lib/api.ts - API client → Text rescan: submits protected text
apps/web/src/lib/api.ts - API client → Image rescan: submits protected image
apps/web/src/lib/api.ts