Skip to content

Architecture Decision Records (ADR) Log ​

This decision log documents all architectural and technical design decisions across TruthGuard, recording the chosen solution, evaluated alternatives, deciding factors, and conditions under which the decision should be revisited.


Master Architecture Decisions Table ​

Decision #Architectural DecisionChosen OptionAlternatives ConsideredDeciding FactorsTrade-Off AcceptedRevisit When
ADR-01Frontend Micro-Frontend TopologyPort-based Federated Hub (FeatureEmbed.tsx)Monolithic SPA, Webpack Module Federation, Single-SPAComplete failure isolation; independent local development cycles; zero shared dependency lock-in.Duplicate browser memory when opening multiple modules simultaneously.Modules need to share large in-memory WebGL frame buffers directly.
ADR-02Client-Side Binary ForensicsNative Web Crypto API (window.crypto.subtle)CryptoJS, Node.js server crypto, js-sha256Zero bundle weight; compiled C++ execution; evidentiary privacy (media never leaves analyst RAM).Requires secure HTTPS context or localhost origin.Complex SHA-3 or post-quantum algorithms are mandated by federal law.
ADR-03EXIF Header Parsing Engineexifr binary parserexif-js, piexifjs, Sharp (server-side)Slices and reads only initial header chunks (~3ms parse time); full support for modern XMP and GPS tags.Images stripped of EXIF (e.g., social media downloads) require heuristic fallback.Server-side video metadata extraction across petabyte archives is required.
ADR-04State Management for Custody DriveZustand (useMediaVaultStore)Redux Toolkit, React Context, Jotai, MobX1.1 KB footprint; provider-less architecture; decoupled atomic selector updates during rapid upload progress.Lacks enterprise Redux time-travel action replay.The application scales to hundreds of complex inter-dependent server cache mutations.
ADR-05Cloud Backend & Database TierSupabase Cloud (PostgreSQL + GoTrue)Custom MERN (Express + MongoDB), AWS Amplify, FirebaseBuilt-in Row Level Security (RLS); PostgreSQL relational ACID guarantees; serverless Deno Edge Function hosting.Relies on third-party cloud infrastructure (mitigated by self-hostable Docker support).Air-gapped military deployments with zero internet connectivity are required.
ADR-06AI Inference StrategyPre-Trained Models via Serverless Edge FunctionsTraining custom ML models locally, onnxruntime-web in browserZero model training and GPU maintenance cost; instant adaptation to new diffusion architectures; keeps client bundle small.Ongoing API token inference cost for high-volume text analysis.The company collects 500,000+ proprietary forensic samples and secures private GPU cluster funding.
ADR-07Design System & StylingTailwind CSS with NVIDIA Dark PaletteVanilla CSS, CSS Modules, styled-components, Material UICompiles down to <15 KB static CSS; zero JavaScript runtime style injection; exact custom hex tokens.Verbose class strings in JSX templates.Dynamic user-generated runtime theme creation is required.
ADR-08Dynamic Service DiscoveryClient-Side Port Prober (HEAD / no-cors)Hardcoded port URLs, Consul, Eureka service registryWorks entirely in client browser without running a separate service discovery server daemon.Sequential 100ms port probing introduces minor delay on first load.Micro-frontends are deployed behind a production reverse proxy with path-based routing.
ADR-09Text Input Length BoundClient Slicing to 5,000 CharactersUnlimited streaming, multi-chunk batchingPrevents token exhaustion, limits inference latency, and controls cloud billing costs.Documents exceeding 5,000 characters require manual multi-part submission.Enterprise customers demand multi-hundred-page book and legal brief auditing.
ADR-10Evidence Custody PersistenceBrowser LocalStorage with Exception HandlingPure in-memory state, IndexedDBInstant zero-setup persistence for prototyping across browser reloads; simple JSON serialization.5MB browser storage ceiling limits storage to metadata and small files.Production release requires multi-gigabyte video evidence custody and offline caching.