Commit Graph

125 Commits

Author SHA1 Message Date
bc20aeaeb6 feat: migrate full Prisma schema to Drizzle ORM (29 tables, 28 enums, 25 relations)
- Install drizzle-orm, drizzle-kit, pg, @types/pg in web/
- Create split schema directory with domain files:
  - auth (users, accounts, sessions, deviceTokens)
  - subscription (familyGroups, familyGroupMembers, subscriptions)
  - darkwatch (watchlistItems, exposures)
  - alerts
  - voiceprint (voiceEnrollments, voiceAnalyses, analysisJobs, analysisResults)
  - spamshield (spamFeedback, spamRules)
  - audit (auditLogs, kpiSnapshots)
  - correlation (normalizedAlerts, correlationGroups)
  - reports (securityReports)
  - marketing (waitlistEntries, blogPosts)
  - hometitle (propertyWatchlistItems, propertySnapshots, propertyChanges)
  - removebrokers (infoBrokers, removalRequests, brokerListings)
- Define all 28 PostgreSQL enums via pgEnum()
- Define all indexes, unique constraints, and foreign keys
- Define all 25 relation definitions via relations() helper
- Update drizzle.config.ts for PostgreSQL dialect
- Update db/index.ts for node-postgres connection
- Replace old placeholder schema.ts with barrel re-export
- Add 38 comprehensive schema tests
2026-05-25 15:35:10 -04:00
9dc55517b1 08: Migrate & redesign Blog, Ads, and Dashboard pages
- Blog listing page with hero, responsive grid, tag filters, load more
- Blog post page with markdown rendering, related posts, social share
- Ads landing page with conversion copy, pricing, FAQ, testimonials
- Dashboard shell with sidebar, topbar, stat cards, activity feed
- Dashboard components: Sidebar, TopBar, StatCard, ActivityFeed, QuickActions
- Comprehensive test suite covering all pages and components
2026-05-25 15:26:01 -04:00
25da0cd687 feat: add auth pages (login, signup, password reset, onboarding)
- Create stub auth API (lib/auth.ts) with simulated delay
- Add PasswordInput component with visibility toggle
- Add SocialAuthButtons component (Google/Apple placeholders)
- Add AuthLayout with split-panel layout and rotating testimonial
- Implement login page with email/password validation and remember me
- Implement signup page with password strength indicator and ToS checkbox
- Implement forgot-password page with email submission and success state
- Implement reset-password page with token validation from query params
- Implement 4-step onboarding flow (plan selection, watchlist, invites, success)
- Add ToastProvider to root app
- Write 28 tests for all auth components and form validation
2026-05-25 15:20:01 -04:00
6acbb6ca37 feat: Add Typewriter animation to hero headline
- Wrap hero headline in Typewriter with 50cps speed, 400ms delay
- Preserves gradient text effect on 'Identity Protection' span
- Update README task 03 to list Typewriter as a UI primitive
2026-05-25 15:14:30 -04:00
3f00dd6b28 feat: add landing page Features, How It Works, and CTA sections
- HowItWorksSection: 3-step staggered timeline with gradient circles
- FeaturesGridSection: 6-card responsive grid (DarkWatch, VoicePrint, SpamShield, HomeTitle, RemoveBrokers, Family Plans)
- ForUsersSection: Split panel for Individuals and Families with checkmark lists
- WhyShieldAISection: 3 value prop cards (Proactive, AI-Powered, Privacy First)
- CTABannerSection: Final CTA with Create Account and Sign In buttons
- Updated routes/index.tsx with clip-path polygon transitions between sections
- Added 49 unit tests for all new sections
2026-05-25 15:12:32 -04:00
d4c1b62a97 refactor: Context-based theme provider with animated Typewriter toggle
- Convert theme to SolidJS Context/Provider pattern (ThemeProvider)
- Extract createThemeState() for testability without context
- Add Typewriter component with character-by-character reveal
- Animate ThemeToggle with Typewriter label and hover scale
- Add cursor CSS animations (typewriter-blink, cursor-typing, cursor-block)
- Fix background color transition by using 'all' on :root
- Rename theme.ts -> theme.tsx for JSX support
- All 26 theme tests passing
2026-05-25 15:10:52 -04:00
c9a82fc6de feat: add landing page hero section with animated background
- Create ColorWaveBackground canvas component with animated gradient blobs
- Create HeroSection with ShieldAI branding, headline, CTAs, and trust signals
- Compose landing page in index.tsx route with background + hero
- Add unit tests for HeroSection (13 tests) and ColorWaveBackground (8 tests)
- Background respects prefers-reduced-motion accessibility preference
- Responsive layout with mobile-first text sizing and stacked buttons
2026-05-25 14:43:09 -04:00
6981a05de4 feat: add layout components (Navbar, Footer, PageContainer, AppShell)
- Navbar: responsive nav with ShieldAI logo, nav links, auth buttons,
  mobile hamburger menu, theme toggle, scroll-aware glass effect
