How to embed compiler and interpreters to a website like codecademy?

I got a project to design a website which has a javascript & HTML interpreters, Database, C++ compiler. I have searched related websites and I ended searching with codecademy . Now I’m thinking to build something like codecademy website with my own features and functionality. Although I know how to create a dynamic website but I don’t know how to embed interpreters, compilers and all. Please guys help me to build this project and successfully run

The code execution is done at the back-end. Only the editor is embedded in the browser

but running untrusted code means you need to take a lot of precautions to prevent your servers becoming hacked.