Create a desktop application using PHP
You can "hide" the source code by creating a compressed phar archive.
As webserver you can use PHP's built in webserver.
As an offline database, normally sqlite is fitting, if you need Mysql, there is an embedded version of Mysql available as well so you can embed that as well, probably through a PHP C extension.