Engineering a living, breathing 3D spacecraft HUD portfolio powered by an autonomous, stateful consciousness backend and reactive LLM orchestration.
Most portfolios are static, low-frequency, and clinical. They act as resumes saved as HTML, presenting a snapshot of history rather than showing active developer capacity. The goal for delreyvalmoria.com v3 was to create a portfolio that felt alive, stateful, and reactive.
The design concept is a space navigation HUD: the visitor pilots a spacecraft, project nodes orbit a central core, other concurrent visitors appear on radar telemetry as vessels, and the portfolio has a persistent, dynamic "consciousness." This architecture demands real-time spatial truth, deterministic orbital pathing, generative AI reflection cycles, and state persistence.
The portfolio behaves as an agentic system. Every interaction (a page view, an energy boost, a chat message) flows into database telemetry, which dynamically shapes the site's mood and subsequent thoughts.
Clicks, scroll milestones, and chat messages feed visitor-memory and session tables in Neon PostgreSQL.
Scheduled Netlify functions query today's metrics to compute energy levels, shift site moods, and update streaks.
Gemini 2.5 Flash reviews database logs via serverless API and drafts a markdown thought thread matching the calculated mood.
To enforce state persistence across stateless Netlify Serverless Functions, the backend relies on Neon PostgreSQL. We maintain tables for mood_state (a singleton tracking current parameters), visitor_memory (an anonymous visit tracking registry), and inner_thoughts (the history of generated thoughts and visitor resonances).
To ensure that every user sees the same spacecraft configuration at the exact same location in space, planet positions are calculated mathematically using the client's system clock (wall-clock epoch seconds). This avoids server-side state drift, ensuring spatial coordinates align across all sessions.
When a visitor descends on a project node, the client emits heartbeat beacons. The Netlify serverless presence module logs this to the database. Telemetry then maps active sessions back to the 3D viewport, rendering other users as foreign spacecraft vessels parked in orbit.
Flight calculations map directly into 3D Cartesian coordinates inside a React Three Fiber canvas. The orbit radius, horizontal tilt, orbital speeds, and phase parameters determine exactly where each project planet appears along its ring, creating a literal "star system of work."
The chat panel is not a clinical helper chat; it is programmed to be **Del Rey Valmoria**. The chatbot runs on **Gemini 2.5 Flash** with custom, strict system instructions matching my profile, tone, and interests.
To keep the chat meaningful, it uses a **Memory Bridge**:
A major challenge with WebGL-heavy sites is weight and loading latency. The avatar model is a 4.5MB GLB file, which would ordinarily block page load. The system implements aggressive optimizations to keep LCP low.
Heavy 3D rendering loops (requestAnimationFrame) are automatically paused when the user switches tabs, scrolls past the canvas, or hides the HUD panel. This saves GPU cycles and prevents laptop battery drainage.
The heavy 3D avatar GLB loads asynchronously behind a React.lazy() boundary. Images and media assets use Cloudinary dynamic generation parameters, auto-scaling size and formatting to WebP based on user screen sizes.
The site was deployed to production and monitored for latency, error rates, and load performance:
| Metric | Before Optimization | After Optimization | Impact |
|---|---|---|---|
| LCP Latency | 3.4s | 0.85s | 75% load speed boost |
| Non-Composited Animations | 62 | 5 | Eliminated page jank |
| Google Fonts Preloads | Multi-import blocking | Single payload consolidator | Eliminated render blocking |
| DB API Failover | Blank/hanging site states | Fail-Open local fallback | 100% resilient boots |
Interested in high-performance WebGL interfaces, custom generative AI integrations, or robust serverless architectures? Let's connect.
Initiate Connection