My Compass Phone App
Standalone WordPress backend and REST routing platform for the My Compass Phone mobile web application.
by Hall of the Gods, Inc. · github.com/hallofthegods/xophz-compass-phone
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/hallofthegods/xophz-compass-phone/releases/download/v26.9.7/xophz-compass-phone-26.9.7.zipReadme
📱 My Compass Phone
Standalone WordPress backend router, passwordless authentication server, and single-page web app container for the My Compass Phone mobile experience in the Xophz COMPASS ecosystem.
⚡ Overview
My Compass Phone (xophz-compass-phone) serves as the dedicated WordPress backend plugin and SPA container for the mobile presentation, command center, and ecosystem phone client of Xophz COMPASS.
It provides seamless URL rewrite routing (hosting the client application at /my-compass-phone or a customizable slug), passwordless Magic Link & 6-digit OTP verification, secure REST API authentication endpoints, and Hot Module Replacement (HMR) proxying for local Vite development.
✨ Key Features
📱 Standalone Single-Page Application Host
- Custom Route Interception: Automatically routes web traffic from
/my-compass-phone(or custom configured slug) to the client application without requiring standard WordPress theme overhead. - Catch-All Frontend Routing: Implements rewrite rules to support deep linking and client-side routing (Vue Router / History mode).
- Automatic Asset Rewriting: Dynamically rewrites production bundle paths (
/assets/*,/vite.svg) to serve directly from the plugin'spublic/dist/directory.
🔑 Passwordless Magic Link & OTP Authentication
- 6-Digit Verification Codes: Generates 6-digit numeric OTPs stored in WordPress transients with 15-minute expiration windows.
- One-Click Magic Links: Emails direct sign-in URLs containing token payloads to rapidly log users into the mobile app experience.
- Auto-Account Provisioning: Automatically registers new user accounts upon first successful Magic Link verification for frictionless onboarding.
- Password Authentication Fallback: Supports standard WordPress username/email and password authentication.
⚡ Vite Development Proxy & HMR Bridge
- Dev Mode Detection: Automatically detects
WP_ENV === 'development'orWP_DEBUG. - Vite Server Integration: Proxies assets and injects Vite HMR client scripts from the Vite development server running on port
8086. - State & Nonce Injection: Automatically injects
window.wpApiSettings(root,nonce,pluginUrl,version,userId) into both development and production HTML outputs.
⚙️ Customizable Deployment & Administrative Control
- WP Admin Settings Page: Accessible via
Settings > My Compass Phonein WordPress Admin. - Configurable Slug: Easily modify the endpoint slug (default:
my-compass-phone) with automated rewrite rule flushing upon saving.
🚀 REST API Endpoints
All authentication endpoints are registered under the compass-phone/v1 namespace.
Authentication Endpoints (compass-phone/v1)
| Method | Endpoint | Description | Payload / Query Params |
|---|---|---|---|
POST |
/wp-json/compass-phone/v1/check-email |
Check if an account exists and retrieve avatar & display name. | { "email": "user@example.com" } |
POST |
/wp-json/compass-phone/v1/login |
Authenticate using email/username and password. Sets auth cookies and returns fresh REST nonce. | { "email": "user@example.com", "password": "..." } |
POST |
/wp-json/compass-phone/v1/send-magic-link |
Dispatch a 6-digit OTP code and Magic Link to the provided email address. | { "email": "user@example.com" } |
POST |
/wp-json/compass-phone/v1/verify-magic-link |
Verify a 6-digit OTP code or Magic Link token. Auto-creates account if new user. | { "token": "123456" } |
GET |
/wp-json/compass-phone/v1/me |
Fetch active user session details, role list, display name, and updated REST nonce. | Header: X-WP-Nonce or Cookie |
POST |
/wp-json/compass-phone/v1/logout |
Terminate user session, clear auth cookies, and return guest REST nonce. | - |
🏗️ Architecture & Dev Workflow
The plugin functions as the backend bridge for the Vue 3 frontend application located in apps/my-compass-phone.
Xophz-COMPASS/
├── apps/
│ └── my-compass-phone/ # Vue 3 + Vite Frontend Application
│ ├── src/ # UI Components, Composables & Views
│ └── vite.config.ts # Configured for dev server port 8086
└── wp-content/plugins/
└── xophz-compass-phone/ # WordPress Backend Plugin
├── includes/
│ └── class-xophz-compass-phone-auth-rest.php # REST Controller
├── public/
│ └── dist/ # Production build target (`vite build`)
└── xophz-compass-phone.php # Main plugin & rewrite router
Development Mode
- Start the Vite development server in
apps/my-compass-phone(runs on port8086). - Navigate to
http://localhost/my-compass-phone. - The plugin detects development mode, fetches the HTML from
http://compass:8086/, injectswindow.wpApiSettings, and enables HMR.
Production Build
- Build the frontend app:
pnpm --filter my-compass-phone build - Assets compile directly to
wp-content/plugins/xophz-compass-phone/public/dist/. - The plugin serves
public/dist/index.htmlwith injected session settings for non-dev environments.
🛠️ Installation & Setup
- Clone or copy
xophz-compass-phoneinto your WordPress plugins directory:wp-content/plugins/xophz-compass-phone - Ensure core COMPASS plugin (
xophz-compass) is active. - Activate My Compass Phone in WordPress Admin (
Plugins > Installed Plugins). - Configure the deployment slug under
Settings > My Compass Phone(defaults to/my-compass-phone).
🧪 Developer Hooks & Integration
The plugin hooks into WordPress core actions and provides standard extensibility points:
// Listen for user login via Phone Auth REST controller
add_action( 'wp_login', function( $user_login, $user ) {
// Custom action when user authenticates through My Compass Phone
}, 10, 2 );
// Access global REST API settings injected into client window
// window.wpApiSettings = {
// root: "http://example.com/wp-json/",
// nonce: "a1b2c3d4e5",
// pluginUrl: "http://example.com/wp-content/plugins/xophz-compass-phone/",
// version: "26.7.29.1425",
// userId: 1
// };
📄 License & Attribution
Developed with ❤️ by Hall of the Gods, Inc.
Licensed under the GNU General Public License v2.0 or later.
Read the full README on GitHub →
Releases
| Tag | Published | Asset | Downloads |
|---|---|---|---|
| v26.9.7 | Sep 8, 2026 | xophz-compass-phone-26.9.7.zip | 1 |
| v26.9.8 | Sep 8, 2026 | xophz-compass-phone-26.9.8.zip | 1 |
| v26.9.5 | Sep 5, 2026 | xophz-compass-phone-26.9.5.zip | 3 |
| v26.9.4 | Sep 4, 2026 | xophz-compass-phone-26.9.4.zip | 2 |
| v26.9.3 | Sep 3, 2026 | xophz-compass-phone-26.9.3.zip | 1 |
| v26.9.1 | Sep 2, 2026 | xophz-compass-phone-26.9.1.zip | 1 |
| v26.9.2 | Sep 2, 2026 | xophz-compass-phone-26.9.2.zip | 1 |
| v26.8.30 | Aug 30, 2026 | xophz-compass-phone-26.8.30.zip | 1 |
| v26.8.27 | Aug 28, 2026 | xophz-compass-phone-26.8.27.zip | 1 |
| v26.8.28 | Aug 28, 2026 | xophz-compass-phone-26.8.28.zip | 1 |
| v26.8.21 | Aug 22, 2026 | xophz-compass-phone-26.8.21.zip | 1 |
| v26.8.22 | Aug 22, 2026 | xophz-compass-phone-26.8.22.zip | 1 |
| v26.8.18 | Aug 18, 2026 | xophz-compass-phone-26.8.18.zip | 1 |
| v26.8.17 | Aug 17, 2026 | xophz-compass-phone-26.8.17.zip | 1 |
| v26.8.16 | Aug 16, 2026 | xophz-compass-phone-26.8.16.zip | 1 |
| v26.8.12 | Aug 13, 2026 | xophz-compass-phone-26.8.12.zip | 1 |
| v26.8.13 | Aug 13, 2026 | xophz-compass-phone-26.8.13.zip | 1 |
| v26.8.9 | Aug 10, 2026 | xophz-compass-phone-26.8.9.zip | 1 |
| v26.8.10 | Aug 10, 2026 | xophz-compass-phone-26.8.10.zip | 1 |
| v26.8.5 | Aug 6, 2026 | xophz-compass-phone-26.8.5.zip | 0 |
| v26.8.6 | Aug 6, 2026 | xophz-compass-phone-26.8.6.zip | 0 |
| v26.7.31 | Jul 31, 2026 | xophz-compass-phone-26.7.31.zip | 2 |
| v26.7.29 | Jul 30, 2026 | xophz-compass-phone-26.7.29.zip | 1 |
| v26.7.30 | Jul 30, 2026 | xophz-compass-phone-26.7.30.zip | 1 |
| v26.7.23 | Jul 24, 2026 | xophz-compass-phone-26.7.23.zip | 0 |