86d is structured so every commerce capability is a small, isolated, replaceable module. This page is the high-level map. Once you have it, every other page in the docs slots in cleanly.Documentation Index
Fetch the complete documentation index at: https://86d.app/docs/llms.txt
Use this file to discover all available pages before exploring further.
Big picture

The monorepo
The 86d source tree is a Bun + Turborepo workspace.86d), and every module (npm packages under @86d-app/*).
The runtime
@86d-app/core is the runtime that all modules link against. It provides:
- Module factory and types. Every module is
(options) => Module. The module returns itsid,version, schema, endpoints, and components. ModuleDataService. The only way modules touch the database. Each module gets a scoped data service injected atinittime. Modules never import@86d-app/dbor any ORM client directly, which is what keeps them swappable and testable.- Contract registry. Modules declare
requiresandexportsfor the data and operations they consume or expose. Cross-module reads happen throughctx.contracts, never direct imports. - Event bus. Domain events (
order.placed,payment.completed,newsletter.subscribed, …) are published by the module that owns them and consumed by anyone who declared interest. - Auth context.
ctx.sessionexposes the Better Auth session for endpoint handlers.
Storefront
The storefront is a Next.js app atapps/store/. Pages are MDX files from your active template. Module components are registered automatically into the MDX component registry, and the storefront’s catch-all /api/[...path] route mounts every module’s public endpoints.
See Storefront.
Admin
The admin lives at/admin in the same Next.js app and uses the same module system. Each module declares which admin sidebar group and subgroup its pages belong to. The sidebar is a two-level structure with nine top-level groups.
See Admin dashboard.
Templates
A template is a folder of MDX, color tokens, and assets. It controls every visible aspect of the storefront. You can swap or customize templates without touching modules; you can swap modules without touching templates. See MDX templates andconfig.json reference.
Data layer
Storage is provided by@86d-app/db (Prisma + PostgreSQL) for relational data, @86d-app/storage for blobs (local filesystem, Vercel Blob, or any S3-compatible bucket), and @86d-app/auth (Better Auth) for sessions, OAuth, and SSO.
- Prisma 7 is the ORM. Schemas live under
packages/db/prisma/. STORE_IDsegments every uploaded file path:stores/{storeId}/{uuid}. This is the foundation of multi-tenancy.
Hosted vs. self-hosted
WhenSTORE_ID and 86D_API_KEY are set, the store fetches its config.json from the 86d hosted API at 86D_API_URL (https://api.86d.app by default) and enables 86d.app SSO for admin authentication. When they are not set, the store reads templates/<theme>/config.json from disk and runs entirely standalone.
The same codebase covers both modes. The presence of those two environment variables decides which path the store takes at boot.
Where to go next
Modules
The contract every feature in 86d follows.
Templates
How MDX templates control your storefront’s look and content.
Storefront
The Next.js app that renders your store.
Admin dashboard
The two-level sidebar and the admin API.
Agentic design
Why 86d is shaped for AI-assisted development.
Glossary
Definitions for every term used in the docs.


