Developer Guide: Frontend
This section documents the ACM frontend as it exists today: a Vite-built React app mounted into WordPress and served from the plugin.
Read These First
Source of Truth
The frontend code lives in the plugin container at:
ui/srcfor React sourceui/package.jsonfor build scriptsui/vite.config.tsfor bundlingincludes/class-frontend-app.phpfor WordPress mounting and browser bootstrap
What Makes This Frontend Unusual
- assets are same-origin with WordPress
- API calls are cross-origin to
api.apicostx.com - auth state begins in WordPress PHP, not in a standalone SPA backend
- a session token is injected into
window.acm2Config - the app uses
HashRouter - only the
Qualitypage is lazy-loaded today
Frontend Ownership
Frontend changes often cross three layers:
- React app code in
ui/src - WordPress plugin PHP that injects assets and config
- backend behavior that the browser depends on
When changing a user-facing flow, always think across all three.