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.