Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/proposals/resumier-microfrontend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Proposal: Embed Resumier as the Documents microfrontend

## Summary
Replace the existing Documents page in THRIVE with the Resumier microfrontend so the documents workflow is powered by the Prosperis Resumier app. The microfrontend will run standalone for demos while also being embedded into THRIVE for production usage.

## Goals
- Swap the `/documents` route in THRIVE to host the Resumier microfrontend.
- Support a standalone Resumier deployment that can also be embedded as an iframe/microfrontend.
- Keep the integration configurable via environment variables for local and production environments.

## Non-goals
- Rewriting THRIVE document data stores or migrations in this PR.
- Designing cross-app data synchronization (handled in the Resumier microfrontend backlog).

## Proposed Integration Approach
1. **Microfrontend Embed**
- Expose Resumier as an embeddable experience (microfrontend build or hosted app).
- THRIVE loads Resumier via an iframe (or later via module federation) so the Documents page fully delegates to Resumier.

2. **Configuration**
- Add a `VITE_RESUMIER_URL` environment variable in THRIVE to point to the Resumier deployment.
- Local development can point to `http://localhost:<port>` when running Resumier standalone.

3. **Progressive Enhancement**
- Short term: iframe-based embed for quick validation.
- Medium term: switch to a first-class microfrontend (module federation or web component) once Resumier publishes a stable remote entry.

## Open Questions / Follow-ups
- What is the canonical deployment URL for Resumier in each environment (dev/staging/prod)?
- Does Resumier need SSO or token handoff from THRIVE for access control?
- Should THRIVE retain a fallback Documents view in case Resumier is unreachable?

## Rollout Plan
1. Merge the embed-only integration in THRIVE.
2. Deploy Resumier standalone and confirm embedding works in THRIVE.
3. Iterate on shared auth/session and data contract if needed.

## Acceptance Criteria
- Navigating to `/documents` shows the Resumier microfrontend.
- The embed URL is configurable via `VITE_RESUMIER_URL`.
- THRIVE builds without requiring the old Documents page implementation.
28 changes: 28 additions & 0 deletions src/components/features/documents/ResumierMicrofrontend.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export function ResumierMicrofrontend() {
const resumierUrl = import.meta.env.VITE_RESUMIER_URL as string | undefined;

if (!resumierUrl) {
return (
<div className="flex h-full min-h-[60vh] w-full items-center justify-center p-8">
<div className="max-w-xl text-center text-sm text-muted-foreground">
<h1 className="mb-2 text-lg font-semibold text-foreground">Resumier microfrontend</h1>
<p>
Set <code className="rounded bg-muted px-1 py-0.5">VITE_RESUMIER_URL</code> to
load the Resumier microfrontend in the documents page.
</p>
</div>
</div>
);
}

return (
<div className="h-full w-full">
<iframe
title="Resumier microfrontend"
src={resumierUrl}
className="h-full min-h-[80vh] w-full border-0"
Comment on lines +20 to +23

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Forward document selection into embed URL

The iframe src is always just VITE_RESUMIER_URL, so any document-selection context in the parent URL is dropped. Other parts of the app still navigate to /documents with a docId query (e.g., LinkedDocumentsPopover uses navigate({ to: '/documents', search: { docId } })), which previously opened a specific document. With the new embed, that docId never reaches Resumier, so clicking “View document” from an application will no longer open the intended document. Consider appending window.location.search (or a docId param) to the iframe src, or using postMessage, so the microfrontend can preserve this deep-link behavior.

Useful? React with 👍 / 👎.

allow="clipboard-read; clipboard-write"
/>
</div>
);
}
Loading