How to integrate a custom one page php app into drupal 7?
A custom module with a menu callback is the way to go. In general, themes and tpl.php files should only control what your site looks like. Modules should control what your site does.

I understand that you don't want to refactor your code completely and turn everything into render arrays. Fortunately, you don't have to. You can create a string of html and put it in a render array like this:

// Generate your html.
$html = '&lt;p&gt;Hello world!&lt;/p&gt;';
// Wrap it in a render array.
$output = array (
  '#markup' =&gt; $html,
);


Now, this is the really simple version. I do recommend that you take advantage of some of Drupal's features.

First of all, if you didn't already do so, I would create separate menu callbacks for the ajax requests. If both the rendering of the page and the ajax requests are handled by the same menu router, you might get in trouble when Drupal starts caching things.

Second, I would take add all javascript (and possible css) to the page using the #attached property of your render array. This also allows Drupal to cache (parts of) your page without breaking things. Assuming that your module is called "mymodule" and your javascript is stored in mymodule.js, your render array could look like this:

$output = array (
  '#markup' =&gt; '&lt;p&gt;Hello world!&lt;/p&gt;',
  '#attached' =&gt; array(
    'js'      =&gt; array(
      drupal_get_path('module', 'mymodule') . '/mymodule.js',
    ),
    // If your output requires certain CSS rules, regardless of the theme
    // that is used, add a CSS file like this.
    //'css'      =&gt; array(
    //  drupal_get_path('module', 'mymodule') . '/mymodule.css',
    //),
  ),
);