commit 5cb295d0aa00e664a57ae8eecf9434575c3f0e19 Author: tortuga Date: Fri May 8 00:14:58 2026 +0000 Initial commit diff --git a/admin.html b/admin.html new file mode 100644 index 0000000..c891273 --- /dev/null +++ b/admin.html @@ -0,0 +1,697 @@ + + + + + + + Admin Dashboard • Moxiegen + + + + + +
+
+
+ + Moxiegen + Moxiegen + + / + Admin +
+
+ ← Back to Site + +
+
+
+ + + + + +
+ +
+
+
Total Users
+
-
+
+
+
New Messages
+
-
+
+
+
Total Credits
+
-
+
+
+
Active API Keys
+
-
+
+
+ + +
+ + +
+ + +
+
+

Contact Submissions

+
+ +
+
+ +
+
+

Loading messages...

+
+ + + + +
+ + + +
+ + + + + + + + + + + + diff --git a/dashboard.html b/dashboard.html new file mode 100644 index 0000000..5fbc186 --- /dev/null +++ b/dashboard.html @@ -0,0 +1,496 @@ + + + + + + Dashboard • Moxiegen + + + + + + + + +
+ +
+

Welcome back, User

+

Manage your API keys, credits, and account settings.

+
+ + +
+ +
+
+ Credits + 💰 +
+
--
+

Available balance

+
+ + +
+
+ API Keys + 🔑 +
+
--
+

Active keys

+
+ + +
+
+ Plan + +
+
--
+

--

+
+
+ + +
+ +
+
+

API Keys

+ +
+ +
+
+
+
+ + +
+ + +
+

Recent Activity

+ +
+
+
+
+
+ + +
+
+ + +
+

Account Settings

+ +
+
+ + +
+
+ + +
+
+ +
+ + +
+
+
+ + +
+ + + + + + + + diff --git a/index-o.html b/index-o.html new file mode 100644 index 0000000..20e62f0 --- /dev/null +++ b/index-o.html @@ -0,0 +1,591 @@ + + + + + + + Moxiegen • Our Algos, Your AI Advantage + + + + + + + + +
+
+
+ + +
+
+
+ NOW IN ENTERPRISE BETA +
+ +

+ Our Algos,
your AI Advantage. +

+ +

+ Moxiegen offers algorithmic enhancement of enterprise LLM and AI models, + increasing efficiency of both inference and training by 10-100x. +

+ +
+ + + + See Moxy Go + +
+
+ + + +
+
+
+ + +
+
+
+
+

See Moxy Go.

+

Real-time performance leaderboard

+
+ + +
+
+
+ 🏆 + LIVE LEADERBOARD +
+
Updated 11 seconds ago
+
+ +
+

[Leaderboard Placement]

+

Insert your Moxy Go leaderboard table, chart, or screenshot here.
Current top models show 87x inference speedup.

+
+
+
+
+
+ + +
+
+
+

+ Looks like your AI
could use some Moxie. +

+
+ +
+ +
+
🔄
+

Simultaneous Training + Inference

+

Allows training data center GPU resources to simultaneously perform inference.

+
+ + +
+
🏭
+

Massive Offload

+

Massively offloads inference data centers, freeing expensive GPU clusters for training workloads.

+
+ + +
+
📱
+

Native Consumer Inference

+

Enables native LLM inference on consumer devices without any API calls or cloud dependency.

+
+
+
+
+ + +
+
+
+
+

+ Licensing now available through customized enterprise contracts. +

+
+ +
+
+
+ + +
+
+
+
+

Ready for 10-100× more Moxie?

+

Let's talk about how our algorithms can transform your LLM infrastructure.

+ +
+

Email us at:

+ info@moxiegen.com +
+
+

Call us at:

+ +1 (855) 246-6943 +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ + +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..a414da5 --- /dev/null +++ b/index.html @@ -0,0 +1,591 @@ + + + + + + + Moxiegen • Our Algos, Your AI Advantage + + + + + + + + +
+
+
+ + +
+
+
+ NOW IN ENTERPRISE BETA +
+ +

+ Our Algos,
your AI Advantage. +

+ +

+ Moxiegen offers algorithmic enhancement of enterprise LLM and AI models, + increasing efficiency of both inference and training by 10-100x. +

