Share My Creation [Web] FamilyTree developed with SithasoDaisy5

Hi Fam

There are 2 inspirations for this project, 1. Family.Show and 2. TreeSpider

1745648263426.png


The family tree is built once you capture your family members and also create relationships between them, like adding a mother and a father.

1745648433210.png


You can also include details like clan names for your family members.

1745648494581.png


This project has been built using the Table + Preference Dialog methodology.

The source code of this project is on the SithasoDaisy5 github repo > Tutorials > Projects.

Running the Family Tree App

1. Follow this guide on how to get started setting up your Dev Environment


2. Setting up the Back-End

In the Family Tree download, you get 3 files

1745649607243.png


The familytree.sql file has been created using heidi, which is part of laragon. Import the file to create the database and the table needed. The MySQL config I am using has password root and a blank password.

When you unzip the family tree project in your workspace. Open the api.php file and update it with your MySQL settings. Line 12765 onwards.

B4X:
$config = new Config([
        'driver' => 'mysql',
        'address' => 'localhost',
        'port' => '3306',
        'username' => 'root',
        'password' => '',
        'database' => 'stock',
        'debug' => true,
        'tables' => 'all',
        'middlewares' => 'apiKeyAuth,sanitation',
        'apiKeyAuth.keys' => 'jNOEqK8xvAqWWRf7B4jlw2ppOCeBoHunex4ViA1txPrG7V9DW1dG737HhseS4E5Ca3xVaUtUwbDRIOrkwEZv7SEvUQP6jClRpDESkRUnshgyngNDd2epbJWjF48xAzKp',
        'apiKeyAuth.header' => 'X-API-Key',
    ]);

This setting is using an API key to access the database. The api key specified on this file is the same api key in the env.json file. If you change it, please ensure you change it on both sides.

You can generate api keys from this web site. https://generate-random.org/api-key-generator

The .sql file comes with some records, you can delete these and create your own.

Our appname is family tree (Main.Process_Globals variable) and is meant to be run in localhost. If you change the app name from familytree, you also need to update the api-url. The api-url is used by our PHP REST API to access the db. This should be a definite path when the app is deployed to a public webserver on the internet.

B4X:
{
    "api-key": "jNOEqK8xvAqWWRf7B4jlw2ppOCeBoHunex4ViA1txPrG7V9DW1dG737HhseS4E5Ca3xVaUtUwbDRIOrkwEZv7SEvUQP6jClRpDESkRUnshgyngNDd2epbJWjF48xAzKp",
    "api-url": "http://127.0.0.1/familytree"
}

The provided json file is the schema of the app, should we want to update the UI using the Preference Builder in the Demo App.

Enjoy!
 
Top