Planet formation is a key topic of modern astrophysics with implications on existential questions such as the origin of life in the Universe. Quite surprisingly, we do not precisely know when and where planets are formed in protoplanetary disks. Recent observations however indicate that this might happen sooner than we previously believed. But the physical conditions in the young disks remain poorly constrained. During this thesis we propose to test the hypothesis that planets could form early. We will perform 3D simulations of protoplanetary disk formation with gas, dust and including the mechanisms of planetesimal formation. In addition from determining whether planets form early we will be able to predict the architectures of exoplanet systems and to compare them to real ones. This work, beyond the current state-of-the-art, is timely as many efforts are currently being done by our community to better understand exoplanets as well as our origins.