docs: README leads with plain-words explainer — bundler, bundles, elements, lean/tree-shaken, embed anywhere, SPA, JAMstack hot-swap

This commit is contained in:
doxa-maps 2026-09-11 17:43:48 +00:00
parent 4012f8d691
commit 6785dd826b

View file

@ -1,12 +1,43 @@
# doxa-maps
**A portable bundler that generates JAMstack maps that embed on all your partner sites.**
**A bundler that turns your maps into small embeddable pieces you can drop onto any website.**
> ### ✨ New here, and you don't write code?
> You can build real, embeddable maps by **describing them to an AI coding agent** — no
> programming required. Start with the friendly, zero-jargon guide:
> **[docs/tutorial.md](./docs/tutorial.md)**.
## In plain words
**What a bundler is.** It's a tool that takes your map code and packages it into a small,
ready-to-use file. You write the map once; the bundler produces the shippable piece.
**What it outputs.** Plain `.js` files in the `public/` folder — one per bundle. That's it.
No server, no build step on anyone else's side. Serve the folder from anywhere and the maps work.
**What a bundle is.** A self-contained web component — a custom HTML tag like `<my-map>`. You add
one `<script>` and drop the tag on a page. It carries everything it needs, so it runs on any site,
in any framework, or in none.
**One bundle can hold several maps.** A single bundle can define more than one element
(`<my-map>`, `<coverage-map>`, …). One file, many maps — fewer things to load and manage.
**The bundles are lean.** The build is tree-shaken: only the code a map actually uses gets
included, unused code is dropped. Small files, fast loads — which matters when a map embeds on
someone else's page.
**Embed on other people's websites.** Because each map is just a tag, you can put your maps on a
partner's or customer's site — or in any tool that accepts an embed, like Start.me, Notion, a CMS,
a landing page. Same map, many places. Write it once, embed it everywhere.
**Build a whole app (SPA), not just single maps.** Bundle several elements into one layout and you
get a single-page app made of your maps — lazy-loaded so it stays fast. So the same pieces are both
standalone embeds *and* the building blocks of a full site.
**They're JAMstack, so the API is hot-swappable.** The map is static; the data/service it talks to
is a runtime setting, not baked in. You can point a map at a different API — or swap the map engine
itself (Mapbox ↔ MapLibre) — by changing config, no rebuild. Portable and future-proof.
## Quickstart
Bun is required (`bun.lock` is the committed lockfile — install from <https://bun.sh>).
@ -32,23 +63,15 @@ anywhere and the bundles are embeddable from it.
```
The bundle is a plain `<script>` web component — the host page needs no build step and no
framework. `profile-config` is read at runtime, so the same bundle re-points at different data
or colors with no rebuild.
## Run it in your site, share it to partners — same map, many places
Two levels. The **maps** are web-component / iframe embeds you drop on any partner site with no
build step on their end. The **bundler** is self-contained: it runs standalone, or drops inside
a host repo and builds in place — so you own and vendor the whole thing, and choose where the
built maps are served from (your own site, GitHub/jsDelivr, or any CDN). One map runs in your
own site *and* embeds on your partner sites.
framework. `profile-config` is read at runtime, so the same bundle re-points at different data,
colors, or API with no rebuild.
## Docs
- **[Tutorial](./docs/tutorial.md)** — build your first map, step by step.
- **[How-to](./docs/how-to.md)** — task recipes: embed, add a profile, choose a CDN, set tokens.
- **[Reference](./docs/reference.md)** — file map, config fields, contracts, the `@map` library index.
- **[Explanation](./docs/explanation.md)** — the architecture and why it's shaped this way.
- **[Explanation](./docs/explanation.md)** — the short "what it is".
Contributors: see **[CONTRIBUTING.md](./CONTRIBUTING.md)**.