Our updated multi-tenant login page with API selection

Introducing Directus 7

Ben Haynes
Directus
Published in
8 min readJul 23, 2018

--

After a full year of strategy, design, development, and documentation—today, our team is proud to officially announce the release of Directus 7 (Beta).

Our last major release was way back in 2011, so let’s start by quickly covering the main reason behind this substantial refactor.

While powerful, Directus 6 had a steep learning curve that hindered both internal development and external contributions. That made it difficult for our small team to keep the project moving forward while trying to resolve the small bugs scattered throughout the codebase.

Consequently, our primary goal with Directus 7 has been to eliminate any learning curve that might cause a barrier-to-entry for new developers.

We’re quite happy with the results—and hope you are too!

Before we get started, it’s important to note that Directus 7 is a major release that significantly differs from previous versions. With such fundamental changes, we made the decision to prioritize doing things the right way over an easier upgrade process. That said, Directus stores all its system data separate from your content, so your data always remains pure, transparent, and portable between versions.

Decoupled App & API

The biggest change in Directus 7 is that the codebase has been split into two separate repositories: App and API. This decoupling has several advantages:

Multitenancy

The feature most requested by our community: you can now use a single Directus App to manage multiple Directus API instances. Furthermore, you don’t even need to install the App — instead you can use https://directus.app.

Separation of Concerns

The Directus App (front-end GUI) and Directus API (back-end server) now each have their own dedicated repository. This helps decrease complexity and the learning curve since GitHub tickets, Documentation, and of course, the codebase have been halved. If you’re looking for the “complete” framework you will still be able to access the build version in our main Directus repo.

Versionless API

Decoupling also allows each product to maintain its own version—Directus App 7.0 and Directus API Next (technically v2.0). This is quite important because our new API is versionless. Being “versionless” means that we will only add functionality—never deprecating or altering. Forever backwards compatible, now you can always safely upgrade API instances without fear of breaking your project.

App Refactor in Vue.js

Backbone.js has treated us well for the past 7 years, however its complexity created a significant barrier-to-entry for new Directus engineers. We knew decoupling meant rebuilding our App from the ground-up, and so Vue.js was selected as the ideal front-end framework replacement. It’s blazingly fast, flexible, well-documented, easy to understand, and its single-page-components keep everything organized. In short, it makes extending and contributing to Directus absurdly easy.

Notable Enhancements

Saying that we’ve added a few new features in Directus 7 would be a huge understatement. Here’s an A-to-Z of our most significant updates:

API Next

Let’s start this list off with a biggie! We’ve gone over every endpoint, parameter, and response to make sure things are as close to perfect as possible. Lots of updates here — check out our API Reference for details.

Better Filtering

The Directus App now allows filtering using our full list of operators and the API supports AND/OR grouping combinations.

Custom Workflows

The sky’s the limit with our new custom workflow option. With permissions based on Item status and the ability to blacklist statuses, you can create any authoring flow that your project demands. Possibilities include: linear, sequential, fluid, rigid, or even automatic.

Dot Notation

Fetching relational data has never been easier thanks to our new dot notation syntax with wildcards. Now you can optimize queries by selecting specific fields to return. eg: fields=*.*,images.thumbnails.* (Get all top level fields and one level deep, as well as three levels deep within images.thumbnails).

Explanations

We’ve added a new comment permission called “explain.” If enabled, it requires users to leave a message about the changes they’ve made to items. Think of it like git commit messages… for content.

Field Groups

Organize fields into groups on the Item detail page. Soon you’ll be able to keep longer sections of your edit forms closed and only accordion them open as needed.

Grid Layout

With grid layout for fields, you can finally display First Name and Last Name beside each other, organize related address fields, and save space when displaying a large number of smaller fields like toggles.

Helpful Tooltips

Despite being one of the most intuitive platforms available, new users may still be curious about certain App components. We’ve added a standardized tooltip system so users can easily learn more without having to open the Docs.

Internationalization

It is finally possible to translate Collection and Field names! This means that you can create custom naming without having to change the database schema. Even Extensions are now multilingual, so every aspect of Directus will update based on your locale settings.

JSON, CSV, & Other New Datatypes

It’s important for the API to return data in very specific ways, so we’ve introduced several new datatypes to deliver better responses. This master set of datatypes also takes us one step closer to supporting other SQL vendors.

Keys

Speaking of datatypes, Directus no longer requires Primary Keys to be auto-incremented integers. You can choose anything you’d like, as long as it’s 100% unique across all items in the collection.

Live Demo

Not really a feature, but one of the most popular community requests. You can now easily preview Directus with our live demo! We provide a Stable (last release) and Next (last commit) version with auto-resetting dummy data.

Multiple Roles

Instead of assigning users to a single group, you can now use multiple Roles to create far more complex permissions systems. We’re still working on merging the different role permissions, but this should be ready in 7.1.

