Skip to content

Commit 61e1844

Browse files
committed
feat: add blog post on connecting open-source agents to existing databases and enhance tags with agent and database descriptions
1 parent 869d7bf commit 61e1844

2 files changed

Lines changed: 203 additions & 0 deletions

File tree

  • adminforth/documentation/blog
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
---
2+
slug: open-source-agent-existing-database
3+
title: "Your Database Already Breathes: Connect an Open-Source Agent to It"
4+
authors: ivanb
5+
tags: [agent, database, plugin]
6+
---
7+
8+
<div style={{ position: 'relative', paddingBottom: '56.25%', height: 0, overflow: 'hidden', marginBottom: '2rem' }}>
9+
<iframe
10+
src="https://www.youtube.com/embed/4tB8uzY__uk"
11+
title="AdminForth video demo"
12+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
13+
referrerPolicy="strict-origin-when-cross-origin"
14+
allowFullScreen
15+
style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', border: 0 }}
16+
/>
17+
</div>
18+
19+
Your data is already there.
20+
Your database is already breathing.
21+
But your back office is still buried under weeks of repetitive work.
22+
23+
AdminForth breaks the cage.
24+
25+
It lets you build secure, powerful, agent-ready admin panels on top of your existing database without surrendering your code, your architecture, or your freedom to a closed SaaS.
26+
27+
Not a rented dashboard.
28+
Not another CRUD graveyard.
29+
Not a black box between you and your data.
30+
31+
Your back office. Your rules. Your agents.
32+
33+
<!-- truncate -->
34+
35+
## Agent-first, not agent-themed
36+
37+
The point is not to glue a chatbot onto a table and call it innovation.
38+
39+
The point is to let agents do real work inside a real back office.
40+
41+
Inside AdminForth, agents can search, analyze, explain, mutate, automate, and help operate business data through the same system your team already uses. The [Agent plugin](/docs/tutorial/Plugins/agent/) adds the AI chat surface, persistent sessions in your own database, and the ability to extend the system with custom skills.
42+
43+
Because the system stays yours, the agent stays grounded in your rules:
44+
45+
- your schema
46+
- your permissions
47+
- your audit trail
48+
- your deployment
49+
- your custom logic
50+
51+
That matters. Useful AI in operations is not decoration. It is constrained power.
52+
53+
## Open source and fully yours
54+
55+
No vendor lock.
56+
No hidden control plane.
57+
No rented future.
58+
59+
AdminForth gives you a strong foundation, but the system remains yours: your code, your database, your infrastructure, your deployment pipeline, your custom pages, your Vue components, your npm packages, your actions, your dashboards.
60+
61+
AdminForth is not here to limit your architecture.
62+
It is here to become part of it.
63+
64+
## Built for serious systems
65+
66+
Sooner or later, every internal tool grows teeth. That is when throwaway admin panels start collapsing under the weight of reality.
67+
68+
AdminForth starts where serious systems usually end up:
69+
70+
- authentication and authorization
71+
- roles and access control
72+
- audit logs
73+
- file uploads
74+
- background jobs
75+
- imports and exports
76+
- Markdown and rich text editors
77+
- AI completion and AI automation
78+
- developer-native Vue 3 customization
79+
80+
And around that core sits a growing plugin arsenal for real operations: Agent, Two-Factor Authentication, Foreign Inline List, Foreign Inline Show, Audit Log, Upload, Markdown, Rich Editor, Email Password Reset, Email Invite, Import Export, Open Signup, i18n, OAuth Authentication, Inline Create, List In-Place Edit, Text Complete, Bulk AI Flow, Universal Search, Quick Filters, Login Captcha, User Soft Delete, Clone Row, Many2Many, Background Jobs, and Auto Remove.
81+
82+
## A short path from existing database to working back office
83+
84+
If you already have a local-running database you can point AdminForth at, you can have a working back office in minutes.
85+
86+
87+
### No database yet or you don't trust yours yet?
88+
89+
Then do not stop here. Ask your coding agent to run this prompt:
90+
91+
- [Create PG with orders prompt](https://gist.github.com/ivictbor/077c2442ce03ece5fd1a092752eabbff)
92+
93+
That prompt brings up a minimal Postgres instance in Docker Compose on port `54322`, creates an `orders` table, fills it with 1000 random rows, and verifies the result with `psql`.
94+
95+
After that, come back and point `create-app` at it.
96+
97+
98+
## Creating app
99+
100+
Here is a small example with an existing Postgres database that already contains an `orders` table:
101+
102+
```bash
103+
npx adminforth create-app --app-name orders-backoffice --db "postgresql://pg:1@localhost:54322/app"
104+
cd orders-backoffice
105+
```
106+
107+
This command scaffolds the app, installs dependencies, writes the base AdminForth files, creates the default `adminuser` resource config, adds environment files, ships Dockerfile and agent-facing docs hints such as `AGENTS.md`, and points the project at your existing database URL.
108+
109+
If you omit the flags and run just `npx adminforth create-app`, the CLI asks for:
110+
111+
- app name
112+
- database URL
113+
- package manager
114+
- whether to include Prisma migrations
115+
116+
In this repo and in AdminForth examples we use `pnpm`, so choose `pnpm` when prompted.
117+
118+
For this article's flow, choose `No` when the CLI asks `Include Prisma migrations? >`. The reason is simple: you already have an existing database URL and you already manage schema changes yourself, so this back office should attach to that database instead of introducing a second migration flow.
119+
120+
The important part in this article is the flow: your database already exists, and you keep managing its schema with the migration tool or process you already trust.
121+
122+
If you are starting from a brand-new empty database with no existing schema and no business data yet, the Prisma-backed getting-started flow is usually the better fit. It is useful when you want AdminForth to help bootstrap a fresh back office from zero. This post is about the opposite case: an existing database that already matters.
123+
124+
## If you use an existing DB, create `adminuser` yourself
125+
126+
This is the one part people often skip on the first pass.
127+
128+
`create-app` gives you the `adminuser` resource configuration, but the matching `adminuser` table still has to exist in your database, created by your own schema-management process.
129+
130+
At minimum it should contain:
131+
132+
```text
133+
adminuser
134+
- id - string
135+
- email - unique string
136+
- password_hash - string
137+
- role - string
138+
- created_at - datetime
139+
```
140+
141+
Once that table exists, the generated app can seed the first admin account automatically on startup when the table is empty. That is what turns the door handle. Without it, there is no one to log in as.
142+
143+
## Import your `orders` resource
144+
145+
Now import the business table you actually care about:
146+
147+
```bash
148+
npx adminforth resource
149+
```
150+
151+
Choose `maindb.orders` in the interactive search.
152+
153+
The command discovers the table columns, generates `resources/orders.ts`, and injects the new resource into `index.ts` for you. From there you already have a working operational surface over your existing data, and you can refine labels, permissions, record presentation, or custom views later.
154+
155+
## Then let the agent in
156+
157+
The Agent plugin is practical, but it is not magic. It needs its own persistence layer for chat sessions and turns.
158+
159+
In AdminForth terms, that means creating and registering `sessions` and `turns` tables/resources, attaching `@adminforth/agent`, and configuring a completion adapter such as `@adminforth/completion-adapter-openai-responses` together with your `OPENAI_API_KEY`.
160+
161+
If you are using a coding agent, give it this short prompt:
162+
163+
```text
164+
Add the AdminForth Agent plugin to this app, create the required sessions and turns tables/resources for it to work using this project's existing schema-management flow, register them, attach the plugin to adminuser, and add the needed env vars.
165+
```
166+
167+
That is enough context for a strong coding agent to wire the plugin in correctly while staying inside the AdminForth contract.
168+
169+
170+
171+
## Who this is for
172+
173+
For individuals and small teams: ship before others finish planning. AdminForth gives small teams a serious back-office foundation without losing weeks to boilerplate.
174+
175+
For professionals and larger teams: when operations grow, chaos grows with them. AdminForth gives teams a controlled, extensible system for data, users, permissions, workflows, automation, and audit trails without forcing the company into someone else's platform.
176+
177+
For agent-native products: your product already has data, your team already has questions, and your users already need actions. AdminForth gives agents a safe, structured place to work with real back-office data.
178+
179+
## Why teams keep it
180+
181+
Move faster. Skip the admin panel grind and start from a serious foundation.
182+
183+
Stay in control. Your code. Your database. Your infrastructure. Your rules.
184+
185+
Unlock AI automation. Bring agents into the back office where they can actually save time: searching, analyzing, filling, translating, generating, and helping operate your data.
186+
187+
Scale without chaos. Roles, permissions, audit logs, background jobs, filters, uploads, and custom workflows keep the system understandable when the company gets larger.
188+
189+
Build without compromise. Open-source power. No vendor lock. No black boxes. No surrender.
190+
191+
Your data is already there.
192+
193+
Now give it a back office that can work.

adminforth/documentation/blog/tags.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,13 @@ MCP:
7777
label: MCP
7878
permalink: /mcp
7979
description: Model Context Protocol is a standard way for tools and assistants to connect to external capabilities and data sources.
80+
81+
agent:
82+
label: Agent
83+
permalink: /agent
84+
description: Agent workflows combine LLMs, tools, and application context to perform useful work inside software systems.
85+
86+
database:
87+
label: Database
88+
permalink: /database
89+
description: Databases store the business data that AdminForth exposes through resources, permissions, workflows, and agent tooling.

0 commit comments

Comments
 (0)