Codepen is not required - as long as the code is visible somewhere and you have a workable demo that can be accessed online. Copepen is nice because it wraps that up in one place. It also makes it nice because if you have a question, it is easy to link it in the forum and get lots of answers. I always recommend codepen. The free version is more than enough. Yes, your pens will be public. If your going to be coding for the NSA, it is not a good option. But for everything else it is fine. The code is going to have to be public anyway to pass the project.
Some people get down on codepen. There are a few drawbacks. You can’t have multiple files. Also, for beginners, it divorces you from how web site files are typically setup and how to set up the header info in your HTML file (codepen does that for you behind the scenes). But that is easy stuff to learn and codepen will export it into the correct file structure when you want so you can see exactly what you’re missing (which will take 5 minutes to figure out, if that.)