- Footer: multi-column responsive layout with product/company/resources/
  legal links, social icons, copyright bar
- PageContainer: centered wrapper with max-w-7xl and responsive padding
- AppShell: root layout composing Navbar + main + Footer with dot-grid
  background and MetaProvider
- useAuth stub hook for future auth integration (task 23)
- Wire AppShell into app.tsx as Router root
- Unit tests for PageContainer and useAuth
2026-05-25 13:58:42 -04:00
6002ea383b chore: mark tasks 01-03 as complete in README 2026-05-25 13:31:32 -04:00
3842a20b35 feat(theme): add @theme block inside dark media query for Tailwind v4 compile-time dark tokens 2026-05-25 13:22:30 -04:00
cc41f4ad32 feat: establish root config and workspace foundation
- Create browser-ext placeholder package.json for workspace resolution
- Update root engines to node >=22 matching .nvmrc and web/package.json
- pnpm-workspace.yaml already configured with web and browser-ext
- All legacy directories (packages/, services/, server/) already removed
2026-05-25 13:17:55 -04:00
ee31b88612 feat: add full @property declarations and fix theme system
- Add @property declarations for all 28 animatable color tokens ensuring
  smooth 500ms transitions between light/dark modes
- Remove invalid @theme block from inside @media (prefers-color-scheme: dark)
  that was causing Tailwind v4 to use dark values as defaults
- Add FOUC-prevention inline script in entry-server.tsx that applies
  theme class before first paint
- Integrate useTheme() hook in app.tsx for meta theme-color updates
  and system preference change listener
2026-05-25 13:14:30 -04:00
aa69c0ecc4 chore: project foundation cleanup — remove npm lockfile and turbo cache from tracking
- Remove package-lock.json (project uses pnpm)
- Remove .turbo/cache/ from git tracking (already in .gitignore)
- Add package-lock.json to .gitignore to prevent accidental re-addition
2026-05-25 13:08:08 -04:00
4118a25388 feat: add UI primitive library — Button, Card, Input, Badge, Modal, Toast
- Add cn() utility for class merging in lib/utils.ts
- Button: primary/secondary/ghost/danger variants, sm/md/lg sizes, disabled/loading states
- Card: gradient-card background with optional header/footer slots
- Input: text/email/password/number types with label, error, helper text, focus ring
- Badge: default/success/warning/error/info variants
- Modal: Portal-based dialog with focus trap, ESC/backdrop close, animations
- Toast: ToastProvider context with show/dismiss/auto-dismiss and variant support
- Barrel export via index.ts
- 46 unit tests across all primitives
- Configure vitest with vite-plugin-solid for JSX support
2026-05-25 13:03:00 -04:00
06bf9ac97c feat: add ShieldAI theme system with auto-shifting CSS and useTheme hook 2026-05-25 12:42:26 -04:00
f627033665 feat: establish unified project foundation with root config cleanup
- Archive legacy packages/, services/, server/ directories
- Update pnpm workspace to web + browser-ext
- Simplify root package.json scripts to delegate to web/
- Update turbo.json for new workspace structure
- Remove obsolete root config files (vite, tsconfig, etc.)
- Add .nvmrc, .editorconfig for consistent dev environment
- Update CI workflow to remove references to deleted packages
- Add missing dependencies (@tailwindcss/vite, tailwindcss) to web
- Add test and lint scripts to web package
- Verify pnpm install, build, and dev work correctly
2026-05-25 12:31:43 -04:00
59fcc31483 restructure tasks 2026-05-25 12:23:23 -04:00
24459442a2 android + ios base 2026-05-25 12:02:31 -04:00
4471719b79 basic redux setup 2026-05-25 11:41:43 -04:00
56c4b1bc03 update readme 2026-05-18 09:00:23 -04:00
f118d3a4f3 more package declarations 2026-05-17 21:52:38 -04:00
a8a5930ced security: fix 10 security review findings (FRE-4572)
CRITICAL:
- SEC-001: Auth tokens now stored in SecureStore (Keychain/Keystore)
- SEC-002: Biometric bypass removed - alerts user and disables when unavailable

