Can I get a PhD if I did research without being enrolled in a PhD program?
Your best bet is to talk to the professor that is supervising you. Course work is less of an issue in Germany, so you might be able to speed up the process considerably if the professor is willing to accept your research as a basis for the thesis. Whether or not that project is suitable as a basis for a PhD thesis depends on the research that happened and your exact role in it. Maybe your work can count as an entire thesis, maybe it can count as an entire thesis if you do some extra work on, maybe it can count as a chapter, and you need two or three other projects to complete it, maybe it is just not suitable. We don't know, but your supervisor can tell you.