Package Exports
- @blackwaves/admingen-adapter-drizzle
Readme
π AdminGen by Black Waves
An instant, "headless" admin panel for modern JavaScript backends, built on ElysiaJS and Drizzle ORM.
This framework introspects your Drizzle schema, auto-generates a secure API, and provides a dynamic, pre-built React UI to manage your data.
Note: A 15-second GIF showing the final, working admin panel is the perfect demo to add here.
β¨ Core Features
- Zero-Config API: Automatically generates a full REST API from your existing Drizzle schema.
- Dynamic UI: The React frontend (built with TanStack) dynamically renders tables, filters, and sorting based on your API schema.
- Plug-and-Play: Add it to your existing Elysia server in just a few lines of code.
- Modern Stack: Built on the fastest, most modern tools: Bun, Elysia, and Drizzle.
- Open Source: MIT-licensed, built in public by @blackwaves.
β‘ Tech Stack
- Runtime: Bun
- Backend: ElysiaJS
- ORM: Drizzle ORM
- Frontend: Vite + React
- UI/State: TanStack (Router, Query, Table, Form)
- Styling: Shadcn/UI
π¦ Status: Beta
This project is currently in beta. The core read-only functionality (List, Get, Filter, Sort) is complete, tested, and published to npm.
We are actively working on Create, Update, and Delete operations.
π Quick Start
Get your admin panel running in 3 minutes.
1. Installation
In your existing Elysia + Drizzle project, install the core framework, the Drizzle adapter, and all required peer dependencies.
# Install the core framework and the Drizzle adapter
bun add @blackwaves/admingen@beta @blackwaves/admingen-adapter-drizzle@beta
# Install required peer dependencies
bun add elysia drizzle-orm @sinclair/typebox
### 2. Usage
Add the following to your main Elysia server file (e.g., `src/index.ts`):
```ts
import { Elysia } from 'elysia';
import { drizzle } from 'drizzle-orm/bun-sqlite';
import { Database } from 'bun:sqlite';
import * as schema from './src/schema'; // Your Drizzle schema
import { AdminGen } from '@blackwaves/admingen';
import { createDrizzleAdapter } from '@blackwaves/admingen-adapter-drizzle';
// Set up Drizzle with Bun SQLite
const sqlite = new Database('sqlite.db');
const db = drizzle(sqlite, { schema });
// Create the adapter for AdminGen
const adapterResult = createDrizzleAdapter({ schema });
const app = new Elysia()
// Make the db instance available in the Elysia context for plugins/adapters
.decorate('db', db)
.use(
AdminGen({
adapterResult,
adminPath: '/admin', // Optional: customize your admin URL prefix
})
)
.listen(3000);
console.log('π¦ Admin panel running at http://localhost:3000/admin');3. Run It!
Follow these steps to launch your admin panel:
# (Optional) Prepare your database tables using Drizzle
bunx drizzle-kit generate
# Start the development server
bun run dev3. Launch the Admin Panel
Open your browser and navigate to http://localhost:3000/admin
You should now see your full admin panel, displaying all data from your Drizzle database tables.
π£οΈ Roadmap
We are building this in publicβfollow our progress!
- Core: Monorepo Setup (Bun, TSC, Vitest)
- Adapter: Drizzle Schema Introspection
- API: Auto-generation of API routes in Elysia
- UI: Dynamic Sidebar Generation
- UI: Dynamic Table View (List/Get)
- UI: Filtering & Sorting
- Build: Automated publishing pipeline to npm
- API/UI: Create Functionality (In Progress)
- API/UI: Update Functionality
- API/UI: Delete Functionality
- Auth: Simple beforeHandle authentication hooks
π€ Contributing
We welcome all contributions!
Feel free to open a GitHub issue to report a bug, request a feature, or submit a pull request.
π License
This project is licensed under the MIT License.
Copyright (c) 2025 Black Waves.