API Reference
Registry, tokens, templates, and the light-cycle leaderboard — plus machine-readable catalogs for agents.
API reference
The Gridcn exposes a small public HTTP surface: the shadcn component registry, themed registry payloads, template source, a component search helper, and the light-cycle game leaderboard.
Machine-readable entry points:
- OpenAPI 3.1:
/openapi.json - RFC 9727 catalog:
/.well-known/api-catalog - Health:
/api/health
Send Accept: text/markdown on HTML pages to get a markdown representation.
shadcn registry
Canonical item JSON used by the CLI:
GET https://thegridcn.com/r/{name}.jsonRegister once in components.json:
{
"registries": {
"@thegridcn": "https://thegridcn.com/r/{name}.json"
}
}Then:
npx shadcn@latest add @thegridcn/radix-vega
npx shadcn@latest add @thegridcn/radarradix-vega and base-vega are registry:base presets that set components.json style to Radix or Base UI (Vega / New York). Theme CSS and HUD items work with either; copied ui/ components still ship Radix source.
Themed payload (merges theme CSS into the registry item):
GET https://thegridcn.com/api/registry/{name}?theme=tron&intensity=mediumQuery parameters:
| Name | Values | Default |
|---|---|---|
theme |
tron, ares, clu, athena, aphrodite, poseidon |
tron |
intensity |
none, light, medium, heavy |
medium |
Use {name}=styles to fetch CSS only.
See the install guide for CLI walkthroughs, tokens, and Three.js SSR notes.
Component catalog
GET https://thegridcn.com/api/components
GET https://thegridcn.com/api/components?q=hudReturns { "components": [{ "id", "name", "title", "type", "section" }] } from the showcase list.
Template source
GET https://thegridcn.com/api/template-source/{slug}Valid slugs: dashboard, landing, blog, login, analytics.
Design tokens
Static files, not under /api:
https://thegridcn.com/tokens/index.jsonhttps://thegridcn.com/tokens/{theme}.csshttps://thegridcn.com/tokens/{theme}.json
Light-cycle leaderboard
Read scores:
GET https://thegridcn.com/api/leaderboard?difficulty=mediumSubmit a score (requires a one-time session):
POST /api/leaderboard/sessionwith{ "difficulty": "medium" }→{ "token" }.POST /api/leaderboardwith{ "alias", "difficulty", "time", "token" }and optionalcharacter.
alias must be three uppercase letters. Invalid, reused, or too-fast sessions return 403. Unconfigured Redis returns 503.