This design utilises a 6V solar panel, BQ24074 charger IC and JST connector for two LEDs. BQ24074 can operate in three primary modes: USB100, USB500 and ISet, they're configured using EN1 & EN2 pins, both are internally pulled down by a ~285kOhm resistor, so no need for external components.
While using USB100 or USB500 modes BQ24074 enters DPM mode, monitors input voltage and doesn't allow it to go below ~4.5V while still charging the Li-Po battery. USB100 mode is limited to 100mA and USB500 mode is limited to 500mA of current.
While in ISet mode charge current is set with resistor and no input voltage monitoring occurs, use this mode only when you're sure that solar panel provides enough current even at dim light. In this case you can set charging current up to 1.5A.
BQ24074 has a simple PG output that is either in High-Z state when input power is not sufficient, or connected to GND when power is good. As we need to turn on LEDs only when it's dark (or not enough sun light is coming to solar panel) we can easily use the PG output to control a N-channel MOSFET that would be on when PG is High-Z (because of the 100kOhm pull-up resistor) and LEDs would be on. When there's enough power for BQ24074 to start charging the battery PG goes low, MOSFET closes and LEDs are off.
This project is designed to work with a 6V solar panel (open circuit voltage is ~7-8V) as BQ24074 can tolerate up to 28V of input voltage, but for normal operation it can take only up to 10.5V, otherwise operation is suspended. If you'd like to use 12V panels - you need to use different IC. Please make sure that input capacitors are properly rated for your solar panel!
Also you can use any power supply to recharge the battery when needed, just connect it using standard JST Li-Po connector in place of solar panel and supplying voltage between 4.5-10.5V.
Output of BQ24074 is held at ~4.3-4.4V and can be used to power not only LEDs, but any other circuit, BQ24074 will be monitoring output and limit battery charge current to keep VSys at 4.4V. Please note that LEDs brightness will be changing during battery discharge as I'm not using any regulator on the output. If you'd like to make brightness stable please use a LDO on VSys or, which is better, IC like TPS63060 - buck/boost converter to get voltage to 3.3V or 5.0V. Adjust LED resistors accordingly to get a stable 20mA current through them.
Make sure to use a large capacitor on input to keep system stable, otherwise when there's barely enough light to start charging, system will start oscillating by going into charge mode, solar panel voltage would collapse and system will go to 'not enough input power mode'. LEDs will be turning on and off and charge light will be switching too. I'm using a 4700uF capacitor mounted at the back of my board.