Construction of a general planetary theory of the first order