Map & Territory is a hexmap editor focused on a clean, professional editing experience. The editor itself is polished; the goal is to enable creating maps with an analog, gritty feel over time.
Project context, goals, and design philosophy: guidance/product_brief.md.
- Editor app scaffold in Next.js with a polished UI foundation.
- Foundational hex grid primitives used by the editor.
- Unit and E2E testing setup (Vitest, Playwright).
- Guidance and ADRs to steer architecture and product direction.
Status: early learning project; see guidance/tickets.md and guidance/todos.md for active work and roadmap.
See guidance/tech_stack.md for details and rationale.
Prerequisites
- Node 20+ recommended; pnpm installed.
Install and run
pnpm install
pnpm devVisit http://localhost:3000 and start hacking. Edit app/page.tsx to see live updates.
Production build
pnpm build
pnpm startThis repo uses Husky + lint-staged to run commit-time checks:
- Block commits directly to
main. - Prevent committing large files (>10MB) or CRLF line endings.
- Format and lint staged files (Prettier + ESLint).
Setup (one-time):
pnpm add -D husky lint-staged
pnpm run prepare # initializes Husky hooksHusky runs .husky/pre-commit, which delegates to scripts/pre-commit.sh and then runs lint-staged. This hook uses a bash shebang and does not rely on deprecated husky.sh shims.
Prefer Husky?
- Keep the existing
.githooksfor now. If you want Husky later:- Install:
pnpm add -D husky(and optionallylint-staged) - Init:
pnpm husky(ornpx husky init) - Create
.husky/pre-committhat delegates to our script:This reuses the same checks without duplicating logic.#!/usr/bin/env sh . "$(dirname "$0")/_/husky.sh" .githooks/pre-commit
- Install:
Editor settings
- Project ships with
.editorconfigfor LF line endings, UTF‑8, final newline, and 2‑space indentation.
- Unit:
pnpm testorpnpm test:run - Coverage:
pnpm test:coverage - E2E:
pnpm test:e2e(orpnpm test:e2e:ui)
All contributions should keep the test suite green.
src/: Application source.public/: Static assets.guidance/: Product brief, ADRs, features, and process docs.
Hex grid concepts and formulas are adapted from Amit Patel’s Red Blob Games:
- https://www.redblobgames.com/grids/hexagons/
- https://www.redblobgames.com/grids/hexagons/implementation.html
See THIRD_PARTY_NOTICES.md for attribution details.
MIT — see LICENSE.