Naming Changes

Another keystone concept of Directus is Database Mirroring. In previous versions we used the terms Tables and Columns within the App, but this naming convention was a bit technical and led to confusion. In Directus 7, the words Collections (tables) and Fields (columns) are consistently used throughout the app, docs, codebase, and schema.

Okta Support

We’ve added an additional Single-Sign-On (SSO) option, Okta, so it’s easier than ever for your users to authenticate. We’ve also added dedicated SCIM endpoints to the API (more on that later) which work perfectly with Okta.

Permissions

Just when you thought the Directus permissions couldn’t be any more granular, we’ve added more… grains! In addition to none, mine, and full, there’s a new role option. You can now limit Read, Update, and Delete to items created by other members of that user’s role.

Quicker!

We’ve made remarkable improvements to the speed of both the App and API. Additionally, new API parameters let you choose the exact fields you need, decreasing latency by removing unnecessary relational queries and data.

Revert & Revision Diffs

Another biggie. The App highlights differences when comparing Item revisions and allows you to revert to previous states with the click of a button. Also, we’ve added dedicated API endpoints for accessing an Item’s revisions.

Soft-Save

No more losing precious content when your browser accidentally closes. Directus 7 saves all of your real-time Item updates in local storage so they can be retrieved if something goes wrong.

Theming

Version 7 uses the Material Design color palette with a subset of “brand” colors — all of which are available as global CSS variables (custom properties). This gives us the ability to add many potential features, such as: Dark-Mode, High-Contrast Mode, and Custom Theming.

UUIDs

As mentioned above, Directus now supports different types of Primary Keys, and it’s the new Universally Unique Identifier that is opening doors to magical places. M2X relationships? Relationships across API instances?? Whoa.

Validation

We’ve elevated validation from specific interface options to a field-level setting. Now you always have the ability to validate against RegEx strings to ensure data is entered correctly.

Web Hooks

Directus has always had an extensive list of event hooks available for developers to tie into. New to this version, we have included web hooks to get custom HTTP callbacks flowing to your project.

X-Domain Identity Management System

SCIM is an open standard for allowing automatic provisioning of users and roles. With our new endpoints, Enterprise-level instances can sync to internal systems, and avoid externally managing an additional user directory.

Your Requests

We’re listening. We’ve gone through the top 100 community feature requests and spoken with hundreds of developers on our Slack channel. Even after pruning edge-cases, we’ve been able to integrate almost half of the list—setting the stage for others to be added soon.

Zero Bloat

We do not throw features at the wall and see what sticks—our team judiciously weighs the benefit of every community request… forever focused on: simplicity, security, stability, and support. In fact, the Directus 7 codebase has been reduced from 57,044 to 17,622 lines of code—that’s 31% less code despite maintaining feature parity and adding helpful functionality!

So, What’s Next?

New Website & Request Tool

Our marketing site is updated to match our new identity direction and brand styleguide. We’ve rewritten copy to better explain the benefits of being “headless,” more clearly differentiated between products (free) and services (paid), and are finally showcasing our Directus explainer video!

Marketplace

The main reason behind our modular extension system is to move peripheral functionality out of the core app. But we still want it to be easy to find existing solutions… so we’re developing an Extension Marketplace. You’ll be able to find useful extensions from other developers, or submit your own.

Folder Support

A near miss. We’ve been trying to integrate folder support into Directus Files for years, but we want to get it right. In the interest of stability we’ve decided to push this feature to a future release.

More Docs & Tests

Since the code and API have changed, so have our Documentation and Tests. We’ll be constantly improving both of these to ensure that you have the best possible experience with Directus.

More SDKs

We’ve invested a lot of time into Swagger to easily generate SDKs in as many languages as possible. As it turns out, there’s one Directus URL syntax they don’t yet support: filters. Supposedly, this is resolved in their OpenAPI 3.0, but we are still waiting on the official release of that spec.

Interface Debugger Improvements

We already have a good start with our built-in Interface Debugger (just go to /interfaces) but we’ll be further refining this over the next few months. It’s an excellent new tool that makes it far easier for external developers to create their own interfaces!

New “Matrix” Relationships

Last but not least, in Directus 7 we’ve completely reimagined how we define schema relationships. Our new method elevates the relationship above the field level, thereby removing its “direction.” This makes it possible to define a relationship for a field and its counterpart can be enabled automatically.

This also opens up a unique type of relationship: the Many-to-Many-Many (M2MM, M2X, polymorphic relations), or matrix field. Now you can relate items from multiple collections through a single junction table, creating compound relationships linked by UUIDs.

Thank you for your patience!

Our core team is small and full of perfectionists, so we appreciate your patience over the past year. If you have time, please check out our beta App and API. We would truly love your feedback, especially since API changes will be locked once 7.0.0 is released.

Happy coding!

Your friends at Directus

🐰

--

--