How yohan-987/tracemail works
This is an email-threat investigation product: analysts authenticate, ingest or retrieve email evidence, review forensic and risk assessments, and explore cases, infrastructure, AI findings, and reports. The backend’s documented ingest pipeline preserves the original message, parses it, runs independent analyses, computes risk, and stores a record; authenticated API routes expose investigation and Gmail workflows. The frontend routes to investigation workspaces and supporting views. Several frontend pages and backend routes were not sampled, so their internal wiring is not asserted.
Main entry points: App.tsx App routes · emailIngestPipeline.ts Ingest pipeline · emails.ts Email API · app.ts API application
Components 26
Analyst frontend
- App routes
FRONTEND/src/App.tsx - Session context
FRONTEND/src/context/AuthContext.tsx - Active case
FRONTEND/src/context/ActiveCaseContext.tsx - Email scanner
FRONTEND/src/pages/ScannerPage.tsx - Investigation views
FRONTEND/src/pages/AIInvestigationPage.tsx - Infrastructure view
FRONTEND/src/pages/InfrastructurePage.tsx - Case management
FRONTEND/src/pages/CasesPage.tsx - Reports view
FRONTEND/src/pages/ReportsPage.tsx - API client
FRONTEND/src/api/api.ts
API and access
- HTTP server
backend-batch3.5/backend/src/server.ts - API application
backend-batch3.5/backend/src/app.ts - Authentication routes
backend-batch3.5/backend/src/routes/auth.ts - Session gate
backend-batch3.5/backend/src/middleware/requireAuth.ts - Email API
backend-batch3.5/backend/src/routes/emails.ts - Gmail API
backend-batch3.5/backend/src/routes/gmail.ts
Evidence ingestion
- Ingest pipeline
backend-batch3.5/backend/src/services/emailIngestPipeline.ts - Email parser
backend-batch3.5/backend/src/analyzers/emailParser.ts
Threat analysis
- Header forensics
backend-batch3.5/backend/src/analyzers/headerForensics.ts - Risk engine
backend-batch3.5/backend/src/analyzers/riskEngine.ts - AI assessment
backend-batch3.5/backend/src/analyzers/aiAssessment.ts - Infrastructure analysis
backend-batch3.5/backend/src/analyzers/infrastructure.ts
Evidence and services
- Email store
backend-batch3.5/backend/src/services/emailStore.ts - Email queries
backend-batch3.5/backend/src/services/emailQuery.ts - LLM provider client
backend-batch3.5/backend/src/services/llmClient.ts - Domain schemas
backend-batch3.5/backend/src/schemas/types.ts
Other components
- Analyst
Connections 28
- Analyst → App routes: uses
- App routes → Session context: provides session
FRONTEND/src/App.tsx - App routes → Email scanner: routes to
FRONTEND/src/App.tsx - App routes → Investigation views: routes to
FRONTEND/src/App.tsx - App routes → Infrastructure view: routes to
FRONTEND/src/App.tsx - App routes → Case management: routes to
FRONTEND/src/App.tsx - App routes → Reports view: routes to
FRONTEND/src/App.tsx - App routes → Active case: mounts after auth
FRONTEND/src/App.tsx - App routes → API client: API use
- API client → HTTP server: HTTP requests
- HTTP server → API application: creates and serves
backend-batch3.5/backend/src/server.ts - API application → Authentication routes: mounts
backend-batch3.5/backend/src/app.ts - API application → Email API: mounts
backend-batch3.5/backend/src/app.ts - API application → Gmail API: mounts
backend-batch3.5/backend/src/app.ts - Email API → Session gate: protects routes
backend-batch3.5/backend/src/routes/emails.ts - Email API → Ingest pipeline: ingests email
backend-batch3.5/backend/src/routes/emails.ts - Email API → Email queries: queries records
backend-batch3.5/backend/src/routes/emails.ts - Email API → Email store: reads and writes
backend-batch3.5/backend/src/routes/emails.ts - Gmail API → Session gate: protects routes
- Ingest pipeline → Email parser: parses message
backend-batch3.5/backend/src/services/emailIngestPipeline.ts - Ingest pipeline → Header forensics: analyzes headers
backend-batch3.5/backend/src/services/emailIngestPipeline.ts - Ingest pipeline → Risk engine: computes risk
backend-batch3.5/backend/src/services/emailIngestPipeline.ts - Ingest pipeline → AI assessment: assesses with AI
backend-batch3.5/backend/src/services/emailIngestPipeline.ts - Ingest pipeline → Infrastructure analysis: checks infrastructure
backend-batch3.5/backend/src/services/emailIngestPipeline.ts - Ingest pipeline → Email store: stores evidence
backend-batch3.5/backend/src/services/emailIngestPipeline.ts - AI assessment → LLM provider client: uses provider
backend-batch3.5/backend/src/analyzers/aiAssessment.ts - Ingest pipeline → Domain schemas: builds typed record
backend-batch3.5/backend/src/services/emailIngestPipeline.ts - Email queries → Domain schemas: uses types
backend-batch3.5/backend/src/services/emailQuery.ts