# Devblog 7: Going into another Directus

It's been a while since the [last devblog](https://fluttergamedev.com/devblog-6-swimming-against-the-current). It was a busy couple of weeks with the holidays and the [Flutter Forward](https://flutter.dev/events/flutter-forward) event coming up.

I made a little bit of progress on the project which also involved a rather impactful decision.

But first, let me tell you a bit about the other stuff that happened!

# Flutter Forward Festival

The people from [Flutter Netherlands](https://www.meetup.com/flutternl/), together with [Pinch](https://pinch.nl/en/) (the company I work for) organized a viewing party for the [Flutter Forward Live Stream](https://www.youtube.com/watch?v=zKQYGKAe5W8&ab_channel=Flutter).

After watching the stream together, we would have a few presentations. I was asked to be one of the presenters which I accepted.

## From Mental Model to App Architecture

My presentation was called "*From Mental Model to App Architecture*". I talked about how I came up with the architecture that I used for the last project I worked on, which struggles I had and what I did to overcome them.  
So instead of a technical story, it was more about my developer experience, something I would usually write about on this website.

## Etos

At the end of the presentation, I also made an introduction to [Etos](https://pub.dev/packages/etos_flutter).  
Etos is the state management solution I'm working on that is intended to make applying the architecture that I've come up with, easier.

I talked a little bit about this, without calling it by name, in an [earlier devblog](https://fluttergamedev.com/devblog-2-the-scavenger-hunt#heading-state-management). I'm using this state management solution in this project, to see if it holds up in the real world.

When I'm satisfied enough, I will write an article about it.

# Project Progress

As I said, it was a busy couple of weeks. However, I was able to make some progress. But first I made yet a 'drastic' change...

## Bye Bye Firestore, and hello Directus!

In [devblog 5](https://fluttergamedev.com/devblog-5-getting-into-the-flutterflow#heading-firebase) I mentioned I wanted to use Firebase (Firestore) for this project.  
After several attempts of trying to model my data in Firestore, I realized that my brain doesn't like the unstructured nature of a NoSQL database.

Whatever I tried, I just was never really satisfied with the outcome. It was holding up the project and I was slowly losing joy.

Then I took a step back, and thought about why I choose Firestore in the first place, and if it was necessary to have a NoSQL database for this project.

I came to realize it was not.

A few years ago I experimented with [Directus](https://directus.io/), I remembered being impressed by it. Directus is a headless CMS that wraps around your SQL database. It also automatically generates an API (REST and GraphQL) for you!

Since the first time I used it, Directus has come a long way. I read the docs and watched videos about it to see if this might be a good fit for me and my project.

It looked very, very, very promising!

So I decided to give it a shot. I created a FREE Directus project in their [cloud service](https://directus.io/pricing/). It was set up in no time at all and I could quickly try it out.

## Authentication

Because the free tier of the hosted instance doesn't allow for SSO services I had to make some changes in the authentication. I would no longer use FirebaseAuth for this and thus had to build this myself.

Luckily Directus also generates authentication endpoints that I could use. Unfortunately, I had to do a lot more work than what FirebaseAuth automatically gives you, but it was also a nice experience to learn a bit more about how authentication works under the hood.

# What's next?

I think I will first focus on being able to create a draft scavenger hunt.  
Hopefully, this will give me a feel for how to model the data in de the database.

There are still a few questions I need to think about, like:

1. Should it be possible to update a Scavenger Hunt after it has been published?
    
2. What is, and is not, allowed to be changed?
    

But I will take it one step at a time.  
First I will focus on creating the drafts.
