mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-17 22:07:20 +00:00
- ModuleManager: Central tracking for installed marketplace modules - DataAnalyzerWidget: Real-time CPU/RAM/Battery/Storage widget (unlocked by Data Analyzer module) - BottomNavBar: Navigation bar for Projects/Chat/Marketplace/Settings - RootShell: Real root command execution utility - TerminalActivity: Full root shell with neofetch, sysinfo, real Linux commands - Terminal Pro module: Adds aliases (ll, la, h), command history - ArcadeActivity + SnakeGame: Pixel Arcade module unlocks retro games - fade_in/fade_out animations for smooth transitions
5.1 KiB
5.1 KiB
PHASE 5: NEXUS INTEGRATION - Quick Start Guide
Get AeThex Connect working with Nexus Engine in 5 minutes.
Prerequisites
- Node.js 18+
- PostgreSQL database
- AeThex Passport account
- Nexus API key
Step 1: Database Migration
Run the Nexus integration migration:
cd /workspaces/AeThex-Connect
npm run migrate
Or manually:
psql -d aethex_connect -f src/backend/database/migrations/005_nexus_cross_platform.sql
Step 2: Environment Setup
Add to .env:
NEXUS_API_KEY=your-nexus-api-key-here
NEXUS_ENGINE_URL=https://nexus.aethex.cloud
Step 3: Start Server
npm start
Server will run on http://localhost:5000
Step 4: Integrate SDK in Your Game
Install Plugin
npm install @aethex/connect-nexus-plugin
Or use CDN:
<script src="https://cdn.aethex.app/nexus-sdk/connect-plugin.js"></script>
Initialize in Game
import AeThexConnectPlugin from '@aethex/connect-nexus-plugin';
// Initialize Nexus Engine
const nexus = new NexusEngine({
gameId: 'your-game-id',
gameName: 'Your Game Name'
});
// Initialize Connect Plugin
const connect = new AeThexConnectPlugin(nexus, {
apiUrl: 'http://localhost:5000/api', // Dev server
apiKey: process.env.NEXUS_API_KEY,
enableOverlay: true,
overlayPosition: 'top-right'
});
// Start when game loads
await connect.initialize();
Emit Game Events
// When match starts
nexus.emit('match:start', {
map: 'Forest Arena',
mode: 'Team Deathmatch',
teamId: 'team-red'
});
// When match ends
nexus.emit('match:end', {
score: 150,
won: true,
duration: 1234
});
// When game exits
nexus.emit('game:exit');
Step 5: Test
Test Session Start
curl -X POST http://localhost:5000/api/nexus/sessions/start \
-H "X-Nexus-API-Key: your-key" \
-H "X-Nexus-Player-ID: test-player-1" \
-H "Content-Type: application/json" \
-d '{
"nexusPlayerId": "test-player-1",
"gameId": "test-game",
"gameName": "Test Game",
"metadata": {
"platform": "PC"
}
}'
Expected response:
{
"success": true,
"session": {
"id": "session-uuid",
"game_id": "test-game",
"started_at": "2026-01-10T12:00:00Z"
},
"overlayConfig": {
"enabled": true,
"position": "top-right",
"opacity": 0.9,
"notifications": true,
"autoMute": true
}
}
Test Friends
First, create test users and send friend request:
# Send friend request
curl -X POST http://localhost:5000/api/friends/request \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"targetIdentifier": "friend@nexus.aethex.cloud"
}'
# Get friends list
curl http://localhost:5000/api/friends \
-H "Authorization: Bearer YOUR_TOKEN"
Step 6: View Overlay
Open in browser:
http://localhost:5173/overlay?session=test-session
You should see:
- Friends list
- Minimize button
- Message notifications (when triggered)
Troubleshooting
Overlay Not Appearing
Check:
enableOverlay: truein config- Browser console for errors
- CORS settings allow your game domain
Session Start Fails
Check:
NEXUS_API_KEYis set in.env- Database migration ran successfully
- API key matches server expectation
Friends Not Loading
Check:
- User is authenticated (has valid token)
- Friend relationships exist in database
- WebSocket connection is established
API Endpoints Reference
Game Sessions
POST /api/nexus/sessions/start- Start sessionPOST /api/nexus/sessions/:id/update- Update statePOST /api/nexus/sessions/:id/end- End session
Friends
GET /api/friends- Get friends listPOST /api/friends/request- Send requestPOST /api/friends/requests/:id/respond- Accept/rejectDELETE /api/friends/:userId- Remove friend
Lobbies
POST /api/nexus/lobbies- Create lobbyPOST /api/nexus/lobbies/:id/join- Join lobbyPOST /api/nexus/lobbies/:id/ready- Toggle readyPOST /api/nexus/lobbies/:id/start- Start game
Example: Full Game Integration
class MyGame {
async init() {
// Setup Nexus
this.nexus = new NexusEngine({
gameId: 'my-awesome-game',
gameName: 'My Awesome Game'
});
// Setup Connect
this.connect = new AeThexConnectPlugin(this.nexus, {
apiKey: process.env.NEXUS_API_KEY,
enableOverlay: true,
autoMute: true
});
await this.connect.initialize();
}
startMatch(matchData) {
this.nexus.emit('match:start', matchData);
}
endMatch(results) {
this.nexus.emit('match:end', results);
// Optional: Show notification
this.connect.showNotification({
icon: '🏆',
title: 'Match Complete',
body: `Score: ${results.score}`
});
}
cleanup() {
this.connect.destroy();
}
}
Next Steps
- Read full documentation:
PHASE5-COMPLETE.md - Explore SDK features:
nexus-sdk/README.md - Join Discord:
#nexus-integration - Report issues: GitHub Issues
Need Help?
- Discord: discord.gg/aethex
- Email: support@aethex.app
- Docs: docs.aethex.app/nexus
You're all set! Your game now has cross-platform communication! 🎮