Liquid-solid transitions with applications to self-assembly