Anatomy of a Flatpak
Installing a Flatpak will create a file structure for the program and its runtimes, as well as some metadata. The basic structure of this consists of four top-level directories in either $HOME/.local/share/flatpak or /var/lib/flatpak, depending on whether it was a system or user install.
The first of these is repo, which contains information about installed applications, remotes, and other metadata. The app directory is where the applications themselves live. Each program has a sub-directory named with its three-part identifier (for example, org.gnome.GEdit). There are further sub-directories that are set aside for architecture (such as x86_64), version numbers, and their associated checksums.
Runtimes are managed in the same way, but are kept separately in the runtime directory. This is because they can be shared across more than one application. The final directory is exports, containing items related to the Flatpak programs yet sits outside the sandbox. These include things like the application icon and .desktop file (which will appear in your desktop’s application menu), and system references such as connections to the windowing system. The exports directory contains links to things inside the Flatpak, and is one of the carefully controlled touchpoints between the host system and Flatpak’s sandbox.
The following shows the export of the tree command run following a LibreOffice Flatpak installation: $ aaron@acp-demon:/var/lib/flatpak$ tree -L 2 app org.libreoffice.LibreOffice appstream
flathub exports bin share repo config extensions flathub.trustedkeys.gpg objects refs state tmp runtime org.freedesktop.Platform org.freedesktop.Platform.ffmpeg org.freedesktop.Platform.Locale org.libreoffice.LibreOffice.Locale