HIGH:
- SEC-003: Push projectId moved to EXPO_PUBLIC_EAS_PROJECT_ID env var
- SEC-004: Token refresh mechanism added with refreshSession/hydrateTokens
- SEC-005: debug already gated on __DEV__ (confirmed)

MEDIUM:
- SEC-006: All PII stores (darkwatch, voiceprint, spamshield, settings, auth) now use encrypted AsyncStorage
- SEC-007: Certificate pinning documented with TODO for production
- SEC-008: Login brute force protection: 5 attempts then 5-minute lockout

LOW:
- SEC-009: Watch list input validation with format checks per entity type
- SEC-010: Upgrade Plan button shows billing coming soon alert
2026-05-17 19:15:42 -04:00
06ca3ec0cf Fix Mixpanel analytics review findings FRE-5281
P0: Fix validation bypass - validated properties now override raw properties
P1: Add unit tests for shared-analytics package (3 test files)
P1: Refactor spamshield to use shared-analytics, deprecate duplicate
P2: Normalize phone numbers to E.164 before hashing
P2: Add graceful error handling for missing env vars in config
P3: Add singleton pattern to MixpanelService
P3: Include timestamp in validated properties schema
2026-05-17 15:37:21 -04:00
986941e201 feat: add iOS and Android screenshot capture guides (FRE-4572) 2026-05-17 11:39:41 -04:00
6a8d3648d8 feat: add EAS build config and app store asset structure (FRE-4572)
- Create eas.json with development, preview, and production build profiles
- Add submit configuration for iOS App Store and Google Play
- Create app store metadata with listing copy, keywords, and requirements
- Add screenshot capture guides for iOS and Android
- Add marketing asset directory structure
2026-05-17 11:38:29 -04:00
64b70073ec Fix uuid dependency and silent error swallowing FRE-4572
- Replace uuid package with expo-crypto randomUUID (already a dependency)
- Add error logging to darkWatchStore refreshExposures catch block
- TypeScript compiles clean
2026-05-17 11:12:44 -04:00
90a223bc79 fix: address code review findings for mobile app (FRE-4572)
P0 fixes:
- Replace crypto.randomUUID() with uuid v4 (not available in RN)
- Replace Platform.Version with expo-device osVersion
- Fix auth navigation types, remove unused App route

P1 fixes:
- Push notification handler respects user preferences (useRef pattern)
- Fix stale closure: use zustand subscribe + useRef for live preferences
- Add retry logging for device registration failures
- Replace emoji tab icons with @expo/vector-icons Ionicons
- Document API integration TODOs in all local-only stores

P2 fixes:
- Add __DEV__ global declaration (global.d.ts)
- Fix package.json main field to expo/AppEntry.js
- Add retry logging for push device registration
- Add z-index/elevation to LoadingOverlay
- Add visual indicator to EmptyState icon

