Skip to content

Latest commit

 

History

History
132 lines (88 loc) · 5.73 KB

File metadata and controls

132 lines (88 loc) · 5.73 KB
studio

The Lunora Studio: a local admin UI for your schema, data, logs, and advisors


typescript-image FSL-1.1-Apache-2.0 licence npm version npm downloads PRs Welcome


Daniel Bannert's open source work is supported by the community on GitHub Sponsors


A local admin console for a Lunora backend: browse and edit data, run functions, read logs, inspect the schema, and review advisors. It ships as a React component library, so you can mount the whole console (mountStudio / <StudioApp>), drop in the <Studio> shell, or compose individual panels behind a <LunoraProvider>. In lunora dev, @lunora/vite serves it at /__lunora with no config.

Part of the Lunora framework — a type-safe, real-time backend on Cloudflare Workers + Durable Objects with a Vite-first DX.

Install

npm install @lunora/studio
yarn add @lunora/studio
pnpm add @lunora/studio

Usage

During lunora dev the studio is already served at /__lunora by @lunora/vite — install this package and it shows up with no extra wiring. To host it yourself, mount the batteries-included console into a <div id="root">:

import { mountStudio } from "@lunora/studio/mount";

const root = mountStudio({ baseUrl: "https://my-app.workers.dev" });
// root.unmount() to tear it down

mountStudio constructs a LunoraClient, manages the admin token, and renders the whole console. To embed in your own React tree, render <StudioApp> (same self-contained shell) or compose <Studio> and the individual panels under a <LunoraProvider>:

import { LunoraClient } from "@lunora/client";
import { LunoraProvider } from "@lunora/react";
import { Studio } from "@lunora/studio";

const client = new LunoraClient({ url: "https://my-app.workers.dev" });

// `functions` populate the runner + API tabs; `kind` is a compile-time
// phantom, so it must be named here.
const functions = [
    { kind: "query", path: "messages:list" },
    { kind: "mutation", path: "messages:send" },
];

<LunoraProvider client={client}>
    <Studio dataEditable functions={functions} />
</LunoraProvider>;

Both surfaces are read-only until you opt in: pass dataEditable to allow row insert/edit/delete, and runAsIdentity to let the runner execute as a chosen identity (loopback-dev only — it forges identity on an admin RPC). Every admin surface stays disabled unless the worker sets LUNORA_ADMIN_TOKEN and the client presents a matching Authorization: Bearer token.

This README covers the basics. For the full API, options, and guides, see the documentation.

Related

  • @lunora/react — the <LunoraProvider> and hooks the panels render under.
  • @lunora/vite — serves the studio at /__lunora during lunora dev.
  • @lunora/advisor — supplies the findings the Advisors view renders.

Supported Node.js Versions

Libraries in this ecosystem make the best effort to track Node.js' release schedule. Here's a post on why we think this is important.

Contributing

If you would like to help take a look at the list of issues and check our Contributing guidelines.

Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Credits

Made with ❤️ at Anolilab

This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. Anolilab is a Development and AI Studio. Contact us at hello@anolilab.com if you need any help with these technologies or just want to say hi!

License

The Lunora studio package is open-sourced software licensed under the FSL-1.1-Apache-2.0.