I have a gaming website that is making me around 3000 Euros monthly. I see great potential to expand this website but it's not a 1 person job and I need to hire a programmer to help me speed up the progress.
I have some savings and I can register a company and rent an office, but how can I trust someone and let them work on the website for me? They will need to see all the code to work on it.
Getting Started Outsourcing Hire
I do work for a $1B company whose strength and differentiator from competitors is the "source code". In theory, I can copy the source code onto a disk on key and walk away.
Any programmer you'll work with will have the same potential. So? what's the logical solution? be a 1-man company forever?
You may find out that living in fear and suspicion will be bad for business as you'll always be the only employee, working for yourself, won't be able to scale or grow your company.
There are agreements and lawyers in the world. This is your safety net. Use it and start trusting people. The scumbags who will try to steal from you are a small rare minority. Most people are honest.
I encountered a case in a company I worked for 12 years ago of sales people who left the company, joined up with a competitor after stealing our leads database. As soon as we got word of it we took them to court -- in a matter of weeks we had an injunction order against them and they disbanded like leaves in the wind.
I am pretty sure a lawyer can pursue anyone who steals from you and sets up a competitor based on your hard work.
Without trust you'll never grow. Why live in fear and suspicion?
How do banks trust their employees not to just walk out with wads of cash? It is down to you to interview potential employees and judge whether they are people that you can trust with your code base.
I don't know the concept of your site, but is it not easily replicated without even needing to see the source code? It likely is, meaning you shouldn't be so worried about employees using your code.
You could also put a non-compete clause in the contract of employment you create for any employee's, preventing them from creating any kind of business within the same niche for an agreed upon period of time.
Mirroring some of the sentiment from the other answers; you need to enforce this contractually.
This means putting agreements in place, being prepared to follow through and enforce those should the need arise.
Be proactive in how you prepare for enforcing your agreements, this will make enforcement easier, act as a deterrent, help vet contractors/staff in the first place. Bad news is you'll probably still have to pay a lawyer to help set this up but it would be investment over reactive.
Some concrete steps to consider: