Instant, headless admin panel framework for modern TypeScript backends
Built natively for ElysiaJS and Drizzle ORM β’ Powered by Bun
AdminGen is an instant, ultra-lightweight admin panel framework for modern TypeScript backends, built natively for ElysiaJS and Drizzle ORM.
Point AdminGen at your existing Drizzle database schema, and it will:
- Introspect your tables, foreign keys, and relations.
- Auto-generate secure REST endpoints with pagination, filtering, and sorting in Elysia.
- Serve a dynamic, pre-built React admin panel (TanStack + Shadcn/UI) in under 40MB of RAM.
Most existing CMS solutions (Strapi, Payload, Keystone) are heavy Node.js monoliths that consume 600MB to 1.2GB of RAM per project, creating massive server bills and sluggish cold starts.
AdminGen was engineered from day one on Bun + Elysia + Drizzle to be the fastest, lightest self-hosted admin engine in the JavaScript ecosystem.
| Feature | AdminGen | Payload CMS | Strapi | Directus |
|---|---|---|---|---|
| Runtime | Bun (or Node) | Node.js | Node.js | Node.js |
| Backend Framework | ElysiaJS | Next.js App Router | Koa / Custom | Express |
| Database Engine | Drizzle ORM (SQL First) | Mongoose / Custom | Custom ORM | Knex |
| Idle Memory (RAM) | ~35MB β 50MB | ~600MB β 1.2GB | ~350MB β 600MB | ~180MB β 350MB |
| Cold Boot Time | < 200 ms | 5s β 15s | 4s β 10s | 3s β 8s |
| Frontend Stack | TanStack + Shadcn/UI | Custom React | Custom React | Vue.js |
| Schema Introspection | Zero-Config (Drizzle) | Code Config | Schema Builder | Database Direct |
- β‘ Zero-Config Schema Introspection: Introspects tables, foreign keys, columns, enums, required fields, and read-only attributes directly from your Drizzle schema.
- π Server-Side Operations: Dynamic server-side pagination, sorting, and text search out of the box.
- π Relational Lookups: Automatically resolves foreign keys into relational dropdown selects.
- π¨ Modern Dark UI: Pre-built with TanStack Router, TanStack Query, TanStack Table, and Shadcn/UI.
- πͺΆ Ultra Low Footprint: Runs comfortably in ~40MB RAM. Host 30+ client admin panels on a single $5 VPS.
- π Pluggable Auth: Plug in any authentication provider (JWT, Cookies, Better-Auth, Lucia) with a single interface.
- ποΈ Multi-Database: Supports SQLite, PostgreSQL, and MySQL via Drizzle ORM.
No local installation needed: open the CodeSandbox template and wait for the
workspace dependencies and packages to build. The
example-app starts automatically on port 3000, with a pre-seeded SQLite database.
In the port 3000 preview, open /admin and log in with admin / admin.
CodeSandbox may require you to sign in; VM usage is subject to your account's limits.
Experience AdminGen with pre-seeded data right now:
# 1. Clone the repository
git clone https://github.com/sorvien/admingen.git
cd admingen
# 2. Install dependencies, build the workspace & run the example app
bun install
bun run build
bun devOpen http://localhost:3000/admin in your browser.
Log in with: admin / admin
To create a new AdminGen app with pre-configured schemas and demo data:
bunx create-admingen my-adminIn your Elysia + Drizzle project, install AdminGen and the Drizzle adapter:
bun add @sorvien/admingen@beta @sorvien/admingen-adapter-drizzle@betaEnsure peer dependencies are installed:
bun add elysia drizzle-orm @sinclair/typeboxMount AdminGen into your Elysia server in just 4 lines of code:
import { Elysia } from 'elysia';
import { drizzle } from 'drizzle-orm/bun-sqlite';
import { Database } from 'bun:sqlite';
import * as schema from './schema'; // Your Drizzle schema
import { AdminGen } from '@sorvien/admingen';
import { createDrizzleAdapter } from '@sorvien/admingen-adapter-drizzle';
// 1. Initialize Drizzle with your schema
const db = drizzle(new Database('sqlite.db'), { schema });
// 2. Generate the adapter from your schema
const adapterResult = createDrizzleAdapter({ schema });
// 3. Mount AdminGen plugin
const app = new Elysia()
.decorate('db', db)
.use(AdminGen({ adapterResult, adminPath: '/admin' }))
.listen(3000);
console.log('π¦ Admin panel live at http://localhost:3000/admin');Open http://localhost:3000/admin to manage your data!
Add per-resource lifecycle hooks when you need to transform data or run side effects around writes:
const adapterResult = createDrizzleAdapter({
schema,
config: {
resources: [{
slug: 'users',
hooks: {
beforeChange: async ({ data, operation, id }) => {
return {
...data,
email: data.email?.trim().toLowerCase(),
};
},
afterChange: async ({ record, operation, id }) => {
await invalidateUserCache(record.id);
},
beforeDelete: async ({ id }) => {
return id !== SYSTEM_USER_ID; // return false to cancel deletion
},
afterDelete: async ({ id }) => {
await writeAuditLog({ action: 'user.deleted', id });
},
},
}],
},
});Hooks can be synchronous or asynchronous. Errors thrown by a hook are propagated to the request. A beforeDelete hook can return false to cancel the delete.
Protect your admin dashboard with a custom auth provider:
const authProvider = {
authenticate: async (ctx: any) => {
const token = ctx.cookie?.auth?.value;
if (token === process.env.ADMIN_SECRET) {
return { id: 1, name: 'Admin', email: '[email protected]' };
}
return null; // Redirects to /login
}
};
app.use(AdminGen({
adapterResult,
authProvider
}));AdminGen is structured as a modular Bun monorepo:
admingen/
βββ packages/
β βββ types/ # Shared contracts (AdminField, AdminSchema, AdapterResult)
β βββ adapter-drizzle/ # Drizzle schema introspection engine & CRUD handlers
β βββ ui/ # SPA Admin Panel (TanStack Router + Query + Table + Shadcn)
β βββ admingen/ # Main Elysia plugin serving APIs & bundled SPA assets
βββ example-app/ # Fully functional SQLite demo application
βββ example-app-postgres/ # Advanced PostgreSQL demo application with Docker Compose
AdminGen has a comprehensive automated test suite testing schema introspection, CRUD handlers, and Elysia routing:
bun testLive milestone tracking is available on our GitHub Milestones. See ROADMAP.md for the full architectural vision.
- Monorepo setup (Bun, TypeScript, automated CI)
- Drizzle schema introspection (SQLite, PostgreSQL, MySQL)
- Auto-generated REST CRUD API endpoints in Elysia
- Server-side pagination, sorting, and text filtering
- Dynamic TanStack Table & Sidebar navigation
- Relational foreign key dropdown lookups
- Zero-config schema & auth fallback mode
- v0.2.0: UI Polish & Table UX (Toasts, Cmd+K palette, CSV export, Relative timestamps, Password show/hide, Faceted filters)
- v0.3.0: Extensibility & DB Parity (Lifecycle hooks, Multi-package manager CLI, Composite keys, RBAC permissions)
- v1.0.0: Production Readiness (Dedicated docs hub, Dashboard KPI widgets, S3 uploads)
We warmly welcome community contributions! Whether you're fixing a typo, building a new field widget, or refining UI components, every contribution counts.
- π£ New to the project? Start with our curated Good First Issues.
- π Check out the full Contributing Guide for local development setup, codebase architecture, and PR steps.
- π¬ Have questions or feature ideas? Join the discussion on GitHub Issues.
Huge thanks to everyone who has contributed code, documentation, and ideas to AdminGen!
Want to see your face here? Pick up a Good First Issue and submit a pull request!
If AdminGen saves you time building internal dashboards or you want to support continuous development:
- β Star the repository to help other developers discover the project.
- π¬ Share feedback or feature requests on GitHub Issues.
- β Sponsor on GitHub to support maintenance, hosting benchmarks, and new database adapters.
MIT License Β© 2025 Sorvien Group LLC.