Skip to content

Commit 680a090

Browse files
authored
Merge pull request #96 from better-stack-ai/feat/media-plugin-client
feat: media plugin client
2 parents d1305a1 + 453a25e commit 680a090

76 files changed

Lines changed: 4628 additions & 574 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ Plugin UI pages are distributed as a shadcn v4 registry so consumers can eject a
748748
### Key design rules
749749

750750
- **Hooks are excluded** from the registry. Components import hooks from `@btst/stack/plugins/{name}/client/hooks`. Only the view layer is ejectable.
751+
- **Routable plugin pages should be wired back in via `pageComponents`** on the client plugin config when the plugin supports page overrides. If a plugin intentionally does not support `pageComponents`, document the direct-import rendering pattern clearly in the plugin docs and shared shadcn registry guide.
751752
- **`@workspace/ui` imports are rewritten**: standard shadcn components`registryDependencies`; custom components (`page-wrapper`, `empty`, etc.) → embedded as `registry:component` files from `packages/ui/src/`; multi-file components (`auto-form`, `minimal-tiptap`, `ui-builder`) → external registry URL in `registryDependencies`.
752753
- **Directory structure is preserved**: source files land at `src/components/btst/{name}/client/{relative}` so all relative imports remain valid with no rewriting.
753754
- **`EXTERNAL_REGISTRY_COMPONENTS`** in `build-registry.ts` maps directory-based workspace/ui components to their external registry URLs.

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,8 @@ npx shadcn@latest add "https://raw.githubusercontent.com/better-stack-ai/better-
792792

793793
Files are installed into `src/components/btst/{plugin}/client/` with all relative imports preserved. Data-fetching hooks remain in `@btst/stack`.
794794

795+
When a plugin exposes `pageComponents` on its client config, wire the ejected routable pages back in through that option. If a plugin intentionally does not support `pageComponents`, document the direct-import rendering pattern clearly in the plugin docs and the shared shadcn registry guide.
796+
795797
### Rebuild the registry locally
796798

797799
```bash

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Enable the features you need and keep building your product.
3737
| **Form Builder** | Dynamic form builder with drag-and-drop editor, submissions, and validation |
3838
| **UI Builder** | Visual drag-and-drop page builder with component registry and public rendering |
3939
| **Kanban** | Project management with boards, columns, tasks, drag-and-drop, and priority levels |
40+
| **Media** | Media library with uploads, folders, picker UI, URL registration, and reusable image inputs |
4041
| **OpenAPI** | Auto-generated API documentation with interactive Scalar UI |
4142
| **Route Docs** | Auto-generated client route documentation with interactive navigation |
4243
| **Better Auth UI** | Beautiful shadcn/ui authentication components for better-auth |
@@ -121,8 +122,8 @@ Supports Prisma, Drizzle, MongoDB and Kysely SQL dialects.
121122
Each plugin's UI layer is available as a [shadcn registry](https://ui.shadcn.com/docs/registry) block. Use it to **eject and fully customize** the page components while keeping all data-fetching and API logic from `@btst/stack`:
122123
123124
```bash
124-
# Install a single plugin's UI
125-
npx shadcn@latest add https://github.com/better-stack-ai/better-stack/blob/main/packages/stack/registry/btst-blog.json
125+
# Install a single plugin's UI (for example, Media)
126+
npx shadcn@latest add https://github.com/better-stack-ai/better-stack/blob/main/packages/stack/registry/btst-media.json
126127
127128
# Or install the full collection
128129
npx shadcn@latest add https://github.com/better-stack-ai/better-stack/blob/main/packages/stack/registry/registry.json

docs/assets/media-demo-1.png

104 KB
Loading

docs/content/docs/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"plugins/ui-builder",
1919
"plugins/kanban",
2020
"plugins/comments",
21+
"plugins/media",
2122
"plugins/open-api",
2223
"plugins/route-docs",
2324
"plugins/better-auth-ui",

docs/content/docs/plugins/index.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Available plugins and features for BTST
44
---
55

66
import { Card, Cards } from "fumadocs-ui/components/card";
7-
import { BookOpen, Database, Hammer, Bot, Shield, FileText, FileCode, Route, Layout, Columns3 } from "lucide-react";
7+
import { BookOpen, Database, Hammer, Bot, Shield, FileText, FileCode, Route, Layout, Columns3, MessageSquare, ImageIcon } from "lucide-react";
88

99

1010
BTST provides a collection of full-stack plugins that you can easily integrate into your React application. Each plugin includes routes, APIs, database schemas, components, and hooks—everything you need to add complete features to your app.
@@ -48,6 +48,18 @@ With more plugins coming soon, you can add complete features to your app in minu
4848
icon={<Columns3 size={20} />}
4949
description="Project management with boards, columns, tasks, drag-and-drop, and priority levels."
5050
/>
51+
<Card
52+
title="Comments Plugin"
53+
href="/plugins/comments"
54+
icon={<MessageSquare size={20} />}
55+
description="Threaded comments with moderation, likes, replies, and embeddable comment threads."
56+
/>
57+
<Card
58+
title="Media Plugin"
59+
href="/plugins/media"
60+
icon={<ImageIcon size={20} />}
61+
description="Media library with uploads, folders, picker UI, URL registration, and reusable image inputs."
62+
/>
5163
<Card
5264
title="OpenAPI Plugin"
5365
href="/plugins/open-api"

0 commit comments

Comments
 (0)