A web-based tool that guides users through decision-making processes using an interactive, user-friendly flow chart interface.
Think of it as a choose-your-own-adventure for decisions. Decision tree data is stored as plain XML, viewed with a lightweight client-side viewer, and edited through a PHP-driven visual editor — no database required.
Live demo: emaag.github.io/interactive-decision-tree
| Feature | State |
|---|---|
| XML-based data storage | ✅ Implemented |
| Client-side viewer (HTML/CSS/JS) | ✅ Implemented |
| Visual PHP editor (no manual XML editing) | ✅ Implemented |
| File-based storage (no database) | ✅ Implemented |
| Responsive design | ✅ Implemented |
| Cross-platform hosting (any web server) | ✅ Implemented |
- Demo
- Environment Requirements
- Setup Instructions
- Usage
- Architectural Decisions
- Contributing
- License
- Support
| Requirement | Notes |
|---|---|
| Web server | Apache, Nginx, or any HTTP server |
| PHP | 7.4+ (8.x recommended) |
| Write permissions | Required on the xml/ directory |
-
Clone the repository:
git clone https://github.com/emaag/interactive-decision-tree.git cd interactive-decision-tree
-
Set directory permissions:
chmod 755 xml/ # Or, if necessary: chmod 777 xml/
-
Configure your web server to point to the repository directory.
-
Access the editor in your browser:
http://your-domain.com/interactive-decision-tree/editTree.php
docker compose up --buildThen open http://localhost:8080 in your browser.
- Navigate to
editTree.phpin your browser. - Click "Create New Decision Tree".
- Add questions and decision paths using the visual editor.
- Save your decision tree (stored as XML in the
xml/directory).
- Navigate to
index.phpto see a list of all available trees. - Click View next to any tree to open it in the interactive viewer.
By default the editor is unprotected. To require a password:
php -r "echo password_hash('yourpassword', PASSWORD_BCRYPT);"Paste the output into config.php:
define( 'EDITOR_PASSWORD_HASH', '$2y$10$...' );<?xml version="1.0"?>
<tree>
<title>My Decision Tree</title>
<description>A short description</description>
<branch id="1">
<content>What is your question?</content>
<fork target="1.1">Answer A</fork>
<fork target="1.2">Answer B</fork>
</branch>
<branch id="1.1">
<content>You chose A. Another question?</content>
<fork target="1.1.1">Yes</fork>
<fork target="1.1.2">No</fork>
</branch>
<!-- Branch id="1.2" etc. -->
</tree>File layout:
interactive-decision-tree/
├── xml/ # Decision tree XML files (needs write permission)
├── css/ # Stylesheets
├── js/ # JavaScript files
├── index.php # Public listing of all trees
├── showTree.html # Interactive viewer for a single tree
├── editTree.php # Editor for creating/editing trees (password-protected)
├── login.php # Editor login page
├── logout.php # Editor logout
├── config.php # App configuration (password hash)
├── class.decisiontree.php # DecisionTree and Branch classes
├── inc.general.php # Shared functions and session/auth helpers
├── Dockerfile # Docker image definition
├── docker-compose.yml # Docker Compose setup
├── LICENSE # MIT License
└── README.md # This file
Contributions are welcome! Please see CONTRIBUTING.md for details.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Found a bug? Please open an issue on GitHub with:
- Description of the problem
- Steps to reproduce
- Expected behavior
- Screenshots (if applicable)
This project is licensed under the MIT License — see the LICENSE file for details.
Found a bug or have a question? Open an issue on GitHub.
Eric Maag
- GitHub: @emaag
- Thanks to all contributors who have helped improve this project
- Inspired by the need for simple, accessible decision-making tools
This project has been forked by organizations including legal service providers and educational institutions to help users navigate complex decision-making processes.
⭐ Star this repository if you find it useful!