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?
Well you don't just use the flashcards, You have to use textbooks and practice on supplementary material. Those aren't really software that can be open source.
Also Duolingo removed its grammar lessons a while ago, so its really not that different from flashcards now. EDIT: nevermind they only removed grammar on desktop.