Hello Lutz,
I'm in the process of doing similar things. On my side, I managed to deploy a static module on Odoo Online with both frontend and backend code (though Server Actions accessible with GET requests).
The most useful resource for me was this page of the documentation: https://www.odoo.com/documentation/18.0/developer/tutorials/importable_modules.html
There is a section at the end dedicated to the "Website controllers": https://www.odoo.com/documentation/18.0/developer/tutorials/importable_modules.html#website-controllers
I also analyzed the source code of free Odoo Online apps (Aircall connectors by Caret IT, at https://apps.odoo.com/apps/modules/browse?price=Free&series=18.0&search=online) but it didn't help me much.
Hope this can help.
Justin