Directus with MSSQL and Docker

What is Directus? Directus is an open source data platform, which enables anyone in an organization — from developers to data scientists to business users — to access and manage the database content that powers all your applications and digital experiences. For developers, a data connection toolkit provides a dynamic REST+GraphQL API, JavaScript SDK, and options for authorization, caching, and more. It is written entirely in JavaScript (primarily Node.js and Vue.js )

Key Features of Directus:

  • No-Code App for anyone to manage data

  • Data Connection Toolkit with REST & GraphQL

  • Supports Any SQL Database

  • Authorization & Caching

  • Completely Free & Open Source

Let’s get our hands dirty and see, how can we use Directus as a backend API for any application.

Things we are going to use

  1. Docker Desktop

  2. Docker Compose

  3. VS Code (you can use any other editor)

If you don’t have docker desktop, please follow below instructions, Docker Desktop for Mac and Windows | Docker www.docker.com To install docker compose , follow below instructions, Install Docker Compose docs.docker.com Brief: So today we will be creating an REST and GraphQL API for backend of our Northwind Application using Directus. So basically, Directus will provide an layer on top of SQL Server, by using Directus we can query and fetch the data and also using the Directus UI (no-code app) , we can update and visualize the data.

Directus Architecture


How to install and run Directus with MSSQL in Docker? So we will create two containers, one is for our SQL Server and another is with the Directus Image. In this case we will create an Custom SQL Server image to create the Database at the initialization and once the DB is created we will initialize the directus with those credentials and the new DB.

We will use Docker Compose to deploy these two containers to local docker environment.

Few things first, our code repository will look like this,