From bdb4e825834737273352f54a6646150e4dbf3651 Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Sun, 21 Dec 2025 22:08:30 +0000 Subject: [PATCH] Enhance boot sequence and identity detection for the operating system Update the OS boot sequence to include detailed hardware initialization, passport subsystem checks, and integrated identity detection. Adds a new API endpoint for retrieving authenticated user profiles. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 279f1558-c0e3-40e4-8217-be7e9f4c6eca Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: ae92f0ce-ed07-4e47-b7ac-e9684ebbe070 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/b984cb14-1d19-4944-922b-bc79e821ed35/279f1558-c0e3-40e4-8217-be7e9f4c6eca/nHHH2tH Replit-Helium-Checkpoint-Created: true --- client/src/pages/os.tsx | 867 ++++++++++++++++++++++++++++++++++------ server/routes.ts | 15 + 2 files changed, 755 insertions(+), 127 deletions(-) diff --git a/client/src/pages/os.tsx b/client/src/pages/os.tsx index 96c08c8..f8440ba 100644 --- a/client/src/pages/os.tsx +++ b/client/src/pages/os.tsx @@ -252,29 +252,147 @@ export default function AeThexOS() { const [showLoginPrompt, setShowLoginPrompt] = useState(false); const [isDesktopLocked, setIsDesktopLocked] = useState(true); + const [detectedIdentity, setDetectedIdentity] = useState<{ username?: string; passportId?: string } | null>(null); + const [threatLevel, setThreatLevel] = useState<'scanning' | 'low' | 'medium' | 'high'>('scanning'); + const [bootLogs, setBootLogs] = useState([]); useEffect(() => { const bootSequence = async () => { - const steps = [ - { text: 'BIOS CHECK... OK', progress: 5 }, - { text: 'Initializing AeThex OS...', progress: 10 }, - { text: 'Loading kernel modules...', progress: 20 }, - { text: 'Mounting file systems...', progress: 30 }, - { text: 'INITIATING AETHEX PASSPORT...', progress: 40 }, - { text: 'DETECTING CROSS-PLATFORM IDENTITY...', progress: 55 }, - { text: 'Starting Aegis security layer...', progress: 65 }, - { text: 'STATUS: NEUTRAL LAYER ACTIVE.', progress: 75 }, - { text: 'Connecting to Nexus network...', progress: 85 }, - { text: 'IDENTITY SYSTEM READY.', progress: 100 }, + const addLog = (text: string) => setBootLogs(prev => [...prev.slice(-8), text]); + + // Phase 1: Hardware initialization + const phase1 = [ + { text: 'POST: Power-On Self Test...', progress: 3 }, + { text: 'CPU: AMD Ryzen 9 7950X3D @ 4.2GHz... OK', progress: 5 }, + { text: 'RAM: 64GB DDR5-6000 ECC... OK', progress: 8 }, + { text: 'GPU: Quantum Accelerator v2.1... OK', progress: 10 }, + { text: 'NVME: AeThex Vault 2TB... OK', progress: 12 }, ]; - for (const step of steps) { + for (const step of phase1) { setBootStep(step.text); + addLog(step.text); setBootProgress(step.progress); - await new Promise(r => setTimeout(r, 350)); + await new Promise(r => setTimeout(r, 150)); } + // Phase 2: Kernel & filesystem + const phase2 = [ + { text: 'Loading AeThex Kernel v4.2.1...', progress: 18 }, + { text: 'Initializing virtual memory manager...', progress: 22 }, + { text: 'Mounting encrypted file systems...', progress: 26 }, + { text: 'Loading device drivers...', progress: 30 }, + ]; + + for (const step of phase2) { + setBootStep(step.text); + addLog(step.text); + setBootProgress(step.progress); + await new Promise(r => setTimeout(r, 200)); + } + + // Phase 3: Passport Identity Detection + setBootStep('INITIATING AETHEX PASSPORT SUBSYSTEM...'); + addLog('▸ PASSPORT: Initializing identity subsystem...'); + setBootProgress(35); + await new Promise(r => setTimeout(r, 300)); + + // Check for existing session/identity + let foundIdentity = false; + try { + const sessionRes = await fetch('/api/auth/session', { credentials: 'include' }); + const sessionData = await sessionRes.json(); + if (sessionData?.authenticated && sessionData?.user) { + foundIdentity = true; + setDetectedIdentity({ + username: sessionData.user.username, + passportId: sessionData.user.id?.slice(0, 8).toUpperCase() + }); + addLog(`▸ PASSPORT: Identity token detected`); + setBootStep('PASSPORT: IDENTITY TOKEN DETECTED'); + setBootProgress(40); + await new Promise(r => setTimeout(r, 300)); + + addLog(`▸ PASSPORT: Verifying credentials for ${sessionData.user.username}...`); + setBootStep(`Verifying credentials for ${sessionData.user.username}...`); + setBootProgress(45); + await new Promise(r => setTimeout(r, 400)); + + addLog(`▸ PASSPORT: Welcome back, ARCHITECT ${sessionData.user.username.toUpperCase()}`); + setBootStep(`WELCOME BACK, ARCHITECT ${sessionData.user.username.toUpperCase()}`); + setBootProgress(50); + await new Promise(r => setTimeout(r, 500)); + } + } catch {} + + if (!foundIdentity) { + addLog('▸ PASSPORT: No active identity token found'); + setBootStep('PASSPORT: NO ACTIVE IDENTITY TOKEN'); + setBootProgress(42); + await new Promise(r => setTimeout(r, 300)); + + addLog('▸ PASSPORT: Guest access mode available'); + setBootStep('Guest access mode available'); + setBootProgress(48); + await new Promise(r => setTimeout(r, 300)); + } + + // Phase 4: Aegis Security Layer + addLog('▸ AEGIS: Initializing security layer...'); + setBootStep('AEGIS: INITIALIZING SECURITY LAYER...'); + setBootProgress(55); + await new Promise(r => setTimeout(r, 300)); + + addLog('▸ AEGIS: Loading threat detection modules...'); + setBootStep('Loading threat detection modules...'); + setBootProgress(60); + await new Promise(r => setTimeout(r, 250)); + + addLog('▸ AEGIS: Scanning network perimeter...'); + setBootStep('AEGIS: SCANNING NETWORK PERIMETER...'); + setBootProgress(65); + setThreatLevel('scanning'); + await new Promise(r => setTimeout(r, 600)); + + // Simulate threat assessment result + const threatResult = Math.random(); + if (threatResult < 0.7) { + setThreatLevel('low'); + addLog('▸ AEGIS: Threat level LOW - All systems nominal'); + setBootStep('THREAT LEVEL: LOW - ALL SYSTEMS NOMINAL'); + } else if (threatResult < 0.95) { + setThreatLevel('medium'); + addLog('▸ AEGIS: Threat level MEDIUM - Enhanced monitoring active'); + setBootStep('THREAT LEVEL: MEDIUM - MONITORING ACTIVE'); + } else { + setThreatLevel('high'); + addLog('▸ AEGIS: Threat level ELEVATED - Defensive protocols engaged'); + setBootStep('THREAT LEVEL: ELEVATED - PROTOCOLS ENGAGED'); + } + setBootProgress(75); await new Promise(r => setTimeout(r, 400)); + + // Phase 5: Network & Final + addLog('▸ NEXUS: Connecting to AeThex network...'); + setBootStep('Connecting to Nexus network...'); + setBootProgress(82); + await new Promise(r => setTimeout(r, 300)); + + addLog('▸ NEXUS: Syncing with distributed nodes...'); + setBootStep('Syncing with distributed nodes...'); + setBootProgress(88); + await new Promise(r => setTimeout(r, 250)); + + addLog('▸ NEXUS: Connection established - 42 peers online'); + setBootStep('NEXUS: 42 PEERS ONLINE'); + setBootProgress(94); + await new Promise(r => setTimeout(r, 200)); + + addLog('▸ SYSTEM: AeThex OS ready'); + setBootStep('AETHEX OS READY'); + setBootProgress(100); + await new Promise(r => setTimeout(r, 500)); + setShowLoginPrompt(true); }; @@ -706,64 +824,213 @@ export default function AeThexOS() { }; if (isBooting) { + const threatColors = { + scanning: 'text-cyan-400', + low: 'text-green-400', + medium: 'text-yellow-400', + high: 'text-red-400' + }; + const threatBgColors = { + scanning: 'bg-cyan-500/20 border-cyan-500/50', + low: 'bg-green-500/20 border-green-500/50', + medium: 'bg-yellow-500/20 border-yellow-500/50', + high: 'bg-red-500/20 border-red-500/50' + }; + return ( -
+
+ {/* Scan lines overlay */} +
+ + {/* CRT flicker effect */} -
-
-
- A + className="absolute inset-0 bg-white/[0.02] pointer-events-none z-40" + animate={{ opacity: [0, 0.02, 0, 0.01, 0] }} + transition={{ duration: 0.1, repeat: Infinity, repeatDelay: Math.random() * 3 + 1 }} + /> + + {/* Vignette effect */} +
+ +
+ {/* Left side - Boot logs */} +
+
+ + System Log +
+
+
+ {bootLogs.map((log, i) => ( + + {log} + + ))} +
+
+ + {/* Threat Level Indicator */} +
+
Aegis Status
+
+ + {threatLevel === 'scanning' ? 'SCANNING...' : `THREAT: ${threatLevel.toUpperCase()}`} +
-
{bootStep}
- -
+ {/* Center - Main boot display */} +
+ initial={{ opacity: 0 }} + animate={{ opacity: 1 }} + className="text-center max-w-md" + > + {/* Logo with glow */} +
+
+
+
+ + A + +
+
+ + {/* Current step with typing effect */} + + {bootStep} + + _ + + + + {/* Progress bar */} +
+
+ BOOT SEQUENCE + {bootProgress}% +
+
+ +
+ +
+
+ + {/* Detected identity badge */} + {detectedIdentity && ( + + + + {detectedIdentity.username} • ID:{detectedIdentity.passportId} + + + )} + +
AeThex OS v4.2.1 • Aegis Security Layer Active
+ + + {showLoginPrompt && ( + +
+ + {detectedIdentity + ? `IDENTITY VERIFIED • THREAT LEVEL: ${threatLevel.toUpperCase()}` + : `SYSTEM READY • THREAT LEVEL: ${threatLevel.toUpperCase()}` + } +
+
+ + + {detectedIdentity ? `Enter as ${detectedIdentity.username}` : 'Login with Passport'} + + {!detectedIdentity && ( + + Continue as Guest + + )} +
+
+ )} +
+
-
AeThex OS v1.0.0
- - - {showLoginPrompt && ( - -
- ✓ CROSS-PLATFORM IDENTITY READY -
-
- - -
-
- )} -
- + {/* Right side - System specs (hidden on mobile) */} +
+
+ System Info +
+
+
BUILD: 2025.12.21
+
KERNEL: 4.2.1-aethex
+
ARCH: x86_64
+
+
NEXUS NETWORK
+
Peers: 42 online
+
Latency: 12ms
+
+
+
PASSPORT
+
{detectedIdentity ? 'Token: VALID' : 'Token: NONE'}
+
Mode: {detectedIdentity ? 'ARCHITECT' : 'GUEST'}
+
+
+
+
); } @@ -2684,25 +2951,38 @@ function TerminalApp() { "║ architects - List architects in network ║", "║ projects - List active projects ║", "║ scan - Scan network for nodes ║", - "║ analyze - Run security analysis ║", "║ ping - Check network status ║", "║ whois - Look up architect profile ║", - "║ decrypt - Decrypt secure message ║", - "║ hack - ??? (try it) ║", - "║ fortune - Random architect wisdom ║", - "║ whoami - Current user info ║", - "║ neofetch - System information ║", - "║ matrix - Enter the matrix ║", - "║ clear - Clear terminal ║", + "║ passport - View passport status ║", "║ tour - AeThex guided tour ║", "╠═══════════════════════════════════════════╣", + "║ 🛡️ AEGIS SECURITY COMMANDS ║", + "╠═══════════════════════════════════════════╣", + "║ aegis - Aegis security dashboard ║", + "║ threat - Check current threat level ║", + "║ firewall - View firewall status ║", + "║ shield - Activate/check shield ║", + "║ trace - Trace network connection ║", + "║ encrypt - Encrypt a message ║", + "║ decrypt - Decrypt secure message ║", + "║ analyze - Run security analysis ║", + "╠═══════════════════════════════════════════╣", + "║ 🎮 FUN COMMANDS ║", + "╠═══════════════════════════════════════════╣", + "║ hack - ??? (try it) ║", + "║ fortune - Random architect wisdom ║", + "║ matrix - Enter the matrix ║", "║ dice - Roll two dice ║", "║ cowsay - Make a cow say something ║", "║ joke - Tell a programmer joke ║", + "║ coffee - Brew some coffee ║", + "╠═══════════════════════════════════════════╣", + "║ whoami - Current user info ║", + "║ neofetch - System information ║", "║ weather - Metaverse weather report ║", "║ uptime - System uptime ║", "║ banner - Show AeThex banner ║", - "║ coffee - Brew some coffee ║", + "║ clear - Clear terminal ║", "╚═══════════════════════════════════════════╝", "" ], setHistory); @@ -3169,6 +3449,203 @@ function TerminalApp() { ], setHistory); break; + case 'aegis': + await typeEffect([ + "", + "╔══════════════════════════════════════════════════╗", + "║ 🛡️ AEGIS SECURITY DASHBOARD 🛡️ ║", + "╠══════════════════════════════════════════════════╣", + "║ ║", + "║ Status: ████████████ ACTIVE ║", + "║ Shield Level: ████████████ MAXIMUM ║", + "║ Encryption: AES-256-GCM ║", + "║ Protocol: QUANTUM-RESISTANT ║", + "║ ║", + "╠══════════════════════════════════════════════════╣", + "║ RECENT ACTIVITY: ║", + "║ ├─ 0 intrusion attempts blocked (24h) ║", + "║ ├─ 42 secure sessions active ║", + "║ ├─ Last scan: 2 minutes ago ║", + "║ └─ Next scheduled: 5 minutes ║", + "║ ║", + "╠══════════════════════════════════════════════════╣", + "║ COMMANDS: threat, firewall, shield, trace ║", + "╚══════════════════════════════════════════════════╝", + "" + ], setHistory); + break; + + case 'threat': + setHistory(prev => [...prev, "Analyzing threat landscape..."]); + await progressBar("SCANNING", 12); + await delay(300); + const threatLevels = ['LOW', 'LOW', 'LOW', 'MINIMAL', 'MEDIUM']; + const currentThreat = threatLevels[Math.floor(Math.random() * threatLevels.length)]; + const threatColor = currentThreat === 'LOW' || currentThreat === 'MINIMAL' ? '🟢' : currentThreat === 'MEDIUM' ? '🟡' : '🔴'; + await typeEffect([ + "", + "┌─────────────────────────────────────────┐", + "│ AEGIS THREAT ASSESSMENT │", + "├─────────────────────────────────────────┤", + `│ Current Level: ${threatColor} ${currentThreat.padEnd(20)}│`, + "│ │", + "│ Perimeter: ✓ Secure │", + "│ Endpoints: ✓ Protected │", + "│ Data Layer: ✓ Encrypted │", + "│ Identity: ✓ Verified │", + "│ │", + "│ Last Incident: None recorded │", + "└─────────────────────────────────────────┘", + "" + ], setHistory); + break; + + case 'firewall': + await typeEffect([ + "", + "╔══════════════════════════════════════════════════╗", + "║ AEGIS FIREWALL STATUS ║", + "╠══════════════════════════════════════════════════╣", + "║ ║", + "║ ┌─────────────────────────────────────────────┐ ║", + "║ │ RULE SET: PARANOID │ ║", + "║ └─────────────────────────────────────────────┘ ║", + "║ ║", + "║ ACTIVE RULES: ║", + "║ ├─ DENY all inbound (default) ║", + "║ ├─ ALLOW 443/tcp (HTTPS) ║", + "║ ├─ ALLOW 80/tcp (HTTP redirect) ║", + "║ ├─ ALLOW aethex.network (trusted) ║", + "║ └─ DROP known-attackers (blocklist) ║", + "║ ║", + "║ Packets Inspected: 1,247,892 ║", + "║ Threats Blocked: 0 ║", + "║ ║", + "╚══════════════════════════════════════════════════╝", + "" + ], setHistory); + break; + + case 'shield': + const shieldMode = args[1]?.toLowerCase(); + if (shieldMode === 'activate' || shieldMode === 'on') { + setHistory(prev => [...prev, "Activating enhanced shield mode..."]); + await progressBar("DEPLOYING SHIELD", 15); + await delay(300); + await typeEffect([ + "", + " ╔════════════════════╗", + " ╔╝ ╚╗", + " ╔╝ 🛡️ AEGIS SHIELD ╚╗", + " ╔╝ ACTIVE ╚╗", + " ╔╝ ╚╗", + " ╔╝ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ╚╗", + " ║ QUANTUM BARRIER ║", + " ╚╗ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ╔╝", + " ╚╗ ╔╝", + " ╚╗ Protection: MAXIMUM ╔╝", + " ╚╗ ╔╝", + " ╚╗ ╔╝", + " ╚══════════════════════╝", + "", + "Shield mode activated. You are now protected.", + "" + ], setHistory); + } else if (shieldMode === 'status') { + await typeEffect([ + "", + "Shield Status: ACTIVE", + "Protection Level: MAXIMUM", + "Uptime: 99.999%", + "" + ], setHistory); + } else { + setHistory(prev => [...prev, "Usage: shield ", ""]); + } + break; + + case 'trace': + const traceTarget = args[1] || 'aethex.network'; + setHistory(prev => [...prev, `Initiating trace route to ${traceTarget}...`]); + await delay(200); + const hops = [ + { ip: '192.168.1.1', name: 'local-gateway', time: '0.5ms' }, + { ip: '10.0.0.1', name: 'isp-router', time: '12ms' }, + { ip: '72.14.192.1', name: 'core-switch', time: '18ms' }, + { ip: '42.42.42.1', name: 'aegis-gateway', time: '22ms' }, + { ip: '42.42.42.42', name: 'aethex.network', time: '24ms' }, + ]; + await typeEffect(["", `traceroute to ${traceTarget} (42.42.42.42), 30 hops max`, ""], setHistory); + for (let i = 0; i < hops.length; i++) { + await delay(300); + setHistory(prev => [...prev, ` ${i + 1} ${hops[i].ip.padEnd(15)} ${hops[i].name.padEnd(20)} ${hops[i].time}`]); + } + await typeEffect([ + "", + "✓ Trace complete. Connection secure.", + ` End-to-end encryption: VERIFIED`, + ` Route integrity: VERIFIED`, + "" + ], setHistory); + break; + + case 'encrypt': + const msgToEncrypt = args.slice(1).join(' '); + if (!msgToEncrypt) { + setHistory(prev => [...prev, "Usage: encrypt ", ""]); + break; + } + setHistory(prev => [...prev, "Encrypting message..."]); + await progressBar("ENCRYPTING", 8); + await delay(200); + // Generate fake encrypted output efficiently (fixed length) + const encryptedParts: string[] = []; + for (let i = 0; i < 24; i++) { + encryptedParts.push(Math.random().toString(16).substr(2, 2)); + } + const encrypted = encryptedParts.join(''); + await typeEffect([ + "", + "╔════════════════════════════════════════════════╗", + "║ AEGIS ENCRYPTION COMPLETE ║", + "╠════════════════════════════════════════════════╣", + "║ Algorithm: AES-256-GCM ║", + "║ Key Size: 256-bit ║", + "╠════════════════════════════════════════════════╣", + "║ ENCRYPTED OUTPUT: ║", + `║ ${encrypted.slice(0, 44)}... ║`, + "╚════════════════════════════════════════════════╝", + "", + "Message encrypted. Only authorized recipients can decrypt.", + "" + ], setHistory); + break; + + case 'passport': + try { + const sessRes = await fetch('/api/auth/session', { credentials: 'include' }); + const sessData = await sessRes.json(); + if (sessData?.authenticated) { + await typeEffect([ + "", + "╔══════════════════════════════════════════════════╗", + "║ AETHEX PASSPORT - VERIFIED ║", + "╠══════════════════════════════════════════════════╣", + `║ Username: ${(sessData.user.username || 'Unknown').padEnd(35)}║`, + `║ Status: AUTHENTICATED ║`, + `║ Role: ${(sessData.user.isAdmin ? 'ADMINISTRATOR' : 'ARCHITECT').padEnd(35)}║`, + "║ Session: ACTIVE ║", + "╚══════════════════════════════════════════════════╝", + "" + ], setHistory); + } else { + setHistory(prev => [...prev, "", "PASSPORT: No active session", "Use the Passport app to authenticate.", ""]); + } + } catch { + setHistory(prev => [...prev, "ERROR: Could not verify passport status", ""]); + } + break; + default: setHistory(prev => [...prev, `Command not found: ${cmd}`, "Type 'help' for available commands.", ""]); } @@ -3257,13 +3734,22 @@ function PassportApp({ onLoginSuccess, isDesktopLocked }: { onLoginSuccess?: () const [error, setError] = useState(''); const [isSubmitting, setIsSubmitting] = useState(false); - const { data: profile } = useQuery({ - queryKey: ['os-user-profile'], + const { data: metrics } = useQuery({ + queryKey: ['os-metrics'], queryFn: async () => { const res = await fetch('/api/metrics'); return res.json(); }, - enabled: true, + }); + + const { data: userProfile } = useQuery({ + queryKey: ['os-my-profile'], + queryFn: async () => { + const res = await fetch('/api/me/profile', { credentials: 'include' }); + if (!res.ok) return null; + return res.json(); + }, + enabled: isAuthenticated, }); useEffect(() => { @@ -3403,63 +3889,190 @@ function PassportApp({ onLoginSuccess, isDesktopLocked }: { onLoginSuccess?: () ); } + // Calculate XP progress for current level (with safe guards) + const currentLevel = Math.max(1, userProfile?.level || 1); + const totalXp = Math.max(0, userProfile?.total_xp || 0); + const xpPerLevel = 1000; + const xpForCurrentLevel = (currentLevel - 1) * xpPerLevel; + const xpForNextLevel = currentLevel * xpPerLevel; + const xpDelta = xpForNextLevel - xpForCurrentLevel; + const xpProgress = xpDelta > 0 ? Math.min(100, Math.max(0, ((totalXp - xpForCurrentLevel) / xpDelta) * 100)) : 0; + const passportId = userProfile?.aethex_passport_id || user?.id?.slice(0, 8).toUpperCase() || 'GUEST'; + const skills = Array.isArray(userProfile?.skills) ? userProfile.skills : []; + return ( -
-
-
-
- {isAuthenticated ? : } -
-

AeThex Passport

-

{isAuthenticated ? user?.username : 'Guest Access'}

-
- -
-
- Status - {isAuthenticated ? 'VERIFIED' : 'GUEST'} -
-
- Role - {isAuthenticated ? (user?.isAdmin ? 'ADMIN' : 'ARCHITECT') : 'VISITOR'} -
- {profile && ( - <> -
- Network - {profile.totalProfiles || 0} Architects +
+ {/* Credential Card */} +
+ {/* Holographic background effect */} +
+ + + {/* Holographic stripe */} +
+ + {/* Card header */} +
+
+
+
+ A +
+
+
AeThex
+
PASSPORT
+
-
- Projects - {profile.totalProjects || 0} + {isAuthenticated && ( + +
+ VERIFIED + + )} +
+ + {/* Avatar and name section */} +
+
+
+
+ {userProfile?.avatar_url ? ( + Avatar + ) : ( + + )} +
+
+ {isAuthenticated && ( +
+ {currentLevel} +
+ )}
- +
+
+ {isAuthenticated ? (userProfile?.full_name || user?.username) : 'Guest'} +
+
+ @{isAuthenticated ? user?.username : 'visitor'} +
+
+ {isAuthenticated ? (user?.isAdmin ? 'ADMINISTRATOR' : (userProfile?.role?.toUpperCase() || 'ARCHITECT')) : 'VISITOR'} +
+
+
+
+ + {/* Passport ID */} +
+
+
+
Passport ID
+
{passportId}
+
+ +
+
+ + {/* XP Progress - Only for authenticated users */} + {isAuthenticated && ( +
+
+ Level {currentLevel} + {totalXp.toLocaleString()} XP +
+
+ +
+
+ {Math.round(xpForNextLevel - totalXp)} XP to Level {currentLevel + 1} +
+
)} -
- -
- {!isAuthenticated ? ( - - ) : ( - + + {/* Skills */} + {isAuthenticated && skills.length > 0 && ( +
+
Skills
+
+ {(skills as string[]).slice(0, 6).map((skill, i) => ( + + {skill} + + ))} + {skills.length > 6 && ( + +{skills.length - 6} + )} +
+
)} -
- -
- Issued by Codex Certification Authority -
+ + {/* Stats row */} +
+
+
+
{metrics?.totalProfiles || 0}
+
Network
+
+
+
{metrics?.totalProjects || 0}
+
Projects
+
+
+
{userProfile?.loyalty_points || 0}
+
Points
+
+
+
+ + {/* Actions */} +
+ {!isAuthenticated ? ( + setMode('login')} + whileHover={{ scale: 1.02 }} + whileTap={{ scale: 0.98 }} + className="w-full py-3 bg-gradient-to-r from-cyan-500 to-cyan-400 hover:from-cyan-400 hover:to-cyan-300 text-black font-mono font-bold uppercase tracking-wider transition-all shadow-lg shadow-cyan-500/30" + data-testid="passport-signin-btn" + > + Authenticate + + ) : ( + + )} +
+ + {/* Footer */} +
+
+ Issued by Codex Authority +
+
+ + AEGIS +
+
+
); diff --git a/server/routes.ts b/server/routes.ts index 3978455..0c579b9 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -173,6 +173,21 @@ export async function registerRoutes( }); }); + // ========== AUTHENTICATED USER ROUTES ========== + + // Get current user's profile (for Passport app) + app.get("/api/me/profile", requireAuth, async (req, res) => { + try { + const profile = await storage.getProfile(req.session.userId!); + if (!profile) { + return res.status(404).json({ error: "Profile not found" }); + } + res.json(profile); + } catch (err: any) { + res.status(500).json({ error: err.message }); + } + }); + // ========== PUBLIC API ROUTES ========== // Get ecosystem metrics (public - for dashboard)