A visual knowledge management system for organizing thoughts, ideas, and information in interactive tree structures.
Knowledge Tree is a self-hosted application for building and exploring hierarchical notes. It uses PHP and MySQL for persistence, with a D3.js-powered tree visualization for smooth zooming, panning, and interactive node management.
- Interactive tree visualization with D3.js
- Dark dashboard with a glassmorphism-inspired UI
- Unlimited nesting depth for notes and branches
- Rich text editing with Markdown support
- Global search with Ctrl+K / Cmd+K
- Context actions for edit, add child, duplicate, and delete
- Responsive layout for desktop and mobile
- Secure authentication and prepared statements
- PHP 8.0 or higher
- MySQL 8.0 or compatible server
- PDO MySQL extension
- Apache with
mod_rewriteor another compatible web server
- Clone the repository:
git clone https://github.com/yourusername/knowledge-tree.git
cd knowledge-tree- Create a MySQL database and import the schema:
mysql -u your_user -p your_database < database.sql-
Update
config.phpwith your MySQL credentials. -
Start the PHP development server:
php -S localhost:8000-
Open
http://localhost:8000in your browser. -
Follow the setup flow to connect the app to your database and create your account.
- Upload the project files to your hosting account.
- Import
database.sqlinto your MySQL database. - Configure the database credentials in
config.php. - Make sure your web server supports PHP and URL rewriting.
- Open the site in a browser and complete the setup flow.
knowledge-tree/
├── index.php
├── config.php
├── setup.php
├── database.sql
├── app/
│ ├── Core/
│ │ ├── Database.php
│ │ ├── Router.php
│ │ ├── Auth.php
│ │ └── Response.php
│ ├── Controllers/
│ │ ├── AuthController.php
│ │ ├── DashboardController.php
│ │ └── ApiController.php
│ ├── Models/
│ │ ├── User.php
│ │ └── Node.php
│ └── Views/
│ ├── 404.php
│ ├── dashboard.php
│ ├── layout.php
│ ├── auth/
│ │ └── login.php
│ └── partials/
│ ├── navbar.php
│ ├── node-editor.php
│ └── sidebar.php
├── public/
│ ├── css/
│ ├── js/
│ └── assets/
└── data/
- Click a node to view its details
- Right-click a node for edit, add child, duplicate, or delete
- Use the sidebar to browse branches
- Use the zoom controls to zoom in, zoom out, or reset the view
- Press Ctrl+K / Cmd+K to search across notes
| Shortcut | Action |
|---|---|
| Ctrl+K / Cmd+K | Open search |
| Ctrl+S | Save current node |
| Escape | Close editor or menu |
| Delete | Remove selected node |
- Create a root node from the toolbar or empty state
- Add a child node from the node details panel or context menu
- Edit an existing node in the modal editor
- Duplicate a node and its children
- Delete a node and its descendants
Edit config.php to adjust your database connection and application settings.
Typical values include:
define('DB_HOST', '127.0.0.1');
define('DB_NAME', 'knowledge_tree');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_CHARSET', 'utf8mb4');- Password hashing with bcrypt
- Prepared SQL statements
- Output escaping to prevent XSS
- Session-based authentication
- Chrome 90 and later
- Firefox 88 and later
- Safari 14 and later
- Edge 90 and later
MIT License. See the LICENSE file for details.
- D3.js - Tree visualization
- Font Awesome - Icons
- Inter - Typeface