P3 fixes:
- Type navigation with NavigationProp<RootStackParamList>
- Move getSeverityColor to theme.ts (single source of truth)
- Add useMemo for SpamShield filter computations
- Verified usesNonExemptEncryption: false is correct for expo-secure-store

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-17 10:51:14 -04:00
a071aa736e feat: scaffold ShieldAI React Native mobile app MVP (FRE-4572)
Build complete Expo/React Native mobile app with:
- Auth flow: email/password login, registration, biometric auth
- Dashboard: exposure summary, spam stats, voice protection status
- DarkWatch: watch list management, exposure feed, alert toggles
- SpamShield: call/text history, whitelist/blacklist management
- VoicePrint: family member enrollment, voice analysis
- Settings: tier management, notification preferences, security
- Push notification integration via FCM/APNs
- Offline-first state management with Zustand + AsyncStorage
- Integration with @shieldai/mobile-api-client for API services
- React Navigation with auth-aware routing (stack + bottom tabs)
- Dark theme with consistent design system (colors, spacing, typography)
- Network status monitoring and offline request queuing

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-17 10:12:46 -04:00
Founding Engineer
7fb8b83810 Fix open redirect in Stripe customer portal returnUrl (FRE-5399)
- Add isValidReturnUrl validation at route level for fast rejection
- Add defense-in-depth validation in BillingService.createCustomerPortalSession
- Fix isValidReturnUrl bug: origin comparison was never reached due to
  incorrect protocol check, allowing substring attacks (e.g., app.shieldai.com.evil.com)
- Export isValidReturnUrl from shared-billing package index
- Add unit tests for all attack vectors

Files changed:
- packages/api/src/routes/subscription.routes.ts
- packages/shared-billing/src/services/billing.service.ts
- packages/shared-billing/src/config/billing.config.ts
- packages/shared-billing/src/index.ts
- packages/shared-billing/src/__tests__/billing.config.test.ts
2026-05-17 05:39:13 -04:00
e72a0ba5cf Fix FRE-5402: Add missing @shieldai/removebrokers dependency and fix compilation blockers
- Add @shieldai/removebrokers workspace dependency to API package.json
- Fix misleading error message: 'Admin access required' -> 'Support access required'
- Export RemovalRequest, InfoBroker, BrokerListing types from @shieldai/db
- Export RemovalStatus, RemovalMethod, BrokerCategory enums from @shieldai/db
- Fix BrokerAlertPipeline: correlationPipeline -> correlationService.ingestGenericAlert
- Add @shieldai/correlation dependency to removebrokers package
- Fix removalUrl null vs undefined type mismatch in RemoveBrokersService
- Fix shared-billing package.json typo: @shieldsai -> @shieldai for shared-notifications
2026-05-17 03:07:22 -04:00
7410813f4e Fix review findings for info broker removal service FRE-5402
P0 fixes:
- Add CANCELLED status to RemovalStatus enum (types + Prisma schema)
- Use CANCELLED instead of REJECTED for user-initiated cancellations
- Add null guard for req.broker?.name in GET /request/:id
- Remove unsafe 'as any' casts in RemoveBrokersService.ts
- Add type-safe toPersonalInfo() validator for JSON deserialization
- Type RemovalRequestWithBroker properly in getRemovalStatus()
- Fix alert: any to NormalizedAlertInput in BrokerAlertPipeline

P1 fixes:
- Fix admin role check: remove non-existent 'admin', only check 'support'
- Fix BrokerDefinition.category type from string to BrokerCategory
- Add complete OpenAPI spec for all removebrokers routes and schemas
2026-05-17 02:30:00 -04:00
e9e547be78 fix: address code review findings for info broker removal service
- Fix Prisma enum casing: snake_case -> UPPERCASE to match TypeScript types
- Add admin auth guard on POST /process endpoint (P0 security)
- Fix DELETE /request/:id to return valid enum status (REJECTED not cancelled)
- Fix brokerName bug: was set to brokerId, now resolves actual broker name
- Add missing BrokerCategory enum export to types package
- Add HOME_TITLE to AlertSource enum
- Replace unsafe 'as any' casts with proper enum imports
- Fix broker ID with space (familytree Now -> familytreenow)
- Add missing Prisma relation fields for RemovalRequest and BrokerListing
- Add FALSE_POSITIVE to CorrelationStatus enum

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-17 01:45:54 -04:00
Founding Engineer
bd881045f4 Add Info Broker Removal service (FRE-5402)
New service for helping clients remove personal listings from data broker sites.

