Biosphere 2, so named because the earth is considered Biosphere 1, was designed to be a self-contained ecosystem. If it could work without any input from the world outside, it could make habitation on the moon or Mars possible. While it was not exactly successful in being completely self-contained, it is still a good resource for learning about how ecosystems work. As with much in science, sometimes you can learn as much from mistakes as you can from "success".