This sounds like the stuff of science fiction but scientists at the University of California are working on a way to create the building blocks organic molecules from bacteria, nanowires, sunlight, carbon dioxide and water like a little replicator.
The device would use energy from the sun (green energy!) to convert simple materials into the basic ingredients you would need for manufacturing medicines and building materials. The idea is that it would work on Mars where people would need supplies but they wouldn’t be able to get them because Earth is. . . far.
Sure it all sounds like the stuff of movies but it can also work on Earth where we have these things in abundance and part of the process can even be used to address our own climate crisis as it would pull the CO2 from the air as well. An interesting concept.