The multielectron LDA+GTB approach has been developed to calculate electronic structure of strongly correlated cuprates. At low energies the effective Hamiltonian of the $t - t - t - {t_ bot } - {J^ * } - {J_ bot }$-model has been derived with parameters coming from the ab initio calculation for LSCO. The electronic structure of LSCO has been calculated self-consistently with the short-range antiferromagnetic order for various doping level. Two Lifshitz-type quantum phase transitions with Fermi surface topology changes have been found at dopings $x_{c1}=0.15$ and $x_{c2}=0.24$. Its effect on normal and superconducting properties has been calculated. The interatomic exchange parameter and its pressure dependence has been calculated within LDA+GTB scheme. The magnetic mechanisms of d-wave pairing induced by static and dynamical spin correlations are discussed. Simultaneous treatment of magnetic and phonon pairing results in the conclusion that both contributions are of the same order. For two layer cuprates like YBCO the interlayer hopping and exchange effects on the electronic structure and doping dependence of $T_c$ is discussed as well as the Coulomb interaction induced mechanism of pairing.