PolicyEngine / PolicyEngine/policyengine-app-v2

Migrate external apps from iframes to Next.js multi-zones

Open
#877 1 comment 0 reactions 1 assignee View on GitHub

@SakshiKekre is already working on this.

Since Mar 30, 2026.

Dominant language
HTML
Stars
1
Forks
3
Avg merge
1d 50m
Merged PRs (30d)
39

Description

Summary

External interactive apps (WATCA, TAXSIM, Oregon Kicker, CA Wealth Tax, marriage calculator, etc.) are currently embedded via iframes inside a wrapper page. This causes:

  • No shared header/footer with the main site (rewrite-proxied apps like Model and API render their own chrome)
  • Cross-env linking issues — links inside proxied apps go to production instead of the current environment (#565, #579, #580)
  • Iframe-specific UX limitations (no URL bar updates, no back button integration, CSP constraints)

Proposed approach

Convert external apps to Next.js multi-zones — each app is an independent Next.js app that renders full pages (no iframe) under policyengine.org.

What each zone app needs
  • assetPrefix in next.config.ts to avoid asset collisions
  • Import shared Header/Footer from @policyengine/ui-kit
  • Asset rewrites in the main website's next.config.ts
  • Cross-zone links use <a> tags (hard navigation), not <Link>
What the main website needs
  • Rewrites for each zone's paths AND asset prefix paths
  • serverActions.allowedOrigins config if zones use Server Actions
Benefits
  • Seamless navigation — no iframe boundary, shared header/footer
  • Cross-env linking works — each zone renders its own header with relative links
  • Independent deploys per zone
  • Each zone can have its own build/framework if needed

Prerequisites

  • @policyengine/ui-kit Header/Footer integration (#793)
  • Website cutover to production (#817)

Related

  • #793 — Extract header/footer into shared package
  • #817 — Next.js cutover + cleanup
  • #565, #579, #580 — Preview env cross-app linking issues
  • #860 — Port Tailwind/shadcn foundation (PR #875)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.