Take QBJS as an example:
https://qbjs.org/
It's an online service. To build and run, I must find a way to have ecode upload the source code, fetch the compilation message and the run output from the online service. Is it something doable?
There are also other online compilers for various languages like C/C++, Java,... They are more advanced than QBJS so they could provide an API to work with (making it easier to implement?).