+ +
+ + + + Moxie Demo + +
+
+ + + +
+
+
+ + +
+
+
+
+

Moxie Demo.

+

Real-time performance leaderboard

+
+ + +
+
+
+ 🏆 + LIVE LEADERBOARD +
+
Updated 11 seconds ago
+
+ +
+

[Leaderboard Placement]

+

Insert your Moxie Go leaderboard table, chart, or screenshot here.
Current top models show 87x inference speedup.

+
+
+
+
+
+ + +
+
+
+

+ Looks like your AI
could use some Moxie. +

+
+ +
+ +
+
🔄
+

Simultaneous Training + Inference

+

Allows training data center GPU resources to simultaneously perform inference.

+
+ + +
+
🏭
+

Massive Offload

+

Massively offloads inference data centers, freeing expensive GPU clusters for training workloads.

+
+ + +
+
📱
+

Native Consumer Inference

+

Enables native LLM inference on consumer devices without any API calls or cloud dependency.

+
+
+
+
+ + +
+
+
+
+

+ Licensing now available through customized enterprise contracts. +

+
+ +
+
+
+ + +
+
+
+
+

Ready for 10-100× more Moxie?

+

Let's talk about how our algorithms can transform your LLM infrastructure.

+ +
+

Email us at:

+ info@moxiegen.com +
+
+

Call us at:

+ +1 (855) 246-6943 +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ + +
+ + + +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/js/api.js b/js/api.js new file mode 100644 index 0000000..5f2273e --- /dev/null +++ b/js/api.js @@ -0,0 +1,177 @@ +/** + * Moxiegen API Client + * Handles all API calls to the backend with authentication + */ + +class MoxieAPI { + constructor() { + this.baseUrl = CONFIG.api.baseUrl; + } + + /** + * Make authenticated API request + */ + async request(endpoint, options = {}) { + const token = await moxieAuth.getToken(); + + const headers = { + 'Content-Type': 'application/json', + ...options.headers + }; + + if (token) { + headers['Authorization'] = `Bearer ${token}`; + } + + const url = endpoint.startsWith('http') ? endpoint : this.baseUrl + endpoint; + + try { + const response = await fetch(url, { + ...options, + headers + }); + + const data = await response.json(); + + if (!response.ok) { + throw new APIError(data.message || 'Request failed', response.status, data); + } + + return data; + + } catch (error) { + if (error instanceof APIError) { + throw error; + } + throw new APIError(error.message, 0, { error: error.message }); + } + } + + /** + * GET request + */ + async get(endpoint) { + return this.request(endpoint, { method: 'GET' }); + } + + /** + * POST request + */ + async post(endpoint, data) { + return this.request(endpoint, { + method: 'POST', + body: JSON.stringify(data) + }); + } + + /** + * PUT request + */ + async put(endpoint, data) { + return this.request(endpoint, { + method: 'PUT', + body: JSON.stringify(data) + }); + } + + /** + * DELETE request + */ + async delete(endpoint, data) { + return this.request(endpoint, { + method: 'DELETE', + body: data ? JSON.stringify(data) : undefined + }); + } + + // ============================================ + // User Endpoints + // ============================================ + + /** + * Get current user profile + */ + async getProfile() { + return this.get(CONFIG.api.endpoints.me); + } + + /** + * Update user profile + */ + async updateProfile(data) { + return this.put(CONFIG.api.endpoints.me, data); + } + + /** + * Deactivate account + */ + async deactivateAccount() { + return this.delete(CONFIG.api.endpoints.me); + } + + // ============================================ + // Credits Endpoints + // ============================================ + + /** + * Get credits balance and history + */ + async getCredits(page = 1, limit = 10) { + return this.get(`${CONFIG.api.endpoints.credits}?page=${page}&limit=${limit}`); + } + + // ============================================ + // API Keys Endpoints + // ============================================ + + /** + * Get all API keys + */ + async getApiKeys() { + return this.get(CONFIG.api.endpoints.apiKeys); + } + + /** + * Create new API key + */ + async createApiKey(name = 'API Key') { + return this.post(CONFIG.api.endpoints.apiKeys, { name }); + } + + /** + * Revoke API key + */ + async revokeApiKey(keyId) { + return this.delete(`${CONFIG.api.endpoints.apiKeys}/${keyId}`); + } + + // ============================================ + // Health Check + // ============================================ + + /** + * Check API health + */ + async checkHealth() { + return this.get(CONFIG.api.endpoints.health); + } +} + +/** + * Custom API Error class + */ +class APIError extends Error { + constructor(message, status, data) { + super(message); + this.name = 'APIError'; + this.status = status; + this.data = data; + } +} + +// Create singleton instance +const moxieAPI = new MoxieAPI(); + +// Export for use in other modules +window.moxieAPI = moxieAPI; +window.APIError = APIError; diff --git a/js/auth.js b/js/auth.js new file mode 100644 index 0000000..26a3ce7 --- /dev/null +++ b/js/auth.js @@ -0,0 +1,261 @@ +/** + * Moxiegen Authentication Module + * Handles Auth0 authentication with backend token exchange + */ + +class MoxieAuth { + constructor() { + this.isAuthenticated = false; + this.user = null; + this.token = null; + this.expiresAt = null; + this.isInitialized = false; + } + + /** + * Initialize - check for existing session or handle callback + */ + async init() { + if (this.isInitialized) return; + + try { + // Check for tokens in URL (coming back from token exchange) + const urlParams = new URLSearchParams(window.location.search); + const accessToken = urlParams.get('access_token'); + const idToken = urlParams.get('id_token'); + const expiresIn = urlParams.get('expires_in'); + const code = urlParams.get('code'); + const error = urlParams.get('error'); + + if (error) { + console.error('Auth error:', error, urlParams.get('error_description')); + this.clearTokens(); + window.history.replaceState({}, document.title, window.location.pathname); + throw new Error(urlParams.get('error_description') || error); + } + + // If we have a code but no token, exchange it via backend + if (code && !accessToken) { + console.log('Exchanging authorization code for tokens...'); + await this.exchangeCode(code); + return; + } + + if (accessToken) { + // Store tokens from URL + this.token = accessToken; + this.expiresAt = Date.now() + (parseInt(expiresIn) || 3600) * 1000; + + if (idToken) { + this.user = this.decodeJwt(idToken); + localStorage.setItem('id_token', idToken); + } + + localStorage.setItem('access_token', accessToken); + localStorage.setItem('expires_at', this.expiresAt.toString()); + + // Clean up URL + window.history.replaceState({}, document.title, window.location.pathname); + + this.isAuthenticated = true; + this.isInitialized = true; + return; + } + + // Check for stored tokens + const storedToken = localStorage.getItem('access_token'); + const storedExpiresAt = localStorage.getItem('expires_at'); + const storedIdToken = localStorage.getItem('id_token'); + + if (storedToken && storedExpiresAt) { + if (Date.now() < parseInt(storedExpiresAt)) { + this.token = storedToken; + this.expiresAt = parseInt(storedExpiresAt); + if (storedIdToken) { + this.user = this.decodeJwt(storedIdToken); + } + this.isAuthenticated = true; + } else { + // Token expired - clear it + this.clearTokens(); + } + } + + this.isInitialized = true; + console.log('Auth initialized. Authenticated:', this.isAuthenticated); + + } catch (error) { + console.error('Failed to initialize auth:', error); + this.isInitialized = true; + throw error; + } + } + + /** + * Exchange authorization code for tokens via backend + */ + async exchangeCode(code) { + try { + const response = await fetch('/api/auth/token', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + code, + redirect_uri: window.location.origin + '/dashboard.html' + }) + }); + + const data = await response.json(); + + if (!data.success) { + throw new Error(data.message || 'Token exchange failed'); + } + + const { access_token, id_token, expires_in } = data.data; + + // Store tokens + this.token = access_token; + this.expiresAt = Date.now() + (expires_in || 3600) * 1000; + + if (id_token) { + this.user = this.decodeJwt(id_token); + localStorage.setItem('id_token', id_token); + } + + localStorage.setItem('access_token', access_token); + localStorage.setItem('expires_at', this.expiresAt.toString()); + + // Clean up URL + window.history.replaceState({}, document.title, window.location.pathname); + + this.isAuthenticated = true; + this.isInitialized = true; + + console.log('Token exchange successful'); + + } catch (error) { + console.error('Token exchange error:', error); + // Redirect to login on failure + this.clearTokens(); + window.history.replaceState({}, document.title, window.location.pathname); + throw error; + } + } + + /** + * Decode JWT (just the payload, no verification) + */ + decodeJwt(token) { + try { + const base64Url = token.split('.')[1]; + const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); + const jsonPayload = decodeURIComponent(atob(base64).split('').map(c => { + return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); + }).join('')); + return JSON.parse(jsonPayload); + } catch (e) { + console.error('Failed to decode JWT:', e); + return null; + } + } + + /** + * Login - redirect to Auth0 + */ + async login(returnTo = null) { + const redirectUri = returnTo || window.location.origin + '/dashboard.html'; + + // Build Auth0 authorize URL + let authUrl = `https://${CONFIG.auth0.domain}/authorize?` + + `response_type=code&` + + `client_id=${CONFIG.auth0.clientId}&` + + `redirect_uri=${encodeURIComponent(redirectUri)}&` + + `scope=openid%20profile%20email`; + + // Only add audience if it's defined and not empty + if (CONFIG.auth0.audience && CONFIG.auth0.audience.trim() !== '') { + authUrl += `&audience=${encodeURIComponent(CONFIG.auth0.audience)}`; + } + + window.location.href = authUrl; + } + + /** + * Logout + */ + async logout() { + this.clearTokens(); + + const returnTo = encodeURIComponent(window.location.origin); + const logoutUrl = `https://${CONFIG.auth0.domain}/v2/logout?client_id=${CONFIG.auth0.clientId}&returnTo=${returnTo}`; + + window.location.href = logoutUrl; + } + + /** + * Clear stored tokens + */ + clearTokens() { + localStorage.removeItem('access_token'); + localStorage.removeItem('id_token'); + localStorage.removeItem('expires_at'); + this.token = null; + this.user = null; + this.isAuthenticated = false; + this.expiresAt = null; + } + + /** + * Get access token + */ + async getToken() { + if (!this.isInitialized) { + await this.init(); + } + + // Check if token is expired + if (this.expiresAt && Date.now() >= this.expiresAt) { + this.clearTokens(); + return null; + } + + return this.token; + } + + /** + * Get current user + */ + async getUser() { + if (!this.isInitialized) { + await this.init(); + } + return this.user; + } + + /** + * Check if user is authenticated + */ + async checkAuth() { + if (!this.isInitialized) { + await this.init(); + } + return this.isAuthenticated; + } + + /** + * Check if user has specific role + */ + hasRole(role) { + if (!this.user) return false; + const roles = this.user['https://moxiegen.client.guacamolebox.net/roles'] || + this.user.roles || + []; + return Array.isArray(roles) && roles.includes(role); + } +} + +// Create singleton instance +const moxieAuth = new MoxieAuth(); + +// Export for use in other modules +window.moxieAuth = moxieAuth; diff --git a/js/config.js b/js/config.js new file mode 100644 index 0000000..578e19b --- /dev/null +++ b/js/config.js @@ -0,0 +1,40 @@ +/** + * Moxiegen Frontend Configuration + * Update these values to match your Auth0 and API settings + */ + +const CONFIG = { + // Auth0 Configuration + auth0: { + domain: 'dev-t13zhs74oltgqtfx.us.auth0.com', + clientId: 'AWRYU8EBnKaHvRQOMXXADxgGEoBN45oN', + // Leave audience empty for standard OpenID Connect authentication + // Or set to your custom API identifier if you created one in Auth0 + audience: '', + redirectUri: window.location.origin + '/dashboard.html', + logoutUri: window.location.origin + }, + + // API Configuration + api: { + baseUrl: '/api', // Proxied through Caddy + endpoints: { + me: '/users/me', + credits: '/users/credits', + apiKeys: '/users/api-keys', + health: '/health' + } + }, + + // App Configuration + app: { + name: 'Moxiegen', + version: '2.0.0' + } +}; + +// Freeze config to prevent modifications +Object.freeze(CONFIG); +Object.freeze(CONFIG.auth0); +Object.freeze(CONFIG.api); +Object.freeze(CONFIG.app); diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..f35da4c Binary files /dev/null and b/logo.png differ diff --git a/logo.svg b/logo.svg new file mode 100644 index 0000000..4178033 --- /dev/null +++ b/logo.svg @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/test.md b/test.md new file mode 100644 index 0000000..c0ae62c --- /dev/null +++ b/test.md @@ -0,0 +1 @@ +#test \ No newline at end of file