Service features:
- BrokerRegistry: Catalog of 20+ data brokers with removal methods
- RemoveBrokersService: Core service for scanning, creating removal requests,
  submitting removals, and verifying completions
- RemoveBrokersScheduler: Automated processing of pending removals and
  verification of completed removals
- BrokerAlertPipeline: Alert integration for listing discoveries and removal status

API endpoints (/removebrokers):
- GET /brokers - List available data brokers
- GET /status - Get removal request status and stats
- POST /scan - Scan for personal listings across brokers
- POST /request - Create a new removal request
- GET /request/:id - Get specific removal request details
- DELETE /request/:id - Cancel a removal request
- POST /process - Trigger processing of pending removals
- POST /verify/:id - Manually verify a removal completion

DB models: InfoBroker, RemovalRequest, BrokerListing
Types: BrokerStatus, RemovalStatus, RemovalMethod, and related interfaces
2026-05-17 00:58:23 -04:00
590e15e66e Fix code review findings for FCM/APNs push notifications (FRE-5345)
- P0: Add missing jwt import (remove duplicate getAPNSToken from push.service.ts)
- P0: Fix race condition in getFCMApp() with promise-based initialization lock
- P0: Fix preHandler short-circuit in device.routes.ts (add return before reply.send)
- P1: Replace non-null assertions with safe defaults in notification config
- P1: Add rate limiting on device registration endpoint (10 req/5min per user)
- P2: Add push notification deduplication using content hash
- P2: Add APNs payload size validation (256KB limit)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 22:16:47 -04:00
9f65ebce5d FRE-5398: Fix invoice endpoint customer IDOR (M-3)
- Make verifyCustomerOwnership public in BillingService
- Add ownership verification before fetching invoice history
- Returns 403 if customerId does not belong to authenticated user

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 09:57:57 -04:00
d6f574ff8e FRE-5350: Add property scanner service with ATTOM, USPS, county data integration
- ATTOM Property API integration for structured property data
- USPS address standardization via API
- County clerk/recorder feed scraping for deed changes and liens
- Rate limiting, caching, and retry logic
- Unit tests for each data source adapter
- PropertyRecord, CountyDeedRecord, DataSourceType types in types.ts
- Consolidated type exports in index.ts

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 09:50:21 -04:00
24c31f1b1b FRE-5400: Consolidate webhook secret to single config source
WebhookService.constructEvent now reads from config.stripe.webhookSecret
instead of process.env.STRIPE_WEBHOOK_SECRET, matching BillingService.handleWebhook.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-15 23:30:31 -04:00
7c2b585c16 FRE-5401: Migrate webhook idempotency to distributed Redis store
Replace in-memory Map<string, number> with Redis-based idempotency
using setIfNotExists (NX) for distributed multi-instance deployments.
Removes cleanupOldEvents (no longer needed with Redis TTL).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-15 20:27:12 -04:00
cba5390309 FRE-5348: Fix P1 billing issues
- Add null check for subscription items in updateSubscription
- Implement webhook handlers with Prisma DB persistence
- cancelSubscription already correctly passes cancel_at_period_end

