Programmer made from scratch, with experience in varying range of programming language, and i can tell you how to forge your path on becoming a programmer.
I have participate in Harverd's CS50 courses, and completed freeCodeCamp's HTML and CSS program.
I think you can first sign a contract that keep your product confidential, and if he did not follow the contract, you can get a a sum of money for compensation(better be a lot, so he won't dare to steal the code). I suggest you get a lawyer for the paper works.