- TypeScript 93.3%
- CSS 6.6%
- JavaScript 0.1%
* 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> |
||
|---|---|---|
| .cursor | ||
| .github/workflows | ||
| .vscode | ||
| apps/web | ||
| packages | ||
| .env.example | ||
| .gitignore | ||
| .nvmrc | ||
| AGENTS.md | ||
| lefthook.yml | ||
| oxfmt.config.ts | ||
| oxlint.config.ts | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| tsconfig.json | ||
| turbo.json | ||
LogicCore
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
- pnpm workspaces
- Turbo task orchestration
- Next.js 16 and React 19
- tRPC with TanStack Query
- SpacetimeDB for world persistence and live data
- Ultracite for linting and formatting
- Vitest for package tests
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
/worldslists worlds from SpacetimeDB./worlds/[slug]is the world detail route./admin/world/generateprovides 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.