There are a couple of issues with trying to design something like this.
First, the lithium batteries are finicky about how they are charged. For the health of the battery, it would be a good idea to use a commercially designed charger there. However, there are several lithium ion charge controller chips that are fairly easy to use in a custom circuit, especially if you don't mind soldering surface mount. On the other hand, the LiFePo batteries are pretty forgiving (where other lithium ions are definitely not and might even explode if charged incorrectly).
Next, the solar panels, depending on the configuration, can put out anywhere between 1v and 200v depending on their configuration, area, number of panels, and the solar flux on that day. So depending on the size of your panels, you might end up needing to make a fairly robust controller, and good luck keeping it efficient. The panels need to be biased in a nonlinear way to maximize power generation, and the optimal current/voltage curve is likely to be specific to the panels and their configuration.
Another problem -- a lot of the commercial solar controllers use MPPT or buck/boost controllers to convert to the voltages the battery needs, and this type of controller leaves a high voltage oscillating current on the feed line between the panel and the controller. Say hello RFI, good bye radio reception! (Ideally, you'd want high voltage DC in the long wires to reduce both resistive loss and RFI.)
Not saying it can't be done or that you shouldn't do it, just that you need to take into consideration all of the above in your design, and there are a lot of cheap commercial products out there. Some might even be well designed, and some might even be cheaper than what you can build in small quantities.
But for a small setup with a single panel, a single battery, short feed wires, and not a lot of concern about efficiency, it might not be too hard.