Decision Tree

From my early school years, I’ve always dreamt of having knowledge at my fingertips, essentially envisioning the internet and smartphones before their time. Like everyone, I’m now hooked to these gadgets, and AI tools have become my new best friends at work. I’m in the software architect business, and let me tell you, every day is decision-making day. Which process fits best? Which tech stack do we roll with? What language speaks to this particular problem? It’s a lot!

Now, experience gives us a kind of sixth sense, a gut feeling when we’re diving into new challenges. But it’s not all magic; there’s a method to the madness. When we’re pondering over choices, our brain’s digging up old memories and experiences to help out. And guess what? A lot of times, it’s working through mental decision trees — whether we’re mulling over life stuff or just trying to kill it at our jobs.

Speaking of decision trees, man, I love those things. They’re like my mental notepads. They don’t just help me remember stuff; they’re awesome for breaking down big, scary decisions into bite-sized steps. Makes it easy for anyone to get the hang of things. And it’s not just about jotting down facts; it’s a journey from “Hmm, what’s this?” to “Aha, got it!”

decision tree is like a flowchart that helps you make decisions. Here’s how it works:

Starting Point (Root Node): At the top, you have a starting point or question. This is where you begin.

Branches and Questions: From there, you’ve got branches that lead to more questions or choices. Each branch is like a road you can take based on your answer to the previous question.

Ending Points (Leaf Nodes):
Eventually, the branches lead to end points, or final decisions. These are the answers you get based on the path you took through the tree.

Here is an example of a decision tree helping to choose the right (relational) database:

Source: https://www.pingcap.com/blog/how-to-efficiently-choose-the-right-database-for-your-applications/

From Idea to Reality: The Birth of the Decision Tree App?

So, I had a brainwave and cooked up this “Decision Tree” App. Took some late nights and plenty of green teas, but here we are! Can’t wait to hear what you guys think. The app was fun to build, but that’s just one piece of the puzzle. What’s next? Incorporating valuable and insightful content is the next step. I’m dreaming big — a place where any expert can drop their wisdom in tree form. From money matters and personal growth tricks to the geeky stuff I deal with daily in my software architecture job. And hey, if you’re a pro in your field, come share what you know!

In the next bit, I’ll pull back the curtain on how the app ticks, share some wild ideas for the future, and wrap up with a sneak peek into the nerdy bits and bobs of how this baby was built.

Application Overview

1. iOS Application developed using Flutter

2. Server Functionality for Decision Tree Collections

A dedicated server, developed as a serverless function, hosts the comprehensive collection of decision trees.

Upon downloading the users:

  1. Launch the application.
  2. Users can select from an available decision tree or, alternatively, filter by a specific category.
  3. Navigate through the tree by answering a series of questions until the end node, or leaf, is reached.
  4. Users have the flexibility to return to the previous question or reset their current decision tree progression entirely.
  5. The main menu, containing the list of all decision trees, is easily accessible.
  6. For a more graphical perspective, users have the option to render and subsequently share the visual representation of the decision tree.
  7. An integrated ‘Help’ feature provides assistance and clarification as needed.
  8. A dedicated function enables users to refresh and download the latest decision tree collections directly from the server.

Here are some screenshots showcasing my iOS app:

Starting screen where users can select a decision tree from the collection

Screenshot showing the categories (used for filtering)

Example of navigating a decision tree — Step 1

Example of navigating a decision tree — Step 2: Showing the progressbar (the current depth of the tree)

Example of navigating a decision tree — Step 3: Example of a final node (aka. outcome)

Screenshot showing how the latest version of the decision trees can be downloaded from the remote server

Example of the app showing the rendered decision tree with sharing options

A zoomed look at the rendered decision tree

Anticipated Features

  1. Implementation of an extensive full-text search capability.
  2. Improved user navigation, including breadcrumb-style tracking.
  3. Continuous expansion of content, particularly focusing on software architecture topics.
  4. Consideration for the introduction of premium decision tree offerings.
  5. Exploration of collaborative features, enabling external contributions to the decision tree database.
  6. Development of a user-friendly online decision tree editor.
  7. Introduction of pagination for smoother and efficient decision tree browsing.
  8. Potential on-device editing capability for decision trees? Pending further analysis.

Technical Specifications

The solution mixes both internally developed components and third-party integrations:

  1. iOS Application: Developed utilizing the Flutter framework, currently targeting iOS devices.
  2. Server Architecture: Designed as a serverless function (implemented in TypeScript) and deployed on Vercel. This server function provides the decision tree collection via a REST API endpoint. Any modifications to the decision tree collection are facilitated by pushing updates to the associated GitHub repository (this is simple but enough for a beginning).
  3. Third-party Integration: The solution incorporates the Kroki service for rendering decision trees, which are initially converted on-device to the Mermaid format.

High level view of the application

Detailed view of the application: Component Diagram

Retrieval of Decision Trees

When the app first starts, it tries to get the decision trees from the server. If there’s an issue, the app uses a fallback from a local file. All trees are saved in a local SQLite database for easy access.

Graphical Representation of Decision Trees

Users can opt to visually render a decision tree. Internally, the JSON representation of the decision trees is converted to a corresponding Mermaid flow chart. This data is then relayed to the Kroki API for conversion into a PNG graphical representation. Once generated, this visual diagram can be shared through the iOS sharing mechanism, facilitating distribution via chat, email, and other mediums.

Final words

In a world inundated with information and overwhelmed with choices, decision-making becomes a craft of its own. It’s not merely about choosing between A and B; it’s about understanding the intricacies that lie beneath every option, visualizing the potential outcomes, and making informed choices that align with our goals.

The “Decision Tree” App is my endeavor to simplify this process — an interface between our conscious thoughts and the subconscious knowledge acquired over years. It’s more than just an app; it’s a tool that fosters clarity, precision, and efficient decision-making. It’s for those who seek a structured approach to their thoughts.

Keep an eye out for more updates. I’m gearing up to launch the “Decision Tree” App on the Apple App Store soon. Appreciate your interest!

This article was first published on Medium: Charting Choices with the Decision Tree App | by Dimitri | Medium


Dimitri Missoh | 2023-10-10

logo-small-transparent 2.png