Buck converter 3.3v (from usb 5v., 3.7v lipo)

I want to create a power supply that gives continue voltage to the Atmega328p by using a Lipo 3.7v 400/600mah~ that can also be charged by usb. While charging it should also deliver power to the Atmega328p.
I searched the web for examples and i found so many (mainly buck/stepdown converters) without the ability of charging a battery.

I was thinking of using the components of a stepdown converter for the 3.3v/5v to 3.3v, but it doesn't allow me to charge to 4.2v while supplying 3.3v to the atmega.

What if i use 2 voltage regulators 1 for 3.3v Atmega and one for 4.2v charger how can i create a cutoff when the battery is fully charged?

Can i use:
https://learn.sparkfun.com/tutorials/lipo-usb-charger-hookup-guide#inputs-and-outputs

for build scheme and add a voltage regulator to the sys output for 3.3v?

Why do you need 3.3V? The ATmega will run @8MHz fine between 2.7V-5.5V.

For charging and protecting the Li-Ion: There are cheap protection ICs or modules on eBay

Because if i decide to use a different soc like the esp32 it should work without changing the battery scheme

Pololu has a great variety of DC-DC converters.