directus
The flexible backend for all your projects π° Turn your DB into a headless CMS, admin panels, or apps with a custom UI, instant APIs, auth & more.
Top Related Projects
π Strapi is the leading open-source headless CMS. Itβs 100% JavaScript/TypeScript, fully customizable, and developer-first.
The superpowered headless CMS for Node.js β built with GraphQL and React
π₯ π₯ π₯ Open Source Airtable Alternative
Open Source realtime backend in 1 file
The open source Firebase alternative. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
Your backend, minus the hassle.
Quick Overview
Directus is an open-source headless CMS and API platform that provides a flexible and customizable backend for managing content and data. It offers a user-friendly interface for content management while allowing developers to build powerful APIs and integrate with various front-end technologies.
Pros
- Highly customizable and extensible
- Supports multiple database types (MySQL, PostgreSQL, SQLite, etc.)
- Built-in REST and GraphQL APIs
- User-friendly interface for non-technical users
Cons
- Steeper learning curve compared to traditional CMSs
- Limited built-in themes and templates
- Requires more initial setup and configuration
- May be overkill for simple projects
Getting Started
To get started with Directus, follow these steps:
- Install Directus using npm:
npm init directus-project my-project
cd my-project
- Start the Directus server:
npx directus start
-
Access the admin panel by navigating to
http://localhost:8055
in your browser. -
Create your first collection and start managing content through the admin interface.
-
Use the auto-generated API endpoints to retrieve and manipulate data in your application:
// Example: Fetching items from a collection
const response = await fetch('http://localhost:8055/items/your_collection');
const data = await response.json();
console.log(data);
For more detailed instructions and advanced usage, refer to the official Directus documentation.
Competitor Comparisons
π Strapi is the leading open-source headless CMS. Itβs 100% JavaScript/TypeScript, fully customizable, and developer-first.
Pros of Strapi
- More extensive plugin ecosystem and marketplace
- Better support for GraphQL out of the box
- Larger and more active community, potentially leading to faster issue resolution
Cons of Strapi
- Steeper learning curve, especially for beginners
- Less flexible content modeling compared to Directus
- Higher resource consumption, which may impact performance on smaller servers
Code Comparison
Strapi (Content Type Definition):
module.exports = {
attributes: {
title: {
type: 'string',
required: true,
},
content: {
type: 'richtext',
},
},
};
Directus (Collection Schema):
{
"fields": [
{
"field": "title",
"type": "string",
"meta": {
"required": true
}
},
{
"field": "content",
"type": "text"
}
]
}
Both Strapi and Directus are powerful headless CMS options, each with its own strengths. Strapi offers a rich plugin ecosystem and strong GraphQL support, making it suitable for complex projects with specific requirements. Directus, on the other hand, provides a more intuitive interface and flexible content modeling, which can be advantageous for projects that need adaptability. The choice between the two often depends on the specific needs of the project and the development team's preferences.
The superpowered headless CMS for Node.js β built with GraphQL and React
Pros of Keystone
- More flexible and customizable, allowing developers to build complex data models and relationships
- Better suited for developers who prefer a code-first approach to content management
- Offers a GraphQL API out of the box, which can be advantageous for modern web applications
Cons of Keystone
- Steeper learning curve, especially for non-technical users or those new to Node.js ecosystems
- Less comprehensive admin UI compared to Directus, which may require more custom development
- Smaller community and ecosystem, potentially leading to fewer resources and third-party integrations
Code Comparison
Keystone schema definition:
const { Text, Relationship } = require('@keystonejs/fields');
const listSchema = {
fields: {
title: { type: Text },
author: { type: Relationship, ref: 'User' },
},
};
Directus schema definition:
{
"collections": {
"articles": {
"fields": {
"title": { "type": "string" },
"author": { "type": "m2o", "related_collection": "users" }
}
}
}
}
Both Keystone and Directus offer powerful content management capabilities, but they cater to different user needs and preferences. Keystone provides more flexibility and control for developers, while Directus offers a more user-friendly interface and easier setup for non-technical users.
π₯ π₯ π₯ Open Source Airtable Alternative
Pros of NocoDB
- More lightweight and faster to set up, especially for simple projects
- Offers a spreadsheet-like interface, making it more intuitive for non-technical users
- Provides built-in support for multiple databases, including MySQL, PostgreSQL, and SQLite
Cons of NocoDB
- Less extensive customization options compared to Directus
- Smaller community and ecosystem, potentially leading to fewer resources and third-party integrations
- Limited built-in authentication and access control features
Code Comparison
NocoDB example (creating a table):
await api.base.tableCreate(baseId, {
table_name: 'Customers',
columns: [
{ column_name: 'Name', uidt: UITypes.SingleLineText },
{ column_name: 'Email', uidt: UITypes.Email }
]
});
Directus example (creating a collection):
await directus.collections.createOne({
collection: 'customers',
fields: [
{ field: 'name', type: 'string' },
{ field: 'email', type: 'string' }
]
});
Both NocoDB and Directus are open-source database tools, but they cater to slightly different use cases. NocoDB focuses on providing a user-friendly, spreadsheet-like interface for database management, while Directus offers a more comprehensive headless CMS solution with extensive customization options.
Open Source realtime backend in 1 file
Pros of PocketBase
- Lightweight and portable: Single executable with embedded database
- Simpler setup and configuration process
- Built-in realtime subscriptions and file storage
Cons of PocketBase
- Less extensive customization options
- Smaller community and ecosystem
- Limited built-in authentication providers
Code Comparison
PocketBase (Go):
package main
import "github.com/pocketbase/pocketbase"
func main() {
app := pocketbase.New()
app.Start()
}
Directus (JavaScript):
const { Directus } = require('@directus/sdk');
const directus = new Directus('https://api.example.com');
async function init() {
await directus.auth.login({ email, password });
}
PocketBase offers a more straightforward setup with a single executable, while Directus provides a more extensive API and customization options. PocketBase's Go-based backend may offer performance advantages, but Directus' JavaScript ecosystem allows for easier integration with web technologies. PocketBase includes built-in realtime subscriptions, whereas Directus requires additional setup for similar functionality. Directus has a larger community and more extensive documentation, which can be beneficial for complex projects. Both platforms offer REST and GraphQL APIs, but Directus provides more advanced access control and workflow options out of the box.
The open source Firebase alternative. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
Pros of Supabase
- More comprehensive backend-as-a-service offering, including authentication, storage, and real-time subscriptions
- Stronger focus on developer experience with extensive documentation and easy-to-use client libraries
- Built-in support for PostgreSQL, offering powerful database features out of the box
Cons of Supabase
- Less flexible in terms of customization compared to Directus' modular approach
- Steeper learning curve for developers not familiar with PostgreSQL
- Limited options for self-hosting and on-premises deployment
Code Comparison
Supabase (JavaScript):
const { data, error } = await supabase
.from('users')
.select('name, email')
.eq('id', 123)
Directus (JavaScript):
const response = await directus.items('users').readOne(123, {
fields: ['name', 'email']
});
Both repositories provide backend solutions, but Supabase offers a more comprehensive platform with built-in features like authentication and real-time subscriptions. Directus, on the other hand, focuses on content management and provides more flexibility for customization. Supabase's code tends to be more concise due to its specialized client libraries, while Directus offers a more generic API approach. The choice between the two depends on specific project requirements and developer preferences.
Your backend, minus the hassle.
Pros of Appwrite
- More comprehensive backend-as-a-service offering, including authentication, databases, storage, and serverless functions
- Stronger focus on real-time capabilities and WebSocket support
- Better suited for mobile and web app development with dedicated SDKs
Cons of Appwrite
- Less flexible data modeling compared to Directus's content-first approach
- More complex setup and configuration process
- Limited customization options for the admin panel
Code Comparison
Appwrite (JavaScript SDK):
const sdk = new Appwrite();
sdk
.setEndpoint('https://[HOSTNAME_OR_IP]/v1')
.setProject('[PROJECT_ID]');
const account = sdk.account;
const user = await account.create('[USER_ID]', 'email@example.com', 'password');
Directus (JavaScript SDK):
const directus = new Directus('https://example.directus.app');
await directus.auth.login({
email: 'admin@example.com',
password: 'password'
});
const newItem = await directus.items('articles').createOne({
title: 'My New Article',
content: 'This is the article content.'
});
Both Appwrite and Directus offer powerful backend solutions, but they cater to different use cases. Appwrite provides a more comprehensive backend-as-a-service platform, while Directus excels in content management and API creation. The choice between the two depends on the specific requirements of your project and development preferences.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Γ°ΒΒΒ° Introduction
Directus is a real-time API and App dashboard for managing SQL database content.
- Open Source. No artificial limitations, vendor lock-in, or hidden paywalls.
- REST & GraphQL API. Instantly layers a blazingly fast Node.js API on top of any SQL database.
- Manage Pure SQL. Works with new or existing SQL databases, no migration required.
- Choose your Database. Supports PostgreSQL, MySQL, SQLite, OracleDB, CockroachDB, MariaDB, and MS-SQL.
- On-Prem or Cloud. Run locally, install on-premises, or use our self-service Cloud service.
- Completely Extensible. Built to white-label, it is easy to customize our modular platform.
- A Modern Dashboard. Our no-code Vue.js app is safe and intuitive for non-technical users, no training required.
Learn more about Directus Γ’ΒΒ’ Documentation
Γ°ΒΒΒ Directus Cloud
Directus Cloud allows you to create projects, hosted by the Directus team, from $15/month.
- A self-service dashboard to create and monitor all your projects in one place.
- Everything you need: Directus, database, storage, auto-scaling, and a global CDN.
- Select your desired region and provision a new project in ~90 seconds.
Create a Directus Cloud Project
ð€ Community Help
The Directus Documentation is a great place to start, or explore these other channels:
- Discord (Questions, Live Discussions)
- GitHub Issues (Report Bugs)
- GitHub Discussions (Feature Requests)
- Twitter (Latest News)
- YouTube (Video Tutorials)
Γ’Β€ï¸ Contributing & Sponsoring
Please read our Contributing Guide before submitting Pull Requests.
All security vulnerabilities should be reported in accordance with our Security Policy.
Directus is a premium open-source (BSL 1.1) project, made possible with support from our passionate core team, talented contributors, and amazing GitHub Sponsors. Thank you all!!
ΓΒ© 2004-2024, Monospace, Inc.
Top Related Projects
π Strapi is the leading open-source headless CMS. Itβs 100% JavaScript/TypeScript, fully customizable, and developer-first.
The superpowered headless CMS for Node.js β built with GraphQL and React
π₯ π₯ π₯ Open Source Airtable Alternative
Open Source realtime backend in 1 file
The open source Firebase alternative. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
Your backend, minus the hassle.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot