Files
Space-Game/README.md
francy51 316a44661b Restructure into pnpm monorepo with game shell, docs, and SpacetimeDB backend
- Restructure flat static prototype into pnpm workspace monorepo
- apps/game: playable shell with R3F 3D scene, HUD, SpacetimeDB connection
- apps/docs: design docs and prototypes
- apps/site: landing page
- packages/ui: shared Button and Panel primitives
- services/spacetimedb: backend module (9 tables, 11 reducers)
- Archive legacy static files to archive/legacy-static/
- Game loop: connect, undock, target, approach, dock, mine, sell
- Add pnpm-workspace.yaml, tsconfig.base.json, spacetime.json
2026-05-31 17:56:56 -04:00

85 lines
2.3 KiB
Markdown

# VOID::NAV
VOID::NAV is now a pnpm workspace monorepo for the game website, living design docs, browser game shell, and SpacetimeDB backend module.
## Layout
```text
apps/docs Existing docs, interactive demos, and vertical slice
apps/site Public landing page / game website
apps/game Playable game shell connected to SpacetimeDB bindings
packages/ui Small shared UI primitives and CSS tokens
services/spacetimedb TypeScript SpacetimeDB module
archive/legacy-static Legacy static prototype files kept for reference
```
## Prerequisites
- Node.js 24+
- pnpm 9+
- SpacetimeDB CLI for backend build, generation, and local DB runs
The SpacetimeDB CLI is not vendored. Frontend builds use the committed placeholder bindings in `apps/game/src/module_bindings`; run `pnpm generate:bindings` after installing the CLI to replace them with generated bindings.
## Development
```bash
pnpm install
pnpm dev:docs
pnpm dev:site
pnpm dev:game
```
Default ports:
- docs: `http://localhost:5173/docs`
- site: `http://localhost:5174`
- game: `http://localhost:5175`
The public site links to docs and game via:
```text
VITE_DOCS_URL=http://localhost:5173/docs
VITE_GAME_URL=http://localhost:5175
```
The game shell reads:
```text
VITE_SPACETIME_URI=http://localhost:3000
VITE_SPACETIME_DATABASE=void-nav-dev
```
## Builds
```bash
pnpm --filter @void-nav/docs build
pnpm --filter @void-nav/site build
pnpm --filter @void-nav/game build
pnpm build
pnpm check
```
## SpacetimeDB
Root `spacetime.json` points at `services/spacetimedb` and generates TypeScript bindings into `apps/game/src/module_bindings`.
With the CLI installed:
```bash
spacetime build --module-path services/spacetimedb
pnpm generate:bindings
pnpm dev:db
```
`pnpm dev:db` targets the SpacetimeDB CLI server nickname `local` so development publishes to `http://127.0.0.1:3000` instead of any configured cloud default.
Initial reducers:
- `connectPlayer(displayName: string)`
- `renamePlayer(displayName: string)`
- `seedWorld()`
- `ping()`
The game shell calls `connectPlayer` after connection, subscribes to starter shell rows, and displays connection, player, ship, system, station, and reducer status. When SpacetimeDB is unavailable or bindings are still placeholders, it shows a clear disconnected/error state.