How to create a custom dashlets?
Start with civix generate:page. Optionally assign some smarty variables in run() in the autogenerated php class and edit the autogenerated .tpl with your html.

Then you need to insert an entry in civicrm_dashboard that links the url you chose in generate:page. See the function addGettingStartedDashlet() in CRM/Upgrade/Incremental/php/FourSeven.php, just note the columns have changed slightly if you're on a later version.