All P1 issues validated and fixed. Ready for Security Review.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-15 14:18:46 -04:00
7ed1a340b9 FRE-5353 Home Title: Dashboard widget + tier gating
- Add hometitle API routes: properties CRUD, changes, alerts, scan
- Implement Premium tier gating with 402 responses for non-Premium users
- Enforce max 5 properties per Premium subscription (0 for Free/Basic, 3 for Plus)
- Build DashboardPage with PropertyCard, AddPropertyForm, AlertsList components
- Add dashboard CSS styles with responsive design
- Register hometitle routes under /hometitle prefix with auth middleware

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 22:51:35 -04:00
08fedf55e6 docs: Add Mixpanel analytics configuration and documentation
- Add MIXPANEL_TOKEN, MIXPANEL_API_SECRET, ANALYTICS_ENV to .env.example
- Add packages/web/.env.example with VITE_MIXPANEL_TOKEN and other analytics vars
- Update docs/MIXPANEL_ANALYTICS.md with complete setup instructions
- Document event taxonomy (30+ events across User, Subscription, DarkWatch, VoicePrint, SpamShield)
- Add KPI definitions (MAU, MRR, conversion, churn, CAC, LTV, NPS, viral coefficient)
- Include integration examples for backend and frontend usage
- Document alert thresholds for monitoring

Implementation was already complete in packages/shared-analytics and packages/web.
This completes the configuration and documentation for Mixpanel setup.

FRE-5281
2026-05-14 22:38:10 -04:00
b1cfce3661 docs: Add Mixpanel analytics configuration documentation
- Documents existing Mixpanel implementation
- Full event taxonomy from shared-analytics package
- Frontend integration via useAnalytics hook
- Required actions for Mixpanel account setup
2026-05-14 21:17:45 -04:00
d0ddb8d159 FRE-5352 Apply P1/P2/P3 fixes from code review: severity type rename, dedup query fix, SMS phone field, test assertions 2026-05-14 14:24:20 -04:00
ece12b6525 FRE-5352 Fix: store scan result in lastScanResult for getLastScanResult()
The runScan() method was returning scanResult but never assigning it
to this.lastScanResult, causing getLastScanResult() to always return null.
2026-05-14 10:53:12 -04:00
4844c5994c FRE-5351 CTO review: finalize hometitle exports and types for alert pipeline + scheduler
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 10:32:44 -04:00
9858834a67 Implement GA4 service with Measurement Protocol calls FRE-5280
- Real GA4 Measurement Protocol implementation (page_view, purchase,
  waitlist_signup, conversion tracking)
- Setup script with manual and automated (GCP Admin API) paths
- GA4 env vars documented in .env.example

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 09:22:36 -04:00
74949d9bcc Add hometitle service: fuzzy matching engine and change detector FRE-5351
- matcher.service.ts: name/address normalization, Levenshtein distance,
  geocoding proximity, confidence scoring (0.0-1.0)
- change-detector.ts: PropertySnapshot diff engine, severity scoring
  (minor/moderate/major), configurable thresholds, alert triggering
- 57 unit tests with 98%+ coverage across all thresholds
2026-05-14 09:09:23 -04:00
1b917321cf assets, move memories to proper location 2026-05-14 07:36:23 -04:00
0bec3c574a FRE-5335 Hook waitlist signup to send confirmation email via Resend
- Added @shieldai/shared-notifications, bullmq, ioredis deps to API
- POST /api/waitlist/signup now sends waitlist_confirmation email via EmailService
- Schedules welcome sequence (day1 intro, day3 features, day7 launch teaser) via BullMQ delayed jobs
- Added waitlist email worker in @shieldai/jobs to process delayed welcome sequence emails
- Templates already in place: waitlist_confirmation, waitlist_intro, waitlist_features, waitlist_launch_teaser with dark-themed HTML layouts

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 07:16:43 -04:00
268889ead4 VoicePrint: Quality improvements P2-1-5, P3-2 (FRE-5006)
- P2-1: Extract duplicate mock ML logic to modular embedding.service.ts / faiss.index.ts
- P2-2: Weak hashes already fixed via SHA-256 (FRE-5002)
- P2-3: Parallel batch processing with chunked Promise.allSettled
- P2-4: Consistent DI pattern via modular imports
- P2-5: Structured logging via ConsoleLogger
- P3-2: Batch jobId computed/logged, persistence blocked on schema

Approved by CTO review (FRE-5338)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-14 07:12:31 -04:00