Skip to content

WIP: feat: dev command with minimal template and dev server#316

Draft
dswbx wants to merge 2 commits intomainfrom
feat/cli-cmd-dev
Draft

WIP: feat: dev command with minimal template and dev server#316
dswbx wants to merge 2 commits intomainfrom
feat/cli-cmd-dev

Conversation

@dswbx
Copy link
Copy Markdown
Contributor

@dswbx dswbx commented Dec 3, 2025

This PR adds a command (npx bknd dev) which scaffolds/updates a directory for a minimal React SPA with bknd (API and Admin UI). The goal is to expose as little files as possible, specifically targeting LLMs to reduce context overhead.

├── .bknd
├── src
│   ├── App.tsx
│   ├── api.ts (optional)
│   ├── listeners.ts (optional)
│   ├── schema.ts (optional)
│   └── styles.css
└── tsconfig.json

This will configure bknd in code mode, a vite dev server with @cloudflare/vite-plugin, tailwind, and makes it ready to be deployed to cloudflare.

// App.tsx
import "./styles.css";

export default function App() {
   return <div>Hello World</div>;
}
// schema.ts
import { em, entity, text, boolean, number, datetime, json, jsonSchema, enumm } from "bknd";

export default em({
   // todos: entity("todos", {
   //    title: text(),
   //    done: boolean(),
   // }),
});
// api.ts
import { Hono } from "hono";
import type { ServerEnv } from "bknd";

export default new Hono<ServerEnv>().get("/", (c) => {
   // const app = c.var.app;
   // const api = app.getApi();
   return c.json({ message: "Hello, world!" });
});
// listeners.ts
import { AppEvents, DatabaseEvents, type EventManager } from "bknd";

export default function (emgr: EventManager) {
   // emgr.onEvent(AppEvents.AppRequest, async (event) => {
   //    console.log("Request received", event.params.request.url);
   // });
}

Base automatically changed from release/0.20 to main January 9, 2026 13:32
@cameronapak cameronapak changed the title feat: dev command with minimal template and dev server WIP: feat: dev command with minimal template and dev server Feb 28, 2026
@cameronapak cameronapak changed the base branch from main to release/0.21 February 28, 2026 17:39
Base automatically changed from release/0.21 to main March 14, 2026 12:34
@cameronapak cameronapak added the draft Code that's not yet ready for review label Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

draft Code that's not yet ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants