No description
  • TypeScript 93.3%
  • CSS 6.6%
  • JavaScript 0.1%
Find a file
Elmer van Rooijen 555ab451f6
Add terrain-driven world generation (#7)
* Add terrain-driven world generation

Co-authored-by: Elmer van Rooijen <e.van.rooijen@hotmail.com>

* Prefer switch cases in world generation

Co-authored-by: Elmer van Rooijen <e.van.rooijen@hotmail.com>

* Move biome classification into terrain sample

Co-authored-by: Elmer van Rooijen <e.van.rooijen@hotmail.com>

* Move richness and ore modifiers into terrain sample

Co-authored-by: Elmer van Rooijen <e.van.rooijen@hotmail.com>

* Remove switch true terrain checks

Co-authored-by: Elmer van Rooijen <e.van.rooijen@hotmail.com>

* Store geology on terrain sample

Co-authored-by: Elmer van Rooijen <e.van.rooijen@hotmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-05-19 07:46:21 +02:00
.cursor Initial commit 2026-05-05 21:10:36 +02:00
.github/workflows Install SpacetimeDB CLI in CI (#3) 2026-05-16 13:09:56 +02:00
.vscode chore: update vscode settings to disable format on paste 2026-05-05 21:14:48 +02:00
apps/web Refactor TRPC server calls to use getCaller utility 2026-05-17 16:33:26 +02:00
packages Add terrain-driven world generation (#7) 2026-05-19 07:46:21 +02:00
.env.example feature: Add SpacetimeDB integration by creating new package and updating dependencies; modify environment variables in .env.example and turbo.json for improved build process; refactor TRPC router to utilize SpacetimeDB for world management. 2026-05-15 20:57:56 +02:00
.gitignore Update .gitignore to include *.db files, add db:studio script to package.json, and implement context creation for TRPC router. Refactor world generation logic and add database schema for generated worlds. 2026-05-10 21:35:58 +02:00
.nvmrc Add .nvmrc file with Node.js version 24.15.0 2026-05-10 10:22:47 +00:00
AGENTS.md Initial commit 2026-05-05 21:10:36 +02:00
lefthook.yml Initial commit 2026-05-05 21:10:36 +02:00
oxfmt.config.ts feature: Add SpacetimeDB integration by creating new package and updating dependencies; modify environment variables in .env.example and turbo.json for improved build process; refactor TRPC router to utilize SpacetimeDB for world management. 2026-05-15 20:57:56 +02:00
oxlint.config.ts feature: Add SpacetimeDB integration by creating new package and updating dependencies; modify environment variables in .env.example and turbo.json for improved build process; refactor TRPC router to utilize SpacetimeDB for world management. 2026-05-15 20:57:56 +02:00
package.json Update .gitignore to include *.db files, add db:studio script to package.json, and implement context creation for TRPC router. Refactor world generation logic and add database schema for generated worlds. 2026-05-10 21:35:58 +02:00
pnpm-lock.yaml feat: Integrate @tanstack/react-form for world generation and deletion; implement DeleteWorldForm component; refactor GenerateWorldForm to enhance error handling and validation; update WorldList to utilize live data from SpacetimeDB. 2026-05-15 21:58:17 +02:00
pnpm-workspace.yaml feature: Add SpacetimeDB integration by creating new package and updating dependencies; modify environment variables in .env.example and turbo.json for improved build process; refactor TRPC router to utilize SpacetimeDB for world management. 2026-05-15 20:57:56 +02:00
README.md Add CI badge to README (#5) 2026-05-16 18:35:32 +02:00
tsconfig.json chore: update pnpm-lock.yaml with new dependencies for web app and adjust workspace settings 2026-05-05 21:31:02 +02:00
turbo.json Refactor SpacetimeDB schema and add chunk management 2026-05-17 15:52:25 +02:00

LogicCore

CI

LogicCore is a pnpm workspace for experimenting with generated worlds backed by SpacetimeDB. The repository contains a Next.js application, typed SpacetimeDB bindings, a tRPC API layer, and deterministic world generation utilities.

Workspace layout

apps/
  web/                  Next.js app router application
packages/
  spacetimedb/          Generated SpacetimeDB TypeScript bindings
  trpc/                 tRPC routers and server-side context
  world/                Deterministic world generation utilities

Tech stack

Getting started

Install dependencies:

pnpm install

Copy the example environment file and fill in the SpacetimeDB values:

cp .env.example .env

Required server-side variables:

SPACETIMEDB_HOST=
SPACETIMEDB_DB_NAME=

Optional client-side variables override the browser connection defaults used by the web app:

NEXT_PUBLIC_SPACETIMEDB_HOST=
NEXT_PUBLIC_SPACETIMEDB_DB_NAME=

Start the development servers:

pnpm dev

The web app runs from apps/web and is available at http://localhost:3000 by default.

Common commands

Run these commands from the repository root:

pnpm dev        # Start workspace development tasks
pnpm build      # Build the workspace
pnpm test       # Run package tests
pnpm check      # Check formatting and lint rules with Ultracite
pnpm fix        # Auto-fix formatting and lint issues with Ultracite
pnpm generate   # Regenerate SpacetimeDB bindings

Application routes

  • /worlds lists worlds from SpacetimeDB.
  • /worlds/[slug] is the world detail route.
  • /admin/world/generate provides a form for creating a world from a numeric seed.

Packages

@logiccore/world

Provides deterministic world generation. The exported generateWorld function builds chunk data from a seed, world size, and chunk size, including biome, geology, richness, ore modifiers, and generated region names.

@logiccore/spacetimedb

Contains generated TypeScript bindings for the SpacetimeDB module. Regenerate these files with:

pnpm generate

@logiccore/trpc

Defines the tRPC API surface used by the web app. Current world operations include listing worlds, adding a world by seed, and deleting a world by id.

Code quality

This repository uses Ultracite for formatting and linting:

pnpm check
pnpm fix

Run pnpm check before opening a pull request.