Skip to content

About

A spatial memory tool for recreating familiar places, attaching information to locations, and walking routes to practice recall. Concept and roadmap.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Memory Palace V0

A local-first, browser-based 3D memory palace built with React 19, TypeScript, Three.js, and React Three Fiber. Create rooms, place memorable objects, attach associations, and revisit them in first person.

Run locally

Install Node.js 22.13+ (Node 24 also works) and npm. From this project folder:

npm ci
npm run dev

Open http://localhost:3000 (or the Local URL printed in your terminal). Use a desktop browser with WebGL and hardware acceleration, a keyboard, and a mouse. No account, API key, database, or model downloads are required.

npm run typecheck
npm run lint
npm test
npm run build
npm start

npm start serves the production build through the local Wrangler runtime; use its printed URL. The app uses the Sites React/Vinext scaffold, powered by Vite. Cloudflare tools are local development/build infrastructure; this V0 does not require a Cloudflare account or deployment.

Build Mode

  1. The starter atrium contains three sample memory objects.
  2. Drag the scene to orbit, scroll to zoom, and right-drag to pan.
  3. Choose Room, then click clear courtyard ground to place an 8 × 8 room. Rooms need a one-unit gap and must fit within the 56 × 56 courtyard.
  4. Choose Cube, Sphere, or Cone, then click a clear spot inside a room. Placement snaps to whole units and prevents overlapping objects or placing them against walls.
  5. Choose Select and click an object, room, or sidebar entry. Edit names, memory associations, and object colors in the inspector.
  6. Use Move on the floor to reposition an object, including into another room. Click Cancel move to cancel. Rooms are fixed after placement; delete and replace them to change their position.
  7. Delete individual memories, or delete a room and its contained memories after confirmation.

Walk Mode

  • Switch to Walk Mode, then click Enter walk to capture the mouse.
  • WASD / arrow keys: move; mouse: look; left Shift: run; Esc: release the mouse.
  • Aim the crosshair at a memory and click to release the mouse and read its note. Click Enter walk to continue.
  • Enter or exit through the open front of each room. The other three walls and courtyard perimeter block movement.
  • Switching modes resets the camera. Each walk begins in the first room (or courtyard center if no rooms remain).

State and persistence

app/palace/model.ts defines a versioned Palace containing Room[] and Memory[]. Rooms have IDs, names, and X/Z centers. Memory objects have an owning room ID, X/Z position, shape, color, name, and note. Y placement and room dimensions are fixed in V0. Scene state is separate from temporary UI state (mode, selected item, placement tool).

Every edit saves synchronously to this browser's localStorage under memory-palace-v0. Refreshing restores the palace. Storage is specific to the browser and origin, so changing ports or browsers produces a separate palace. A visible status reports storage failures. Corrupt or incompatible saved data falls back to the starter.

Export palace downloads versioned JSON. V0 provides export for a portable backup; it does not yet have an import interface. Clear the memory-palace-v0 storage entry in browser developer tools and reload to restore the starter. Clearing browser data erases local edits.

Project map

app/
  layout.tsx          Document title and metadata
  page.tsx            Client mount boundary (avoids server access to WebGL/storage)
  palace/
    App.tsx           Editor, inspector, placement, and persistence
    Scene.tsx         Lighting, room/object meshes, camera, movement, collisions
    model.ts          Types, starter data, placement constraints, validation
    styles.css        Responsive editor layout
tests/model.test.ts   Placement, persistence validation, and cascade deletion tests
.github/workflows/ci.yml
vite.config.ts       Vite/Vinext and local runtime configuration

components/, hooks/, and lib/ contain the scaffold's shadcn UI foundation, available for future editor work. The prototype currently uses native form controls.

Repository history and maintenance

The original product concept, product notes, prototype plan, and roadmap are retained. These describe the earlier plan; this README describes the implemented V0. Ordered routes and recall scoring remain future work.

The lockfile is included. CI checks types, lint, tests, and the production build. Ignore rules exclude dependencies, build output, environment files, and runtime caches. No open-source license has been selected.

The sharp dependency override pins the development runtime's transitive image library to a patched release. Keep it until upstream dependencies require that release or newer.

V0 limits and next steps

  • Desktop first: the layout adapts to narrow screens, but first-person navigation requires a keyboard and mouse; touch walking is not implemented.
  • Fixed-size, axis-aligned rooms with open fronts; no roofs, door editor, stairs, or multiple floors.
  • Simple wall collision blocks movement without sliding; decorative memory objects do not block walking.
  • No undo/redo, JSON import UI, cloud sync, authentication, custom model uploads, or spaced-repetition scheduling.
  • Fonts fall back to installed sans-serif fonts if the optional Google Fonts request is unavailable.
  • Automated checks cover domain rules and compilation. GPU rendering, pointer lock, and visual layout need a manual browser pass on the target device.

Manual acceptance checklist

  • Orbit, zoom, and pan; dragging must not accidentally place an object.
  • Place a second room and objects; reject overlapping rooms and outside-room objects.
  • Rename an object, edit its note/color, move it to another room, and refresh to confirm persistence.
  • Enter Walk Mode, move/look, stop at walls, leave through an open front, and click a memory to read its note.
  • Release with Esc and switch back to Build Mode; typing in an input must not move the camera.
  • Delete a room, confirm dependent objects disappear, and export the palace.

React/Fiber version compatibility follows the official React Three Fiber installation guide.

About

A spatial memory tool for recreating familiar places, attaching information to locations, and walking routes to practice recall. Concept and roadmap.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages