DIY uninterruptable power supply (UPS) for Raspberry Pi Zero with power supply selector
Instead of the relay I would use a p-channel MOS-FET with a pull-down resistor, because it's probably cheaper, smaller and faster than the relay. Also the charging board you are showing does not have any explicit battery protection, so unless your battery has some circuitry on it, I would not recommend using it. There are also boards with the TP4056 that have said protection and also a separate output for your load.

Since I already went through all this trouble designing my own UPS circuit for Raspberry Pi's I recommend checking out my Instructables on it. There I have the full schematic and a video, where I explain everything and how the circuit works. But here is the schematic: