There are three basic types of apps for Office: task pane, content, and mail and the common components for all of these are an XML manifest and a webpage:
The Overview of Apps for Office explains that an app for Office is expected to have similar functionality to a webpage within a browser, such as:
Connect to REST endpoints and web services via HTTP and AJAX.
Run server-side code or logic, if the page is implemented using a server-side scripting language such as ASP or PHP.
This video gives an overview of how Apps for Office are expected to work;
(click to expand)