Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat(cybercity): borough layout with process buildings around each app

Adam Eivyea820007b5c7
diff --git a/.changelog/v0.12.x.md b/.changelog/v0.12.x.md
index 12d87425d1..571d0923cc 100644
--- a/.changelog/v0.12.x.md
+++ b/.changelog/v0.12.x.md
@@ -440,3 +440,19 @@ This release adds branch management and automated release workflow capabilities
- `client/src/components/city/CityHud.jsx` — Glitch title, health bar, scan line, corner decorations, neon shadows
- `client/src/components/city/CityScanlines.jsx` — CRT flicker, stronger vignette, edge glow lines
- `client/src/components/city/CityScene.jsx` — Integrated all 5 new scene layers, extended orbit range
+
+### CyberCity — Borough Layout Redesign
+- **Borough neighborhoods**: Each app is now its own borough — a main skyscraper surrounded by smaller process buildings in a ring, creating distinct neighborhoods with organic spacing
+- **Process buildings**: Lightweight neon-lit buildings representing each PM2 process an app runs, with status-colored wireframe edges (cyan=online, amber=stopped, indigo=not found), process name labels, blinking tip lights, and base glow circles
+- **Ring layout**: Process buildings are evenly distributed in a circle (3.0 unit radius) around the main building, each rotated to face the center
+- **Wider city grid**: Building spacing increased from 4.0 to 12.0 units to accommodate borough footprints, with all dependent systems (billboards, neon signs, data streams, traffic, roads) auto-adapting via the positions Map
+- **Wider roads**: Road surfaces doubled in width (0.3→0.6) with wider edge line offsets (0.15→0.3) and more padding (0.5→1.5) to match the expanded grid
+- **Extended camera**: Camera pulled back (18→25 Y, 30→45 Z), fog far distance extended (90→130), orbit max distance increased (80→120) to accommodate the larger city
+
+**Client changes**:
+- `client/src/components/city/ProcessBuilding.jsx` — New lightweight process building component (~8 Three.js objects)
+- `client/src/components/city/Borough.jsx` — New wrapper rendering main Building + ProcessBuilding ring + AgentEntity instances
+- `client/src/components/city/BuildingCluster.jsx` — Simplified to render Borough per app instead of Building + AgentEntity inline
+- `client/src/components/city/cityConstants.js` — Added `BOROUGH_PARAMS` and `PROCESS_BUILDING_PARAMS`, increased spacing to 12.0
+- `client/src/components/city/CityScene.jsx` — Adjusted camera position, fog distance, and orbit controls for larger city
+- `client/src/components/city/CityRoads.jsx` — Wider road surfaces, edge lines, and padding for larger grid spacing
diff --git a/client/src/components/city/Borough.jsx b/client/src/components/city/Borough.jsx
new file mode 100644
index 0000000000..7f59d4b971
--- /dev/null
+++ b/client/src/components/city/Borough.jsx
@@ -0,0 +1,80 @@
+import { useMemo } from 'react';
+import { getBuildingHeight, getAccentColor, BOROUGH_PARAMS } from './cityConstants';
+import Building from './Building';
+import AgentEntity from './AgentEntity';
+import ProcessBuilding from './ProcessBuilding';
+
+const hashString = (str) => {
+ let hash = 0;
+ for (let i = 0; i < str.length; i++) {
+ hash = ((hash << 5) - hash) + str.charCodeAt(i);
+ hash |= 0;
+ }
+ return Math.abs(hash);
+};
+
+export default function Borough({ app, position, agentMap, onBuildingClick }) {
+ const agentData = agentMap.get(app.id);
+ const agents = agentData?.agents || [];
+ const height = getBuildingHeight(app);
+ const accentColor = getAccentColor(app);
+
+ // Get processes to render in ring (skip for archived apps)
+ const processes = useMemo(() => {
+ if (app.archived) return [];
+ return app.processes || [];
+ }, [app.archived, app.processes]);
+
+ // Build pm2Status lookup map
+ const pm2Status = app.pm2Status || {};
+
+ // Compute ring positions for process buildings
+ const processPositions = useMemo(() => {
+ const count = processes.length;
+ if (count === 0) return [];
+
+ return processes.map((proc, i) => {
+ const angle = (i / count) * Math.PI * 2;
+ const x = Math.cos(angle) * BOROUGH_PARAMS.processRingRadius;
+ const z = Math.sin(angle) * BOROUGH_PARAMS.processRingRadius;
+ // Rotation to face center: angle + PI so front face points inward
+ const rotation = angle + Math.PI;
+ const seed = hashString(proc.name || `proc-${i}`);
+ return { x, z, rotation, seed, process: proc };
+ });
+ }, [processes]);
+
+ return (
+ <group>
+ {/* Main building (the app) */}
+ <Building
+ app={app}
+ position={position}
+ agentCount={agents.length}
+ onClick={() => onBuildingClick?.(app)}
+ />
+
+ {/* Process buildings in ring around main building */}
+ {processPositions.map(({ x, z, rotation, seed, process: proc }) => (
+ <ProcessBuilding
+ key={proc.name}
+ process={proc}
+ pm2Status={pm2Status[proc.name]}
+ position={[position.x + x, 0, position.z + z, rotation]}
+ accentColor={accentColor}
+ seed={seed}
+ />
+ ))}
+
+ {/* Agent entities floating above main building */}
+ {agents.map((agent, i) => (
+ <AgentEntity
+ key={agent.agentId || i}
+ agent={agent}
+ position={[position.x, height + 1.5 + i * 1.0, position.z]}
+ index={i}
+ />
+ ))}
+ </group>
+ );
+}
diff --git a/client/src/components/city/BuildingCluster.jsx b/client/src/components/city/BuildingCluster.jsx
index 3040f3cdae..17135529c4 100644
--- a/client/src/components/city/BuildingCluster.jsx
+++ b/client/src/components/city/BuildingCluster.jsx
@@ -1,9 +1,8 @@
import { useMemo, useEffect } from 'react';
import { Text } from '@react-three/drei';
import { computeCityLayout } from './cityLayout';
-import { getBuildingHeight, DISTRICT_PARAMS, PIXEL_FONT_URL } from './cityConstants';
-import Building from './Building';
-import AgentEntity from './AgentEntity';
+import { DISTRICT_PARAMS, PIXEL_FONT_URL } from './cityConstants';
+import Borough from './Borough';
export default function BuildingCluster({ apps, agentMap, onBuildingClick, onPositionsReady }) {
const positions = useMemo(() => computeCityLayout(apps), [apps]);
@@ -29,27 +28,14 @@ export default function BuildingCluster({ apps, agentMap, onBuildingClick, onPos
const pos = positions.get(app.id);
if (!pos) return null;
- const agentData = agentMap.get(app.id);
- const agents = agentData?.agents || [];
- const height = getBuildingHeight(app);
-
return (
- <group key={app.id}>
- <Building
- app={app}
- position={pos}
- agentCount={agents.length}
- onClick={() => onBuildingClick?.(app)}
- />
- {agents.map((agent, i) => (
- <AgentEntity
- key={agent.agentId || i}
- agent={agent}
- position={[pos.x, height + 1.5 + i * 1.0, pos.z]}
- index={i}
- />
- ))}
- </group>
+ <Borough
+ key={app.id}
+ app={app}
+ position={pos}
+ agentMap={agentMap}
+ onBuildingClick={onBuildingClick}
+ />
);
})}
diff --git a/client/src/components/city/CityRoads.jsx b/client/src/components/city/CityRoads.jsx
index 2656957cc2..65d4f67e24 100644
--- a/client/src/components/city/CityRoads.jsx
+++ b/client/src/components/city/CityRoads.jsx
@@ -37,20 +37,20 @@ function RoadSegment({ start, end, color, offset = 0 }) {
position={[midX, 0.005, midZ]}
rotation={[-Math.PI / 2, 0, angle]}
>
- <planeGeometry args={[length, 0.3]} />
+ <planeGeometry args={[length, 0.6]} />
<meshBasicMaterial color="#0a0a1a" transparent opacity={0.6} side={THREE.DoubleSide} />
</mesh>
{/* Road edge lines */}
<mesh
- position={[midX, 0.01, midZ + Math.cos(angle) * 0.15]}
+ position={[midX, 0.01, midZ + Math.cos(angle) * 0.3]}
rotation={[-Math.PI / 2, 0, angle]}
>
<planeGeometry args={[length, 0.02]} />
<meshBasicMaterial color={color} transparent opacity={0.3} side={THREE.DoubleSide} />
</mesh>
<mesh
- position={[midX, 0.01, midZ - Math.cos(angle) * 0.15]}
+ position={[midX, 0.01, midZ - Math.cos(angle) * 0.3]}
rotation={[-Math.PI / 2, 0, angle]}
>
<planeGeometry args={[length, 0.02]} />
@@ -93,7 +93,7 @@ export default function CityRoads({ positions }) {
maxZ = Math.max(maxZ, p.z);
});
- const pad = spacing / 2 + 0.5;
+ const pad = spacing / 2 + 1.5;
// Horizontal roads between rows
rows.forEach((z, i) => {
diff --git a/client/src/components/city/CityScene.jsx b/client/src/components/city/CityScene.jsx
index 4708c8016d..1a84a92700 100644
--- a/client/src/components/city/CityScene.jsx
+++ b/client/src/components/city/CityScene.jsx
@@ -32,13 +32,13 @@ export default function CityScene({ apps, agentMap, onBuildingClick, cosStatus,
return (
<Canvas
- camera={{ position: [0, 18, 30], fov: 50 }}
+ camera={{ position: [0, 25, 45], fov: 50 }}
dpr={[1, 1.5]}
shadows={false}
style={{ background: '#030308' }}
gl={{ antialias: true }}
>
- <fog attach="fog" args={['#030308', 30, 90]} />
+ <fog attach="fog" args={['#030308', 30, 130]} />
<CityLights />
<CityStarfield />
<CityShootingStars />
@@ -70,7 +70,7 @@ export default function CityScene({ apps, agentMap, onBuildingClick, cosStatus,
<OrbitControls
maxPolarAngle={Math.PI / 2.2}
minDistance={5}
- maxDistance={80}
+ maxDistance={120}
enableDamping
dampingFactor={0.05}
/>
diff --git a/client/src/components/city/ProcessBuilding.jsx b/client/src/components/city/ProcessBuilding.jsx
new file mode 100644
index 0000000000..379ffa6a38
--- /dev/null
+++ b/client/src/components/city/ProcessBuilding.jsx
@@ -0,0 +1,112 @@
+import { useRef, useMemo } from 'react';
+import { useFrame } from '@react-three/fiber';
+import { Text } from '@react-three/drei';
+import * as THREE from 'three';
+import { CITY_COLORS, PROCESS_BUILDING_PARAMS, PIXEL_FONT_URL } from './cityConstants';
+
+const STATUS_COLORS = {
+ online: '#06b6d4',
+ stopped: '#f59e0b',
+ not_found: '#6366f1',
+ error: '#ef4444',
+};
+
+const hashString = (str) => {
+ let hash = 0;
+ for (let i = 0; i < str.length; i++) {
+ hash = ((hash << 5) - hash) + str.charCodeAt(i);
+ hash |= 0;
+ }
+ return Math.abs(hash);
+};
+
+export default function ProcessBuilding({ process, pm2Status, position, accentColor, seed }) {
+ const blinkRef = useRef();
+ const glowRef = useRef();
+
+ const status = pm2Status?.status || 'not_found';
+ const color = STATUS_COLORS[status] || STATUS_COLORS.not_found;
+ const { width, depth } = PROCESS_BUILDING_PARAMS;
+
+ // Height based on status + seed variation
+ const height = useMemo(() => {
+ if (status === 'online') {
+ return 2.0 + (seed % 100) / 100 * 1.5; // 2.0 - 3.5
+ }
+ return 1.5;
+ }, [status, seed]);
+
+ const boxGeom = useMemo(() => new THREE.BoxGeometry(width, height, depth), [width, height, depth]);
+ const edgesGeom = useMemo(() => new THREE.EdgesGeometry(boxGeom), [boxGeom]);
+
+ const displayName = useMemo(() => {
+ return (process.name || '').replace(/[-_.]/g, ' ').toUpperCase();
+ }, [process.name]);
+
+ // Rotation to face center (passed via position array)
+ const rotation = position[3] || 0;
+
+ useFrame(({ clock }) => {
+ const t = clock.getElapsedTime();
+ if (blinkRef.current) {
+ blinkRef.current.material.opacity = (Math.sin(t * 3 + seed) > 0.3) ? 0.8 : 0.1;
+ }
+ if (glowRef.current) {
+ glowRef.current.material.opacity = status === 'online'
+ ? 0.15 + Math.sin(t * 1.5 + seed) * 0.08
+ : 0.08;
+ }
+ });
+
+ return (
+ <group position={[position[0], 0, position[2]]} rotation={[0, rotation, 0]}>
+ {/* Building body */}
+ <mesh position={[0, height / 2, 0]}>
+ <boxGeometry args={[width, height, depth]} />
+ <meshStandardMaterial
+ color={CITY_COLORS.buildingBody}
+ emissive={color}
+ emissiveIntensity={status === 'online' ? 0.2 : 0.08}
+ transparent
+ opacity={0.9}
+ />
+ </mesh>
+
+ {/* Neon wireframe edges */}
+ <lineSegments position={[0, height / 2, 0]} geometry={edgesGeom}>
+ <lineBasicMaterial color={color} transparent opacity={0.8} />
+ </lineSegments>
+
+ {/* Neon top cap */}
+ <mesh position={[0, height + 0.01, 0]} rotation={[-Math.PI / 2, 0, 0]}>
+ <planeGeometry args={[width + 0.05, depth + 0.05]} />
+ <meshBasicMaterial color={color} transparent opacity={0.4} />
+ </mesh>
+
+ {/* Process name on front face */}
+ <Text
+ position={[0, height * 0.7, depth / 2 + 0.02]}
+ fontSize={0.1}
+ color={color}
+ anchorX="center"
+ anchorY="middle"
+ font={PIXEL_FONT_URL}
+ maxWidth={width * 0.85}
+ >
+ {displayName}
+ </Text>
+
+ {/* Blinking tip light */}
+ <mesh ref={blinkRef} position={[0, height + 0.12, 0]}>
+ <sphereGeometry args={[0.03, 6, 6]} />
+ <meshBasicMaterial color={color} transparent opacity={0.8} />
+ </mesh>
+
+ {/* Base glow circle */}
+ <mesh ref={glowRef} rotation={[-Math.PI / 2, 0, 0]} position={[0, 0.01, 0]}>
+ <circleGeometry args={[0.6, 16]} />
+ <meshBasicMaterial color={color} transparent opacity={0.15} side={THREE.DoubleSide} />
+ </mesh>
+ </group>
+ );
+}
diff --git a/client/src/components/city/cityConstants.js b/client/src/components/city/cityConstants.js
index 1ff8b70f9d..23c1b87353 100644
--- a/client/src/components/city/cityConstants.js
+++ b/client/src/components/city/cityConstants.js
@@ -23,10 +23,21 @@ export const CITY_COLORS = {
orbit: '#1e3a5f',
};
+export const BOROUGH_PARAMS = {
+ processRingRadius: 3.0, // Distance of process buildings from center
+ processMinHeight: 1.5,
+ processMaxHeight: 3.5,
+};
+
+export const PROCESS_BUILDING_PARAMS = {
+ width: 0.8,
+ depth: 0.8,
+};
+
export const BUILDING_PARAMS = {
width: 2.0,
depth: 2.0,
- spacing: 4.0,
+ spacing: 12.0,
heights: {
online: 5,
stopped: 2.5,