refactor: environment-specific config, lazy route loading, payment strategy pattern, component-based email templates - #661
Merged
Merged
Conversation
…rategy pattern, component-based email templates
|
@CeceOs92 is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@CeceOs92 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements four platform refactors: environment-aware configuration with secret management, route-level code splitting for the frontend, a strategy pattern for multi-chain payments, and a component-based email templating system.
Closes #606
Closes #607
Closes #608
Closes #609
#606 — Environment-specific configuration
backend/src/config/environments/{development,staging,production}.ts), merged intoprocess.envbefore Zod validation inconfig.tsAWS_SECRETS_MANAGER_ENABLED) with arefreshConfig()runtime-refresh capabilitynpm run config:validate/config:drift/config:docsscripts +.github/workflows/config-validation.yml, auto-generateddocs/config/CONFIGURATION.mdinfra/main.tf: newaws_secretsmanager_secret.app_secrets+ read policy per environment#607 — Lazy-loaded, code-split frontend routing
app/[locale]/error.tsx,app/admin/error.tsx,app/global-error.tsxapp/offline), wired intopublic/sw.jsas the final navigation fallbackcomponents/navigation/PrefetchLink.tsx— hover/focus prefetching viarouter.prefetch()components/analytics/RouteTransitionMetrics.tsx— route-transition timing reported through the existing web-vitals beaconnext.config.tssplitChunksto cover all feature routes (admin/payments/security/onboarding/logs/accessibility) and fixed the existing dashboard/auth/forms cache groups, which weren't matching the actualapp/[locale]/...pathsbundle-budget.json,scripts/check-bundle-size.mjs,.github/workflows/bundle-size.yml#608 — Strategy pattern for multi-chain payments
PaymentProviderstrategy interface, Stellar/EVM/fiat/credit strategies, and router into real traffic for the first timeproviders/mock.tsfor deterministic strategy tests;payment-router.test.tscovers selection, fallback, and failure pathsPaymentInput.token)unified-payment-tracker.ts— persists every payment, regardless of strategy, into the existingPaymenttableroutes/payment-strategies.ts(/api/v1/payment-strategies) and aStrategyConfigPaneltab on/admin/configurationshowing per-strategy health and metrics#609 — Component-based email templates
templates/components/{layout,header,footer,button}.hbs), auto-registered byEmailTemplateEnginerenderWithLayout()implements template inheritance: content renders standalone, then injects into the shared layouttemplates/registry.ts— Zod-typed template definitions (renderTypedTemplate<K>) for compile- and runtime-safe variables, plus deterministic A/B variant bucketingGET /api/v2/email/templates/registry[/:id/preview]) and a preview UI atfrontend/app/dashboard/emailsScope notes
npm installverification (workspace install was too slow in this environment) — scripts were validated in an isolated sandbox insteaddynamic()audit inside pages not done; route-transition metric is an approximation, not true click-to-paintcontracts/src/lib.rsuntouched (out of scope for a service-layer refactor); recommend runningnpm run test -w backendbefore mergewelcome-emailandpayment-receivedmigrated to the new registry as a proof of pattern; full template catalog migration and A/B-variant wiring into delivery analytics are follow-upsTest plan
npm run test -w backend(payment-router strategy tests)npm run config:validate && npm run config:driftinbackend/npm run build && npm run bundle:checkinfrontend//admin/configuration(Payment Strategies tab) and/dashboard/emailspreview page