from Hacker News

Directus – real-time REST and GraphQL API of any SQL database

by modinfo on 2/23/25, 3:51 PM with 61 comments

  • by jckahn on 2/23/25, 5:10 PM

    Directus has its small-scale and short term benefits, but I can’t recommend building a production-grade app with it. My company uses Directus and we all hate it and are desperately trying to get away from it. Avoid.
  • by xvinci on 2/23/25, 5:17 PM

    Microsoft has something very similar (i did not do a full feature comparison, just speaking about apis and auth) which is mit licensed. Works also with on-prem databases despite it's name. https://github.com/Azure/data-api-builder
  • by RadiozRadioz on 2/23/25, 7:04 PM

    Had a play around with it, I'm impressed. I was very worried and put-off when I saw the nice-looking UI and flashy transitions, but this actually plays quite nicely with my database.

    Unfortunately it doesn't work on Firefox 115 ESR due to

        Intl.Segmenter is not a constructor
    
    It's just a blank screen. So it is infected by the JS change treadmill somewhat.

    I have a few other thoughts from my first try:

    When using Directus on a pre-existing DB, your foreign keys need to have exactly the same type as the primary keys they are referencing for Directus to pick up on the relationship. For example, if you have `customer.id INT PRIMARY KEY`, you must reference it with `order.customer_id INT FOREIGN KEY REFERENCES customer (id)`. You cannot do `order.customer_id INT NOT NULL FOREIGN KEY REFERENCES customer (id)` , else Directus won't notice.

    I also found it fairly slow to pick up on schema changes I made in the DB directly, and I didn't see an obvious way to force it to discover.

    When using Directus to manage the DB schema, I found the tables it created to have a generally sane and simple schema, which is refreshing. I liked the choices here more than nocodb.

    I can't comment on the REST/GraphQL generation. I'm mainly interested in the admin panel features.

    The compose file they provide here works: https://docs.directus.io/self-hosted/docker-guide.html

    Overall I think this works best if your data model is very clean. It would probably be painful to onboard a complex legacy DB. I think this is totally fine as a small-scale org data management tool. I was going to make one of these, but I don't need to now. Thanks for sharing.

  • by thederf on 2/24/25, 1:23 PM

    At work we have two applications in production with Directus, a CMS and a CRM, both highly specialized (~35 custom extensions) for our use-cases.

    We've had our teething issues, mostly with migrations and the UX in some areas, but overall it has saved us a ton of dev time and been a great force multiplier for us.

    I also use it at home to manage my notes, tasks, and such as structured data.

  • by Keyframe on 2/23/25, 4:27 PM

    seems cool, but weird non-oss license ahead warning.
  • by socketcluster on 2/23/25, 10:16 PM

    I made something kind of similar https://saasufy.com/ but currently only tied to a single database but particularly good at scaling real-time updates. I'm looking for a non-tech co-founder who can drive to a niche use case.

    As an example of its capabilities I built this from scratch without frameworks and completely server-less (basically just a .html file, .css file and a couple of .js files hosted only on GitHub): https://www.insnare.net/app/#/dashboard/company-filter/tags%...

    That entire app is less than 4K lines of code; all frontend code.

  • by 4ndrewl on 2/23/25, 6:12 PM

    This seems very similar to Hasura? What does it compete with them on?
  • by masonwr on 2/23/25, 7:54 PM

    I have had great luck with Directus building small/medium size apps. Keep up the good work!
  • by robertclaus on 2/24/25, 12:50 AM

    I used this to bootstrap a small community page with a handful of admin users that entered content. The users were technical enough to be comfortable with the interface, but wouldn't have been able to use SQL directly. It saved building out the CRUD interfaces with the ~4 hours a week of dev time we had at the time. It took us a few months to get around to the CRUD interfaces, so it felt well worth it.
  • by __jonas on 2/23/25, 10:17 PM

    I’m using this as an admin UI on top of an existing database, it works pretty well for that, it’s nice that it doesn’t dictate your db schema. I don’t really see the point of their “flows”, and I’m not sure how the auto-generated APIs hold up under load, but I’d recommend it for content management if you are ok with the license (it’s not FOSS).
  • by denvrede on 2/23/25, 7:18 PM

    Does anybody know something like Directus (building REST APIs on top of Postgres) with the ability to hook in custom authorization logic? (E.g. to do FGA checks before returning data)
  • by pacifika on 2/23/25, 5:54 PM

    If you’re dealing with pure SQL of a third party system, instead of an API, then you’re designing the API without domain knowledge. This is a problem in my experience.
  • by aerhardt on 2/23/25, 7:57 PM

    I wouldn't use anything like this to build it a user-facing app, but how does it compare to something like Django admin?
  • by esafak on 2/23/25, 9:25 PM

    Why would you dump SQL for REST??