The properties of a macroscopic assembly of weakly-repulsive bosons at zero temperature are well described by Gross-Pitaevskii mean-field theory. According to this formalism the system exhibits a quantum transition from superfluid to cluster supersolid as a function of pressure. We develop a thermodynamically rigorous treatment of the different phases of the system by adopting a variational formulation of the condensate wave function --- represented as a sum of Gaussians --- that is amenable to exact manipulations. Not only is this description quantitatively accurate, but it is also capable to predict the order (and sometimes even the location) of the transition. We consider a number of crystal structures in two and three dimensions and determine the phase diagram. Depending on the lattice, the transition from fluid to solid can be first-order or continuous, a lower coordination entailing a milder transition. In two dimensions, crystallization would occur at the same pressure on three distinct lattices (square, honeycomb, and stripes), all providing metastable phases with respect to the triangular crystal. A similar scenario holds in three dimensions, where the simple-cubic and diamond crystals also share a common melting point; however, the stable crystal at low pressure is typically fcc. Upon compression and depending on the shape of the potential, the fcc crystal may transform into hcp. We conclude by sketching a theory of the solid-fluid interface and of quantum nucleation of the solid from the fluid.