It's been stated several times that Dilithium cannot be replicated, only mined, as of the 2380's novelverse this is still the case.
Actually one of the A Time To novels mentioned synthetic dilithium.
I wrote a short 'evolution of warp technology' article a couple of years ago taking the "Lithium" line literally to mean nano-tube lithium "crystals" manufactured on the atomic level as an experimental subsitute to Dilithium that could also be machined on-ship if necessary but never worked out.
Except they still need to stop for lithium crystals back then as well.
Also what something is called can mean something rather different than what that name meant at an earlier time.
A ship's galley as we understand it today could be quite different in the far future where advanced automation and nanotech is involved. Today you need a complete staff to man a galley and feed hundreds or thousands of crewman. In the 23rd century maybe you only need one guy monitoring the whole operation including programming. With a sophisticated system maybe all the one (or few) individual(s) need to be primarily responsible for is making certain the right raw materials are available and in place.
Except in TUC they still had a number of people cooking stuff in the galley in fact someone was making what looked like mashed potatoes in the pot Valeris vaporized.