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?
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.