From 313b7d25188a1ed694f3c4885cfd754bc172d384 Mon Sep 17 00:00:00 2001 From: MrPiglr Date: Mon, 19 Jan 2026 05:06:41 +0000 Subject: [PATCH] modified: astro-site/src/components/mockup/ChatArea.jsx --- PROGRESS-README.md | 50 +++ astro-site/package-lock.json | 194 +++++++++ astro-site/package.json | 3 +- .../src/components/auth/AccountLinker.jsx | 163 ++++++-- .../src/components/auth/LoginIsland.jsx | 11 + .../src/components/matrix/MatrixProvider.jsx | 2 +- astro-site/src/components/mockup/ChatArea.jsx | 21 +- .../src/components/mockup/DemoLoginButton.jsx | 13 + .../src/components/mockup/MainLayout.jsx | 5 + .../src/components/webrtc/WebRTCProvider.jsx | 9 +- astro-site/src/pages/_mockup.jsx | 7 + astro-site/src/pages/index.astro | 389 ++++++++---------- astro-site/src/pages/landing.astro | 1 + astro-site/src/pages/login.astro | 9 + 14 files changed, 608 insertions(+), 269 deletions(-) create mode 100644 PROGRESS-README.md create mode 100644 astro-site/src/components/auth/LoginIsland.jsx create mode 100644 astro-site/src/components/mockup/DemoLoginButton.jsx create mode 100644 astro-site/src/pages/_mockup.jsx create mode 100644 astro-site/src/pages/landing.astro create mode 100644 astro-site/src/pages/login.astro diff --git a/PROGRESS-README.md b/PROGRESS-README.md new file mode 100644 index 0000000..98ea922 --- /dev/null +++ b/PROGRESS-README.md @@ -0,0 +1,50 @@ +# AeThex Connect – Progress & Next Steps + +## Current Progress + +### 1. UI & Frontend +- Modern, branded landing and login pages (Astro + React + Tailwind) +- Glassy, Discord-style chat/voice UI with channel, member, and chat areas +- Demo login and account linking UI (AeThex + Matrix, now being phased out) +- WebRTC integration for voice (UI and hooks scaffolded) + +### 2. Matrix Integration (Deprecated) +- MatrixProvider and context for chat/voice (now being removed due to auth/friction) +- Demo login attempted with Matrix test accounts (blocked by Matrix.org restrictions) +- Error handling and feedback for Matrix login failures + +### 3. Architecture Decisions +- Decided to move away from Matrix for chat/auth due to complexity and lack of control +- Plan to use AeThex-native authentication and backend for chat/voice +- WebRTC will be used for voice, with custom signaling + +## Next Steps + +### 1. Backend +- Scaffold a Node.js (or similar) backend for: + - AeThex account authentication (JWT/session) + - Real-time chat (Socket.io or websockets) + - WebRTC signaling for voice +- Add basic chat channels, DMs, and presence + +### 2. Frontend +- Remove Matrix login and context from UI +- Connect chat/voice UI to new backend (Socket.io/websockets for chat, WebRTC for voice) +- Use AeThex login for all authentication +- Add error handling, loading states, and user feedback + +### 3. Features & Polish +- Add moderation tools, premium features, and integrations as needed +- Polish UI/UX for onboarding, chat, and voice +- Prepare for MVP launch and user testing + +--- + +**Summary:** +- UI and core experience are in place +- Matrix is being replaced with a custom AeThex-native backend +- Next: Build backend, connect frontend, and iterate on features + +--- + +*This README reflects the current state and roadmap for AeThex Connect as of January 2026.* diff --git a/astro-site/package-lock.json b/astro-site/package-lock.json index 22cfb64..6ad585f 100644 --- a/astro-site/package-lock.json +++ b/astro-site/package-lock.json @@ -12,6 +12,7 @@ "@types/react": "^19.2.8", "@types/react-dom": "^19.2.3", "astro": "^4.0.0", + "matrix-js-sdk": "^40.0.0", "mumble-client": "^1.3.0", "react": "^19.2.3", "react-dom": "^19.2.3", @@ -905,6 +906,15 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/runtime": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz", + "integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/template": { "version": "7.27.2", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", @@ -1782,6 +1792,15 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@matrix-org/matrix-sdk-crypto-wasm": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-16.0.0.tgz", + "integrity": "sha512-c+0eu/ckG+ik62CaOFvHAulJlspw2CBKcLrWbiEQsXv4J3PC4xaaDI5VHFAl7FDU+U9Ww2DDNTieszCh4Lk0/Q==", + "license": "Apache-2.0", + "engines": { + "node": ">= 18" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -2313,6 +2332,12 @@ "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "license": "MIT" }, + "node_modules/@types/events": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.3.tgz", + "integrity": "sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==", + "license": "MIT" + }, "node_modules/@types/hast": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", @@ -2410,6 +2435,12 @@ "node": ">=0.4.0" } }, + "node_modules/another-json": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/another-json/-/another-json-0.2.0.tgz", + "integrity": "sha512-/Ndrl68UQLhnCdsAzEXLMFuOR546o2qbYRqCglaNHbjXrwG1ayTcdwr3zkSGOGtGXDyR5X9nCFfnyG2AFJIsqg==", + "license": "Apache-2.0" + }, "node_modules/ansi-align": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", @@ -2716,6 +2747,12 @@ "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==", "license": "MIT" }, + "node_modules/base-x": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.1.tgz", + "integrity": "sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==", + "license": "MIT" + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -2836,6 +2873,15 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/bs58": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz", + "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==", + "license": "MIT", + "dependencies": { + "base-x": "^5.0.0" + } + }, "node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", @@ -3220,6 +3266,15 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "license": "MIT" }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -3520,6 +3575,15 @@ "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", "license": "MIT" }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -4177,6 +4241,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-network-error": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-network-error/-/is-network-error-1.3.0.tgz", + "integrity": "sha512-6oIwpsgRfnDiyEDLMay/GqCl3HoAtH5+RUKW29gYkL0QA+ipzpDLA16yQs7/RHCSu+BwgbJaOUqa4A99qNVQVw==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -4290,6 +4366,15 @@ "node": ">=6" } }, + "node_modules/jwt-decode": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", + "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -4426,6 +4511,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/loglevel": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", + "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, "node_modules/long": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", @@ -4484,6 +4582,47 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/matrix-events-sdk": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/matrix-events-sdk/-/matrix-events-sdk-0.0.1.tgz", + "integrity": "sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA==", + "license": "Apache-2.0" + }, + "node_modules/matrix-js-sdk": { + "version": "40.0.0", + "resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-40.0.0.tgz", + "integrity": "sha512-KQzMJQ7ZzQlgCIYgUOOVT0+dhlyKZS6bq0Gdf1WCt/tIGc4m56aD2h+EqZKv9aNZ3AtPbPUMDMEpHDva0ggYQg==", + "license": "Apache-2.0", + "dependencies": { + "@babel/runtime": "^7.12.5", + "@matrix-org/matrix-sdk-crypto-wasm": "^16.0.0", + "another-json": "^0.2.0", + "bs58": "^6.0.0", + "content-type": "^1.0.4", + "jwt-decode": "^4.0.0", + "loglevel": "^1.9.2", + "matrix-events-sdk": "0.0.1", + "matrix-widget-api": "^1.14.0", + "oidc-client-ts": "^3.0.1", + "p-retry": "7", + "sdp-transform": "^3.0.0", + "unhomoglyph": "^1.0.6", + "uuid": "13" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/matrix-widget-api": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/matrix-widget-api/-/matrix-widget-api-1.16.0.tgz", + "integrity": "sha512-OCsCzEN54jWamvWkBa7PqcKdlOhLA+nJbUyqsATHvzb4/NMcjdUZWSDurZxyNE5eYlNwxClA6Hw20mzJEKJbvg==", + "license": "Apache-2.0", + "dependencies": { + "@types/events": "^3.0.0", + "events": "^3.2.0" + } + }, "node_modules/mdast-util-definitions": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz", @@ -5467,6 +5606,18 @@ "node": ">= 6" } }, + "node_modules/oidc-client-ts": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/oidc-client-ts/-/oidc-client-ts-3.4.1.tgz", + "integrity": "sha512-jNdst/U28Iasukx/L5MP6b274Vr7ftQs6qAhPBCvz6Wt5rPCA+Q/tUmCzfCHHWweWw5szeMy2Gfrm1rITwUKrw==", + "license": "Apache-2.0", + "dependencies": { + "jwt-decode": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -5601,6 +5752,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-retry": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-7.1.1.tgz", + "integrity": "sha512-J5ApzjyRkkf601HpEeykoiCvzHQjWxPAHhyjFcEUP2SWq0+35NKh8TLhpLw+Dkq5TZBFvUM6UigdE9hIVYTl5w==", + "license": "MIT", + "dependencies": { + "is-network-error": "^1.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-timeout": { "version": "6.1.4", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.4.tgz", @@ -6467,6 +6633,15 @@ "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", "license": "MIT" }, + "node_modules/sdp-transform": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-3.0.0.tgz", + "integrity": "sha512-gfYVRGxjHkGF2NPeUWHw5u6T/KGFtS5/drPms73gaSuMaVHKCY3lpLnGDfswVQO0kddeePoti09AwhYP4zA8dQ==", + "license": "MIT", + "bin": { + "sdp-verify": "checker.js" + } + }, "node_modules/section-matter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", @@ -7047,6 +7222,12 @@ "integrity": "sha512-R9fBn90VTJrqqLDwyMph+HGne8eqY1iPfYhPzZrvKpIfwkWZbcYlfpsb8B9dTvBfpy1/hqAD7Wi8EKfP9e8zdw==", "license": "MIT" }, + "node_modules/unhomoglyph": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unhomoglyph/-/unhomoglyph-1.0.6.tgz", + "integrity": "sha512-7uvcWI3hWshSADBu4JpnyYbTVc7YlhF5GDW/oPD5AxIxl34k4wXR3WDkPnzLxkN32LiTCTKMQLtKVZiwki3zGg==", + "license": "MIT" + }, "node_modules/unified": { "version": "11.0.5", "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", @@ -7225,6 +7406,19 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, + "node_modules/uuid": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.0.tgz", + "integrity": "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist-node/bin/uuid" + } + }, "node_modules/vfile": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", diff --git a/astro-site/package.json b/astro-site/package.json index 0ed5059..6e9e626 100644 --- a/astro-site/package.json +++ b/astro-site/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "scripts": { - "dev": "astro dev", + "dev": "astro dev --port 4321", "build": "astro build", "preview": "astro preview" }, @@ -12,6 +12,7 @@ "@types/react": "^19.2.8", "@types/react-dom": "^19.2.3", "astro": "^4.0.0", + "matrix-js-sdk": "^40.0.0", "mumble-client": "^1.3.0", "react": "^19.2.3", "react-dom": "^19.2.3", diff --git a/astro-site/src/components/auth/AccountLinker.jsx b/astro-site/src/components/auth/AccountLinker.jsx index 5adb5e1..282466c 100644 --- a/astro-site/src/components/auth/AccountLinker.jsx +++ b/astro-site/src/components/auth/AccountLinker.jsx @@ -1,4 +1,8 @@ + + import React, { useState } from "react"; +import { useMatrix } from "../matrix/MatrixProvider.jsx"; + /** * UI for linking AeThex and Matrix accounts. @@ -7,6 +11,38 @@ import React, { useState } from "react"; * 3. Store mapping in localStorage (or call backend in real app) */ export default function AccountLinker({ onLinked }) { + const matrixCtx = useMatrix(); + if (!matrixCtx) { + return ( +
+
+
+ + + + +
+
+ Hang tight!
+ We’re prepping your login experience… +
+
+ +
+ ); + } + const { login } = matrixCtx; const [aethexUser, setAethexUser] = useState(""); const [aethexPass, setAethexPass] = useState(""); const [matrixUser, setMatrixUser] = useState(""); @@ -38,50 +74,91 @@ export default function AccountLinker({ onLinked }) { } }; + // Demo login handler + const handleDemoLogin = async () => { + setAethexUser('demo'); + setAethexPass('demo123'); + setStep(2); + setTimeout(async () => { + setMatrixUser('@mrpiglr:matrix.org'); + setMatrixPass('Max!FTW2023!'); + setTimeout(async () => { + localStorage.setItem("aethex-matrix-link", JSON.stringify({ aethexUser: 'demo', matrixUser: '@mrpiglr:matrix.org' })); + setError(null); + if (login) { + try { + await login('@mrpiglr:matrix.org', 'Max!FTW2023!'); + } catch (e) { + setError(e.message || 'Login failed.'); + return; + } + } + if (onLinked) onLinked({ aethexUser: 'demo', matrixUser: '@mrpiglr:matrix.org', matrixPass: 'Max!FTW2023!' }); + // window.location.href = '/'; + }, 500); + }, 500); + }; + return ( -
-

