It is possible to install a solar system that is independent of the electrical grid, but also can be connected to gird power to charge battery
Hybrid solar systems combine the best of grid-tied and off-grid solar systems. It is basically grid-tied solar with the addition of battery storage.
A grid connected PV system is one where the photovoltaic panels or array are connected to the utility grid through a power inverter unit allowing them to operate in parallel with the electric utility grid.
Optimum Sun Balcony Solar System Kit which install on balconies with micor solar inverter is play and plug solar system