00:00:00Okay, so how many times have you rebuilt the exact same backend?
00:00:04CRUD, auth, admin panel, file uploads.
00:00:07A lot of the time, what looks like building is usually just rebuilding.
00:00:10What if you could point one tool at your existing SQL database and get a full backend?
00:00:15That's Directus, a real-time API and app dashboard for managing SQL database content.
00:00:21A lot of devs are starting to realize they've been doing this the hard way the whole time.
00:00:25Let me show you how all this works in just a few minutes.
00:00:30[MUSIC]
00:00:33The biggest backend problem for most of us isn't complexity, it's repetition.
00:00:38We're not solving new problems, we're wiring the same code again and again,
00:00:42and that really just eats into our time.
00:00:44Directus cuts all that out.
00:00:46It connects straight to your Postgres, MySQL, or Oracle database.
00:00:50No migrations, no rebuilding your whole schema somewhere else.
00:00:53We instantly get REST and GraphQL APIs,
00:00:57field-level permissions, real-time subscriptions,
00:01:01flow and automations, file handling, and a clean admin UI.
00:01:05Now, the cool part here is your database just stays.
00:01:08It's not some duplicate layer.
00:01:10That matters way more than it sounds.
00:01:12Now let me show you.
00:01:13If you enjoy open-source tools and coding tips to speed up your workflow,
00:01:17be sure to subscribe.
00:01:18We have videos coming out all the time.
00:01:20All right, now starting from absolute zero with a clean Directus install,
00:01:24no database tables, nothing preloaded.
00:01:27Just a completely blank canvas after I already made an account here.
00:01:32And instead of connecting to something that already exists,
00:01:34I'm going to build a full order management app in just a minute or so.
00:01:39First, I create a collection and I'll just name it Orders, just like this.
00:01:45That's it.
00:01:45Now the app has a place to store data, and we can add more details into it now.
00:01:51I'm going to select and override the ones we need here,
00:01:54so things like customer, date, really all that fun stuff.
00:01:58Then I can manually add in any other fields
00:02:00that we would think we would need for something like this.
00:02:03So I could say customer name, email, product as a dropdown,
00:02:08where I can add a key and a value.
00:02:10I can do that for amount and status.
00:02:13Each field adds more detail about the data that we're going to store.
00:02:16And notice what's missing here.
00:02:18Well, it's SQL.
00:02:19There is no SQL.
00:02:20There's no migrations.
00:02:22There's no switching tabs to write a schema file.
00:02:25It just saves right here in Directus immediately.
00:02:28Now I can just jump into the content view and start adding orders.
00:02:32So I can add the first order here, just a dummy account.
00:02:35I'll add another one.
00:02:36And then we can add a third one, right?
00:02:39We have three different orders right here in the system.
00:02:42Now I have some real data here that we could start to play with.
00:02:45But right now it's wide open, which means anyone could do anything.
00:02:49So let's fix that.
00:02:50How do we fix that?
00:02:51Well, with permissions.
00:02:53So I go to the public role.
00:02:55I'm going to find that collection we made orders.
00:02:58We can turn read on.
00:03:00And I'm going to make sure everything else here is turned off.
00:03:03So create, update, delete.
00:03:05Those are all gone.
00:03:06Now it's more controlled and safer for what we want.
00:03:10Okay, here's where it starts to get really cool
00:03:12because we can do some automation and build out flows surrounding this.
00:03:16I'm going to go over here and I'm going to create a new flow.
00:03:19I'm just going to name it something really simple, what is this?
00:03:22So I'm going to notify on a new order.
00:03:24Simple name, it has my purpose.
00:03:26And I will select everything from items in the collection we made called orders.
00:03:31Now I can build out a trigger.
00:03:33And for the trigger, I hook into when a new item is created,
00:03:37specifically in that orders collection.
00:03:39So now every time a new order comes in, something is going to happen.
00:03:43I'm going to add in an operation.
00:03:44We're going to send an email.
00:03:46It's going to write a subject.
00:03:47I'm going to add my email to this.
00:03:49And then in the body, I'm going to pull in the order data.
00:03:52So anytime a new order goes in, it's going to push that data through into an email.
00:03:56Now I can save this operation and we're going to save the flow and we're done.
00:04:00Okay, now watch this.
00:04:02I'm going to go back.
00:04:03And in my starting Docker compost file, I added mail pit to test this out.
00:04:07This is just a super simple way to test out that email send function.
00:04:11When I make one more order, just like before, nothing fancy,
00:04:14but this time something is different.
00:04:16This now triggers the flow automatically and an email goes out with the details.
00:04:20There's no backend logic here.
00:04:22There's no wiring things together.
00:04:25This started as nothing, no tables, no backend, no real structure here.
00:04:30And in just a few minutes, it's a working app with data permissions and yes,
00:04:33automation, which was the cool part.
00:04:35And this is what makes Directus feel pretty cool.
00:04:38It's almost like a combination of visual database logic with something like N8N or Zapier built in,
00:04:43but that's not really who it competes with.
00:04:45So what is Directus exactly?
00:04:47It's an open source data platform that sits on top of your SQL database.
00:04:52It doesn't sit beside it.
00:04:53It sits on top of it.
00:04:55That database first model is the whole point, right?
00:04:58So what does this really mean?
00:04:59Well, it means a few things for us.
00:05:01It means there's no lock-in.
00:05:03The full SQL is still there and it works with legacy systems.
00:05:07That's why people use it for things like SaaS backends, internal tools, headless CMS setups,
00:05:13AI agents with controlled data.
00:05:15You're trying to modernize some old system without rewriting everything.
00:05:19Your database is the actual engine here.
00:05:21Directus just gives it a dashboard and controls.
00:05:24Now, at first glance, if you played with other tools like Strapi, Payload, Hasora,
00:05:28and Directus is going to look similar to this, but they actually solve different problems.
00:05:33Strapi and Payload are code first.
00:05:36You define the schemas in code, then rebuild your structure there.
00:05:40Yeah, that does work, but it's extra work.
00:05:42Directus changes a few things with some tweaks.
00:05:45Your schema already exists, so instead of recreating it, you just connect it.
00:05:50Different workflow entirely here.
00:05:52Hasora is great for fast GraphQL, but Directus goes even wider than just this.
00:05:58You're getting APIs.
00:05:59Yes, we do get that, but we're also getting admin workspace, permissions, files, and automations.
00:06:05And here's the part most devs care about after trying it out, permissions.
00:06:10I'm not talking about just rules here.
00:06:12We're talking about real control with no plugins.
00:06:15So if your problem is I need backend, you've got options.
00:06:18If your problem is I don't want to rebuild my backend again, this is different.
00:06:23Now, obviously, no tool is perfect, but this is pretty neat.
00:06:26What did I think was super cool?
00:06:28Well, the permissions just work.
00:06:29That's awesome.
00:06:30Flows remove a lot of the busy work we're doing.
00:06:32The UI was really clean and fast, and it's easy to deploy with Docker.
00:06:37On top of all that, it scales really well.
00:06:39But with all this good stuff, of course, there's always these drawbacks.
00:06:43So the trade-offs are going to be things like advanced flows can take time, right?
00:06:46If you've ever played with N8N, anything else, you get it.
00:06:49Docs are not always there.
00:06:51And if you self-host, you need to manage the infra yourself.
00:06:54Plus, complex setups can get messy locally.
00:06:57Directus just removes a very specific kind of repeated backend work.
00:07:00So is Directus worth it?
00:07:02For a lot of us, probably, yeah.
00:07:03It depends on what we're doing, especially if you already have SQL data, or if you're
00:07:07tired of rebuilding these basic backends we're doing all the time over and over, then yeah,
00:07:11this is some real value.
00:07:13It saves time, it reduces maintenance, and you keep control of the data.
00:07:17Once again, it's open source.
00:07:19We control that.
00:07:20When would you not use this?
00:07:22Well, if you're in a strict typescript, like a huge monorepo, probably not, right?
00:07:26If you don't have an existing database, probably not.
00:07:29And you want everything defined in code from the start, then something like Payload just
00:07:33makes a lot more sense here.
00:07:34But if you're thinking right now, wait, this can just sit on top of my database?
00:07:38Yeah, it can.
00:07:39So it might be worth trying.
00:07:41If you enjoy open source tools and coding tips like this one, be sure to subscribe to the
00:07:45Better Stack channel.
00:07:46We'll see you in another video.