Speaking as a total ignorant from a coding perspective. But I guess that wouldn't be the hard part, considering that most of Duolinguo is just boxes and text inputs. How difficult it is to create a database of competent linguists with an efficient training who can progressively enhance your understanding of languages?
If an OS alternative was trying to completely replace duolingo, it would need far more than that. Duolingo has had extensive work put into listening and speaking lessons. Almost all lessons have a listening componentwhich is a ton of content to make up for. They have significantly better voice recognition than my phone. The amount of effort to get something like that working for a language, let alone dozens of languages is a high bar.
Take a look at any of the job postings that duolingo has, they’re only looking for Google employee level of skill for a reason (aside from how fucked the job market is).
It’s not impossible for duolingo to be replaced with an open source version, but it’s a giant undertaking.