Link AeThex & Matrix Accounts

- {error &&
{error}
} - {step === 1 && ( -
- setAethexUser(e.target.value)} - autoFocus - /> - setAethexPass(e.target.value)} - /> - -
- )} - {step === 2 && ( -
- setMatrixUser(e.target.value)} - autoFocus - /> - setMatrixPass(e.target.value)} - /> - -
- )} +
+
+ AeThex Logo +

AeThex Connect

+

Sign in to your account

+ + {error &&
{error}
} + {/* Show MatrixProvider error if present */} + {matrixCtx && matrixCtx.error && ( +
Matrix error: {matrixCtx.error}
+ )} + {step === 1 && ( +
+ setAethexUser(e.target.value)} + autoFocus + /> + setAethexPass(e.target.value)} + /> + +
+ )} + {step === 2 && ( +
+ setMatrixUser(e.target.value)} + autoFocus + /> + setMatrixPass(e.target.value)} + /> + +
+ )} +
+ By continuing, you agree to the Terms of Service and Privacy Policy. +
+
+
); } diff --git a/astro-site/src/components/auth/LoginIsland.jsx b/astro-site/src/components/auth/LoginIsland.jsx new file mode 100644 index 0000000..189de02 --- /dev/null +++ b/astro-site/src/components/auth/LoginIsland.jsx @@ -0,0 +1,11 @@ +import React from "react"; +import { MatrixProvider } from "../matrix/MatrixProvider.jsx"; +import AccountLinker from "./AccountLinker.jsx"; + +export default function LoginIsland() { + return ( + + {}} /> + + ); +} diff --git a/astro-site/src/components/matrix/MatrixProvider.jsx b/astro-site/src/components/matrix/MatrixProvider.jsx index c425108..05280dd 100644 --- a/astro-site/src/components/matrix/MatrixProvider.jsx +++ b/astro-site/src/components/matrix/MatrixProvider.jsx @@ -1,5 +1,5 @@ import React, { createContext, useContext, useEffect, useState, useCallback } from "react"; -import sdk from "matrix-js-sdk"; +import * as sdk from "matrix-js-sdk"; const MatrixContext = createContext(null); diff --git a/astro-site/src/components/mockup/ChatArea.jsx b/astro-site/src/components/mockup/ChatArea.jsx index fb561f0..fed4d27 100644 --- a/astro-site/src/components/mockup/ChatArea.jsx +++ b/astro-site/src/components/mockup/ChatArea.jsx @@ -2,12 +2,13 @@ import React, { useEffect } from "react"; import Message from "./Message"; import MessageInput from "./MessageInput"; import { useMatrix } from "../matrix/MatrixProvider.jsx"; +import DemoLoginButton from "./DemoLoginButton.jsx"; // Default room to join (replace with your Matrix room ID) const DEFAULT_ROOM_ID = "!foundation:matrix.org"; export default function ChatArea() { - const { messages, joinRoom, currentRoomId, user } = useMatrix(); + const { messages, joinRoom, currentRoomId, user, login, loading } = useMatrix(); // Join the default room on login useEffect(() => { @@ -16,6 +17,22 @@ export default function ChatArea() { } }, [user, currentRoomId, joinRoom]); + // Demo login handler + const handleDemoLogin = () => { + // Use a public Matrix test account or a known demo account + // You can change these credentials as needed + login("@mrpiglr:matrix.org", "Max!FTW2023!", "https://matrix.org"); + }; + + if (!user) { + return ( +
+ + {loading &&
Logging in as demo user...
} +
+ ); + } + return (
{/* Chat Header */} @@ -43,9 +60,11 @@ export default function ChatArea() {
+ ); } + // Helper to convert Matrix event to Message props function matrixToMessageProps(event) { if (!event) return {}; diff --git a/astro-site/src/components/mockup/DemoLoginButton.jsx b/astro-site/src/components/mockup/DemoLoginButton.jsx new file mode 100644 index 0000000..dd9fb8e --- /dev/null +++ b/astro-site/src/components/mockup/DemoLoginButton.jsx @@ -0,0 +1,13 @@ +import React from "react"; + +export default function DemoLoginButton({ onDemoLogin }) { + return ( + + ); +} diff --git a/astro-site/src/components/mockup/MainLayout.jsx b/astro-site/src/components/mockup/MainLayout.jsx index 34a7d5f..c94864d 100644 --- a/astro-site/src/components/mockup/MainLayout.jsx +++ b/astro-site/src/components/mockup/MainLayout.jsx @@ -1,4 +1,9 @@ + import { WebRTCProvider } from "../webrtc/WebRTCProvider.jsx"; +import ServerList from "./ServerList.jsx"; +import ChannelSidebar from "./ChannelSidebar.jsx"; +import ChatArea from "./ChatArea.jsx"; +import MemberSidebar from "./MemberSidebar.jsx"; export default function MainLayout() { return ( diff --git a/astro-site/src/components/webrtc/WebRTCProvider.jsx b/astro-site/src/components/webrtc/WebRTCProvider.jsx index 499f473..e60d6a8 100644 --- a/astro-site/src/components/webrtc/WebRTCProvider.jsx +++ b/astro-site/src/components/webrtc/WebRTCProvider.jsx @@ -1,3 +1,4 @@ + import React, { createContext, useContext, useRef, useState, useEffect, useCallback } from "react"; import Peer from "simple-peer"; import { useMatrix } from "../matrix/MatrixProvider.jsx"; @@ -8,11 +9,17 @@ export function useWebRTC() { return useContext(WebRTCContext); } +export function WebRTCProvider({ children }) { const [peers, setPeers] = useState([]); // [{ peerId, peer, stream }] const [localStream, setLocalStream] = useState(null); const [joined, setJoined] = useState(false); const peersRef = useRef({}); - const { client, user, currentRoomId } = useMatrix(); + const matrix = useMatrix(); + if (!matrix) { + // Optionally render a fallback or nothing if Matrix context is not available + return null; + } + const { client, user, currentRoomId } = matrix; const SIGNAL_EVENT = "org.aethex.voice.signal"; const VOICE_ROOM = currentRoomId || "!foundation:matrix.org"; diff --git a/astro-site/src/pages/_mockup.jsx b/astro-site/src/pages/_mockup.jsx new file mode 100644 index 0000000..d96cc66 --- /dev/null +++ b/astro-site/src/pages/_mockup.jsx @@ -0,0 +1,7 @@ +import React from "react"; +import MainLayout from "../components/mockup/MainLayout"; +import "../components/mockup/global.css"; + +export default function MockupPage() { + return ; +} \ No newline at end of file diff --git a/astro-site/src/pages/index.astro b/astro-site/src/pages/index.astro index babab58..c058222 100644 --- a/astro-site/src/pages/index.astro +++ b/astro-site/src/pages/index.astro @@ -1,231 +1,176 @@ --- import Layout from '../layouts/Layout.astro'; -import MainLayout from '../components/mockup/MainLayout.jsx'; -import AccountLinker from '../components/auth/AccountLinker.jsx'; -import { useState } from 'react'; -import { MatrixProvider } from '../components/matrix/MatrixProvider.jsx'; --- - - { - // Optionally, auto-login to Matrix here - // This is a placeholder; actual login logic should be in a React component - }} /> - - - - - -
-

Company

- -
-
-

Support

- -
- - - + +
+
+ +

AeThex Connect

+

Next-generation voice & chat for gamers.
Own your identity. Connect everywhere.

+ Get Started +
+
+
+
+
+ 🔒 +

Private & Secure

+

End-to-end encrypted chat and voice. Your data, your rules.

- - +
+ 🌐 +

Cross-Platform

+

Works on web, desktop, and mobile. Seamless everywhere.

+
+
+ 🎮 +

For Gamers

+

Channels, roles, and integrations built for gaming communities.

+
+
+
+
+ + +
diff --git a/astro-site/src/pages/landing.astro b/astro-site/src/pages/landing.astro new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/astro-site/src/pages/landing.astro @@ -0,0 +1 @@ + diff --git a/astro-site/src/pages/login.astro b/astro-site/src/pages/login.astro new file mode 100644 index 0000000..81bd75c --- /dev/null +++ b/astro-site/src/pages/login.astro @@ -0,0 +1,9 @@ +--- +import Layout from '../layouts/Layout.astro'; +import LoginIsland from '../components/auth/LoginIsland.jsx'; +--- + + + + +