I am trying composer on some projects and wondering... actually I have installed a CodeIgniter 4 by composer in my httpdocs/ folder. Now I would like to install Flarum (forum) as well to have it referenced in my project (like domain.tld/forum links to flarum instance). Questions is: How do I get both up and running in the same space? I don't want to use a subdomain for Flarum.
You cannot combine these projects into one composer project. Even if the dependencies wouldn't clash, they will at some point.
In your comments you mention installing flarum in a subfolder of the public_html, this is the best course of action. There's no need to be afraid of critical files becoming web accessible if you follow the path customizing instructions in the Flarum documentation: https://docs.flarum.org/install#customizing-paths
Disclaimer, I'm part of the Flarum team.