What could be considered a "foundation/fundamental" text in French?
By this I mean a text that would play a role equivalent to Tanakh for Hebrew, the works of Homer for Greek, or the Aeneid for Latin. That is such a text that one could learn a language by studying it (or build a language course around this text). Though admittedly, in none of these examples we deal with the modern variety of the language.
Of course this also assumes that the text is historically and culturally important, and is still widely read/studied today.
Remarks:
In response to comments:
I am not aware of the situation with Greek, but Latin and Hebrew have both generated a wide body of writings. Specifically: Latin continued to be used in Europe for more than a millennium, in some places well into the XXth century. French was certainly ahead of other "local" languages to substitute Latin as a written language - but even this took place about a thousand years after the Aeneid was written.
Perhaps to specify more clearly the linguistic criteria: I am talking about a work that showcases the language: in terms of its grammatical structure and vocabulary, subject matters addressed, the use of different registers, etc. Works like The Little Prince, as popular as they may be among language learners, hardly fit the bill. The works of Molière and La Chanson de Roland quite possibly do.
As another example, one could mention Luther's translation of the Bible, which is often credited with forging modern German to replace dozens of dialects. Even though admittedly not original in its content, it was certainly fundamental in terms of language.
Update There are actually courses teaching French through texts, like Le français par les textes. However, the texts used are low level and/or specially designed for pedagogical purposes, not showcasing the language in all its richness and complexity.