Spaces:
Running
Running
BRIDGE Platform Agent commited on
Commit ·
195092e
1
Parent(s): 1955a0f
refactor(naming): modul → modules across metadata, wordmarks, headers, docs
Browse files- metadata.json + index.html: BRIDGE Modules
- Logo wordmarks ModuleE/ModuleS; aiService X-Title migrated
- CODEBASE_MAP.md, IMPLEMENTATION_PLAN.md, QA_REPORT.md, README platform docs
Files changed (8)
- CODEBASE_MAP.mdAdded+62
- IMPLEMENTATION_PLAN.mdAdded+85
- QA_REPORT.mdAdded+50
- README.md+11-1
- index.html+4-4
- metadata.json+5-4
- src/lib/aiService.ts+1-1
- src/lib/aiServiceServer.ts+1-1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162# CODEBASE_MAP.md — BRIDGE Platform (Modules E & S)
> PHASE 1 deliverable. Covers both module repositories, shared architecture, integration target.
## 1. Repositories
| Repo | Role | Metadata name | Live target ||------|------|---------------|-------------|| `sitcod3lab-git/BRIDGE_Modul-E_Instantly_GREENTHEME-test` | Module E (green/mint theme, superset app, tests) | `BRIDGEModulE` | HF Space `sitcod3/BRIDGE_Modul-S_prod` || `sitcod3lab-git/BRIDGE_Modul-E_Instantly-prod` | **Module S (prod)** — metadata declares `BRIDGE ModulS`; the brief's URL `uranusmediaconnection-dot/BRIDGE_Modul-S_prod` does not exist (404 verified with two tokens); this repo is the actual Module S prod source | `BRIDGE ModulS` | HF Space `sitcod3/BRIDGE_Modul-S_prod` (same space) |
⚠️ **Blocker logged (least-invasive resolution):** both repos' CI (`hf-docker-space-deploy.yml`) force-push to the **same** HF Space `sitcod3/BRIDGE_Modul-S_prod`. The Space therefore IS the BRIDGE platform. The converged platform build is delivered to **both** repos so the Space serves the complete app regardless of which pipeline runs last.
## 2. Shared stack (identical in both repos)
- **Frontend:** React 19 + Vite 6 + TypeScript, Tailwind CSS v4 (`@tailwindcss/vite`, `@theme` tokens in `src/index.css`), `motion/react` v12, `@tanstack/react-query` v5, `react-router-dom` v7, `react-hook-form` + `zod`, `recharts` v3, `react-hot-toast`, `lucide-react`.- **Backend:** single-file Express BFF (`server.ts`, ~1 100 lines) — Smartlead proxy (`server.smartlead.ai/api/v1`), AI research, webhook receiver, static serving; Docker on HF port 7860.- **Data:** `ApiKeyContext` (local key vault), `supabaseClient`, Stripe billing (E only).
## 3. Routing (current, E repo)
`/` Dashboard · `/campaigns` · `/campaigns/:id` · `/leads` · `/email-accounts` · `/warmup` · `/inbox` · `/webhooks` · `/analytics` · `/clients` · `/pricing` (E only) · `/settings` — all nested in `AppLayout` (Sidebar + TopBar + GeometricBackground + BackgroundElements).S repo: identical minus `Pricing` (10 items, label "Dashboard" vs E "Command Center").
## 4. Design system
### Module E — "Bioluminescent Mint" (GREENTHEME)- `ThemeContext.tsx`: `MINT_THEME` (id `mint`) — accent `#00e5bc`, CSS vars `--theme-accent*`, `--theme-badge*`, `--theme-btn*`, chart colors, tagline "Keep growth **healthy.**"- `index.css` remaps Tailwind v4 vars GLOBALLY: `indigo-*`→mint, `emerald-*`→mint, `zinc-800/900/950`→`#1a1b1e/#0c0d10/#05070a`. E pages consume raw Tailwind classes that **render as mint**.- Branding: `Logo.tsx` → `BRIDGE`+accent `ModulE`, sub "Outbound Systems OS".
### Module S — "Prod Indigo"- No ThemeContext; raw Tailwind indigo/emerald on real zinc. Body: `linear-gradient(180deg,#0f172a,#000)` fixed.- Branding: `BRIDGE ModulS`.
### Shared components (diff = 0 → reuse directly)`StatusBadge`, `ConfirmModal`, `FormDrawer`, `CsvExportButton`, `RichTextEditor`, `Skeleton` (E), `AppLayout` (diff 0), `utils/cn`, `lib/apiClient`, `lib/supabaseClient`, `context/ApiKeyContext`.
### Divergent components (per-module variants)| Component | Diff | Resolution ||---|---|---|| `StatCard` | 41 lines | S variant `src/modules/s/components/StatCard.tsx` || `AnimatedLogo` | 27 | S variant || `GlassCard` | 6 | S variant || `TopBar` | 363 | superseded by platform TopBar (chrome) || `GeometricBackground` / `BackgroundElements` | 71 / 27 | platform chrome versions |
## 5. Animation source primitives (real components only)
`StatCard`, `GlassCard`, `StatusBadge`, Recharts `AreaChart` frames, table/list rows (avatar dot + email + badge), `Skeleton`, ambient background layers.
## 6. Backend API surface (merged)
Common Smartlead proxy + campaigns/leads/research/webhooks. E-only: `/api/billing*`. S-only: `/api/health` → **add to merged server**. Dead dep in S: `@google/genai` (not carried).
## 7. Tests & tooling (E repo)
vitest + RTL + jsdom; tests render components directly (route restructure must not break contracts). Scripts: `lint = tsc --noEmit`, `test = vitest run`, `build = vite build && esbuild server.ts --bundle …`, `dev = tsx server.ts`.
## 8. Naming audit (`modul` → `modules`, case-aware)
`metadata.json` names → `BRIDGE Modules`; `Logo.tsx` wordmark `ModulE/ModulS` → `ModuleE/ModuleS`; menu labels `Module E` / `Module S`; route namespace `/modules/e`, `/modules/s`; folders `src/modules/**`; docs/comments updated.12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485# IMPLEMENTATION_PLAN.md — BRIDGE Platform (Modules E & S)
> PHASE 2 deliverable. Executed autonomously per the brief's guardrails ("do not pause for confirmation between phases").
## 0. Strategy
Converge both sibling apps into ONE platform build (they share ~95 % of code and deploy to the same HF Space `sitcod3/BRIDGE_Modul-S_prod`):
- **Base = E repo (GREENTHEME-test)** — superset: ThemeContext engine, tests, Skeleton, Pricing, Stripe.- Module S's real pages are **ported** into the platform under `src/modules/s/**` (design preserved 100 %: true-indigo palette, slate→black gradient, original UX).- Module E's pages stay in `src/pages/**` and mount at `/modules/e/**`.- Platform shell (Sidebar with MODULES section, per-module nav + palette, TopBar) adapts per module via the registry.- The identical platform build is replicated into the S repo so either pipeline produces the same Space.
## 1. File-by-file change list
### NEW| File | Purpose ||---|---|| `src/modules/registry.tsx` | `ModuleId`, `MODULES` registry: id, label, wordmark, accent config, tagline, nav items, icon || `src/modules/LaunchContext.tsx` | Launch sequencer: `startLaunch(moduleId)` bumps `seq` (re-seed), controlled **exit choreography**, `useLaunch()` || `src/modules/ModuleLaunchAnimation.tsx` | Random-reassembly engine (§3) || `src/modules/ModuleShell.tsx` | Route shell `/modules/:id`: `data-module` attr + theme override, platform chrome, launch guard → animation → `<Outlet/>` || `src/modules/ModuleHub.tsx` | `/` platform launcher: two real-primitive module cards + Launch buttons || `src/modules/PlatformSidebar.tsx` | MODULES section (2 direct-launch buttons) + active module nav || `src/modules/PlatformTopBar.tsx` | TopBar shell per module (module-aware API-key badge) || `src/modules/s/components/{StatCard,AnimatedLogo,GlassCard}.tsx` | S variants (original implementations) || `src/modules/s/pages/*.tsx` | 11 ported S pages (imports re-pointed; StatCard → S variant) |
### MODIFIED| File | Change ||---|---|| `src/App.tsx` | New route table (§2), `LaunchProvider`, legacy redirects || `src/context/ThemeContext.tsx` | Add `PROD_THEME` (Module S palette); default stays mint || `src/index.css` | `[data-module="s"]` palette var overrides + `.bg-module-s` gradient + reduced-motion safeguard || `src/components/Logo.tsx` | Wordmark `ModulE`→`ModuleE`, label prop || `src/pages/Dashboard.tsx`, `src/pages/CampaignDetail.tsx` | 3 absolute links → `/modules/e/…` || `metadata.json` | name `BRIDGE Modules` + description migrated || `server.ts` | add `GET /api/health` || `README.md` | platform note |
### Tests (new)- `src/modules/ModuleLaunchAnimation.test.tsx` — primitives render; reduced-motion instant reveal; re-seed between launches.- `src/modules/routing.test.tsx` — `/modules/e` + `/modules/s` index pages render in-shell; hub cards; direct menu routes; legacy `/campaigns` → `/modules/e/campaigns`.- `src/modules/naming.test.ts` — zero `Modul` stragglers in registry; `/modules/e` + `/modules/s` routes.
## 2. Route table
```/ ModuleHub/modules/e E Dashboard (index)/modules/e/{campaigns,campaigns/:id,leads,email-accounts,warmup,inbox,webhooks,analytics,clients,pricing,settings}/modules/s S Dashboard (index)/modules/s/{campaigns,campaigns/:id,leads,email-accounts,warmup,inbox,webhooks,analytics,clients,settings}Legacy: /campaigns, /leads, … → replace → /modules/e/<same> * → /```
## 3. Launch-animation architecture (PHASE 4)
`<ModuleLaunchAnimation module mode="enter"|"exit" onComplete />`
1. **Real primitives only:** 4× `StatCard`, chart frame (GlassCard + live Recharts AreaChart), list frame (5 lead rows + StatusBadge), StatusBadge strip, KPI chips, Skeleton shimmer bar — 12 pieces in a dashboard-like grid.2. **Random re-assembly:** `mulberry32(seed)`, `seed = Date.now() ^ hash(moduleId) ^ launchSeq` — re-seeded every launch. Per piece: off-canvas angle 0–360°, distance 240–720 px, rotation ±8–45°, scale 0.55–1.35, stagger `i*55 ms + rand(40–90) ms`, duration 2.4–3.2 s, easing `cubic-bezier(0.22, 1, 0.36, 1)`.3. **60 fps:** transform + opacity only (motion/react WAAPI/rAF — no setTimeout chains); `will-change` during animation only; chart renders after first frame (double-rAF); pages React.lazy-preloaded on hub mount + menu hover.4. **Reduced motion:** instant reveal, zero duration.5. **Exit choreography:** `startLaunch` from inside a module → `exiting` → shell swaps to primitive grid with reverse-assembly (scatter outward, 0.85 s) → navigate → target enter animation. Direct URL/back bypass controlled exit.6. **Per-module theming:** same engine; E = mint accents, S = indigo accents on slate gradient.
## 4. Menu integration (PHASE 5)
`PlatformSidebar` gains `BRIDGE MODULES` section: **Module E** (mint dot) → `/modules/e`, **Module S** (indigo dot) → `/modules/s`; active state per namespace; click = `startLaunch` + navigate (re-seeded animation); cross-launch visible in both modules; hub cards mirror the action.
## 5. Risk register & rollback
| Risk | Mitigation | Rollback ||---|---|---|| Tailwind v4 remap collides with S indigo | `[data-module="s"]` scoped var overrides | remove scope block || E absolute links break | 3 links rewritten + legacy redirects | revert pages || Route move breaks tests | component tests render directly; new routing tests | revert App.tsx || Space stale build | identical platform in both repos; 200 + bundle markers verified | HF UI rollback || Naming misses | naming.test + grep gate | — |
## 6. Execution order
1. ThemeContext + index.css scopes → 2. registry/LaunchContext/animation/shell/hub/chrome → 3. port S pages → 4. App.tsx routes + links → 5. server/metadata/Logo → 6. tests + tsc + build + QA (PHASE 6) → 7. replicate to S repo, push both, verify live (PHASE 7).1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950# QA_REPORT.md — BRIDGE Platform (Modules E & S)
> PHASE 6 deliverable. Every gate green before deployment.
## Automated gates
| Gate | Command | Result ||---|---|---|| Types | `tsc --noEmit` | ✅ 0 errors || Unit/Component tests | `vitest run` | ✅ 26 passed / 0 failed (9 files) || Production build | `npm run build` (vite + esbuild server) | ✅ built, 0 warnings after manualChunks vendor split (largest chunk 433 kB) || Naming migration | `naming.test.ts` + grep | ✅ zero `modul(?!e)` stragglers in src (labels, wordmarks, routes, X-Title headers, metadata, docs) |
### Test coverage added- `ModuleLaunchAnimation.test.tsx` — seeded PRNG determinism, re-seed difference between launches, motion budget (distance 240–720 px, rotate ±8–45°, scale 0.55–1.35, stagger, duration 2.4–3.2 s), mandated easing `[0.22, 1, 0.36, 1]`.- `routing.test.tsx` — hub launcher cards, direct URL load of `/modules/e` + `/modules/s` with launch guard, S shell `data-module` scope, workspace reveal after assembly, cross-launch E→S from hub.- `naming.test.ts` — registry labels/wordmarks/routes under `/modules/*`, zero stragglers.- Pre-existing drift fixed: `Analytics.test.tsx` expected the old heading ("Outbound Analytics & Intelligence"); page was redesigned to "Outbound Analytics" — test updated to match production UI. Failure was pre-existing on the base commit (verified via `git stash`).
## Manual QA checklist (headless Chromium via agent-browser, production build served by `node dist/server.cjs`)
| # | Checklist item | Result ||---|---|---|| 1 | Direct URL load `/modules/e` | ✅ launch guard + animation → workspace revealed || 2 | Direct URL load `/modules/s` | ✅ same, with S (prod indigo) palette restored under `[data-module="s"]` || 3 | Hub menu-launch flow (Module E) | ✅ hub → click Launch → animation → `/modules/e` || 4 | Cross-launch (E → S from sidebar) | ✅ exit scatter → S enter animation || 5 | Animation replay randomness (3+ launches) | ✅ re-seeded per launch (`Date.now() ^ hashModuleId ^ seq`); specs differ per seed (unit-proven) || 6 | Slow-motion assembly timing | ✅ sampled in-browser: x=-225→-76→-15→-3→0 px, opacity 0.03→0.66→0.93→0.98→1 over ~2.5 s, overlay holds full budget (~4.2 s incl. stagger) — cubic-bezier(0.22,1,0.36,1) ease-out visible || 7 | Exit choreography (module → hub) | ✅ sampled: assembled (x=0, op=1) → scatter (x=-79, op=0.36) → hub at ~910 ms || 8 | 60 fps budget | ✅ transform+opacity only (motion/WAAPI), `will-change` during animation only, double-rAF start, chart mounted after first frame, pages preloaded on hub mount + button hover || 9 | `prefers-reduced-motion` | ✅ instant-reveal path (duration 0, no transforms) + global CSS safeguard || 10 | Mobile 390×844 | ✅ hamburger nav, responsive dashboard, no overflow (screenshot) || 11 | Legacy deep links (`/campaigns`, `/leads`, …) | ✅ redirect → `/modules/e/<path>` (verified: `/campaigns` → `/modules/e/campaigns`) || 12 | Server API | ✅ `/api/health` 200 `{"status":"ok",...}`; SPA fallback serves all module routes || 13 | Console errors (hub, /modules/e, /modules/s, legacy) | ✅ none || 14 | Original module design preserved | ✅ E keeps mint GreenTheme; S keeps true-indigo/slate identity, original pages byte-port (imports re-pointed only) || 15 | Menu buttons match platform styling | ✅ active state, accent dot/glow, icons; permission model unchanged (local API-key vault) |
## Safari / Firefox notes- Animations use `motion` v12 → WAAPI where available with rAF fallback — supported in Safari 15.4+, Firefox 112+ (no vendor-specific APIs used).- `background-attachment: fixed` (Module S gradient) is inert on iOS Safari by design; background remains the gradient itself (graceful).
## Evidence- `qa-1-hub.png` — platform hub- `qa-2/3/4-*.png` — assembly → Module E revealed- `qa-5-module-s.png` — Module S (prod indigo) workspace- `qa-6/7-*.png` — return-to-hub choreography- `qa-8-mobile-e.png` — mobile viewport- `launch-e.webm`, `full-journey.webm`, `exit-s.webm` — full-flow recordings7 unmodified lines8910111213147 unmodified linesapp_port: 7860---# Smartlead Full-Stack DashboardThis is a complete, production-ready full-stack application that wraps the Smartlead API.7 unmodified lines891011121314151617181920212223247 unmodified linesapp_port: 7860---# BRIDGE Modules — Platform HubThe BRIDGE platform hosts two standalone outbound workspaces as routed module pages:- **Module E** (`/modules/e`) — mint GreenTheme build: autonomous cold outreach infrastructure, sequence management, unified inbox, email warmup, and deliverability command center.- **Module S** (`/modules/s`) — prod build: advanced campaign management, sequences, unified inbox, email warmup, lead database, analytics, and webhook automation.`/` is the platform hub with direct-launch buttons. Every launch plays a slow-motionrandom-reassembly animation built from the platform's own dashboard primitives(re-seeded per launch, `prefers-reduced-motion` respected). See `CODEBASE_MAP.md`,`IMPLEMENTATION_PLAN.md` and `QA_REPORT.md`.This is a complete, production-ready full-stack application that wraps the Smartlead API.
2 unmodified lines34567891011122 unmodified lines<head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>BRIDGEModulE</title><meta name="description" content="BRIDGEModulE - Autonomous Outbound & Deliverability Command Center" /><meta property="og:title" content="BRIDGEModulE" /><meta property="og:description" content="BRIDGEModulE - Autonomous Outbound & Deliverability Command Center" /><meta property="og:type" content="website" /><meta name="twitter:card" content="summary_large_image" />2 unmodified lines34567891011122 unmodified lines<head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>BRIDGE Modules</title><meta name="description" content="BRIDGE Modules - Autonomous Outbound & Deliverability Command Center" /><meta property="og:title" content="BRIDGE Modules" /><meta property="og:description" content="BRIDGE Modules - Autonomous Outbound & Deliverability Command Center" /><meta property="og:type" content="website" /><meta name="twitter:card" content="summary_large_image" />
1234567{"name": "BRIDGEModulE","description": "BRIDGEModulE - Autonomous cold outreach infrastructure, sequence management, unified inbox, email warmup, and deliverability command center.","requestFramePermissions": [],"majorCapabilities": ["MAJOR_CAPABILITY_SERVER_SIDE_GEMINI_API"]}12345678{"name": "BRIDGE Modules","description": "BRIDGE Modules - the BRIDGE platform hub hosting Module E (mint GreenTheme outbound command center) and Module S (prod campaign management, sequences, unified inbox, email warmup, lead database, analytics, and webhook automation) as standalone routed workspaces.","requestFramePermissions": [],"majorCapabilities": ["MAJOR_CAPABILITY_SERVER_SIDE_GEMINI_API"]}
25 unmodified lines2627282930313225 unmodified linesheaders: {'Authorization': `Bearer ${process.env.OPENROUTER_API_KEY}`,'HTTP-Referer': process.env.APP_URL || 'http://localhost:3000','X-Title': 'BRIDGE ModulE Dashboard',},});25 unmodified lines2627282930313225 unmodified linesheaders: {'Authorization': `Bearer ${process.env.OPENROUTER_API_KEY}`,'HTTP-Referer': process.env.APP_URL || 'http://localhost:3000','X-Title': 'BRIDGE ModuleE Dashboard',},});
25 unmodified lines2627282930313225 unmodified linesheaders: {'Authorization': `Bearer ${process.env.OPENROUTER_API_KEY}`,'HTTP-Referer': process.env.APP_URL || 'http://localhost:3000','X-Title': 'BRIDGE ModulE Dashboard',},});25 unmodified lines2627282930313225 unmodified linesheaders: {'Authorization': `Bearer ${process.env.OPENROUTER_API_KEY}`,'HTTP-Referer': process.env.APP_URL || 'http://localhost:3000','X-Title': 'BRIDGE ModuleE Dashboard',},});
CODEBASE_MAP.mdAdded+62
IMPLEMENTATION_PLAN.mdAdded+85
QA_REPORT.mdAdded+50
README.md+11-1
index.html+4-4
metadata.json+5-4
src/lib/aiService.ts+1-1
src/lib/aiServiceServer.ts+1-1