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?
Duolingo is pretty bad at teaching you a language so I don’t think we really need to make an open source alternative. If you want to actually learn a language, just use anki (anki is open source) for flashcards and get a textbook. I say anki because it uses a spaced repetition system which is the only way to effectively study more than 100 flashcards and there are browser plugins that allow you to create new flashcards from a couple clicks on a new word. Once you get far enough you won’t have to use the textbook and will be able to just sentence mine for words and have to google the occasional grammar point.
Repetition of words in isolation (ie flashcards or what anki offers) does nothing whatsoever to teach you a language.
Duolingo is far from perfect but it certainly does more than basic flashcards (which are fine if you’re ok with just vocab). What people constantly miss about Duolingo is that it also offers lessons (to teach you how grammar works for example) but people have to read them and take the time to understand them. Which isn’t what they normally do because it takes time and it doesn’t give you xp (it’s not gamified so everybody ignores it).
It’s how school teaching works (no it doesn’t work great either but that’s because this part is only meant to teach you about the basic layer of language, not the rest).
So Duolingo and anki aren’t designed to do the same thing at all. But if you’re serious about learning a language, Duolingo is certainly a better start IF you do it right. A combination of the two is a better bet.
Duolingo open source? Doable but you need teachers to open source their lessons and vet them. Huge amount of time and probably costly which is where the cookie crumbles.