BTW from my back-of-envelope calculations, the panels are the cheapest part, the inverter / charger costs more, and batteries to sustain several hours of load, even more.
But many apartment buildings (here) are too tall for the roof to capture enough energy, and mounting solar panels on walls is both not very efficient (because of the light's incident angle) and much harder.