Directus — Open Source Backend & Headless CMS for Any Database
Directus wraps any SQL database with instant REST & GraphQL APIs, an admin app, auth, file storage, and automation — no migration or proprietary schema needed.
这个资产会安全暂存
这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。
npx -y tokrepo@latest install f431a500-349e-11f1-9bc6-00163e2b0d79 --target codex先暂存文件;激活前需要读取暂存 README 和安装计划。
What it is
Directus is an open-source data platform that wraps any SQL database with instant REST and GraphQL APIs, an intuitive admin application, authentication, file storage with transforms, and workflow automation. It works with your existing database schema -- no migration, no proprietary tables, no vendor lock-in. Supported databases include PostgreSQL, MySQL, MariaDB, SQLite, MS SQL, and OracleDB. Built with Vue.js. Released under a BSL license transitioning to GPL-3.0.
Directus targets development teams that want to add a backend and admin panel to an existing database without rewriting the data layer. It is database-first rather than CMS-first.
How it saves time or tokens
Directus generates APIs and admin interfaces from your existing database schema instantly. No backend code to write, no admin panel to build, no CRUD endpoints to maintain. The visual workflow builder (Flows) automates business logic without code. For AI applications, the REST and GraphQL APIs provide immediate structured data access for agents.
How to use
- Scaffold a project with
npx create-directus-project@latest my-project. - Run
npx directus startand access the admin app at localhost:8055. - Connect an existing database or design your schema through the admin UI; APIs are generated automatically.
Example
npx create-directus-project@latest my-project
cd my-project
npx directus start
# Admin app at http://localhost:8055
# Auto-generated REST API
curl http://localhost:8055/items/articles \
-H 'Authorization: Bearer YOUR_TOKEN'
Related on TokRepo
- AI Tools for API -- API generation and management tools
- AI Tools for Database -- Database management platforms
Common pitfalls
- Directus mirrors your database schema exactly; poorly designed schemas produce confusing admin interfaces. Clean up your schema before connecting Directus.
- The Flows automation system runs within Directus; long-running workflows block the Node.js event loop and degrade API performance.
- File storage defaults to local disk; production deployments should configure S3 or compatible object storage for reliability.
常见问题
Yes. This is Directus's core value proposition. Point it at any supported SQL database, and it introspects the schema to generate APIs and an admin interface. Your tables, columns, and relationships remain unchanged. Directus adds its own system tables prefixed with 'directus_' but never modifies your data tables.
Directus is database-first (connects to existing databases), while Strapi creates its own database schema. Directus provides instant APIs from any SQL database without migration. Strapi has a visual content-type builder and larger plugin marketplace. Directus is better for brownfield projects; Strapi is better for greenfield CMS projects.
Yes. Directus provides real-time data subscriptions via WebSockets and GraphQL Subscriptions. Clients can subscribe to changes on any collection and receive live updates when data is created, updated, or deleted.
Flows is a visual workflow builder within Directus. You create trigger-condition-action chains for automation. Triggers include data changes, schedules, and webhooks. Actions include sending emails, calling APIs, running scripts, and modifying data. It replaces simple backend logic without custom code.
Yes. Directus supports custom API endpoints, hooks, and modules through its extension system. Extensions are written in JavaScript/TypeScript and can add custom business logic, integrations, and admin UI panels.
引用来源 (3)
- Directus GitHub— Directus wraps any SQL database with instant REST and GraphQL APIs
- Directus Documentation— Database-first approach with no schema migration required
- GraphQL Official— GraphQL specification for flexible APIs
来源与感谢
- GitHub: directus/directus — 34.7K+ ⭐
- Website: directus.io
讨论
相关资产
NocoDB — Open Source No-Code Database Platform
NocoDB turns any SQL database into a smart spreadsheet with REST APIs. Open-source Airtable alternative with views, automations, and team collaboration.
Strapi — Leading Open Source Headless CMS
Strapi is the most popular open-source headless CMS with 71K+ stars. Visual content-type builder, REST & GraphQL APIs, RBAC, and extensive plugin marketplace.
Budibase — Open Source Low-Code App Builder
Budibase is an open-source low-code platform for building internal tools, admin panels, dashboards, and workflow apps in minutes. Connect any database and deploy instantly.
Webstudio — Open Source Visual Website Builder
Webstudio is an open-source Webflow alternative with a visual drag-and-drop editor, full CSS support, headless CMS integration, and self-hosting on Cloudflare.