Question on :application.get_key(:my_app, :module)

The list returned from :application.get_key/2 is compiled from the applications manifest, which again is created by mix.

Runtime created modules do not belong to any application, and as far as I remember there is no way to get a list of them.

Though you might be able to use :code.all_loaded/0 to get a list of all currently loaded modules.