Actually the only thing you need in a Magento 2 setup is a composer.json
file which requires the package magento/product-community-edition
from the Composer repository https://repo.magento.com/.
Now when you run composer install
it will download a lot of Magento packages and third party packages (Composer, Symfony, Zend, etc...) and place them into the vendor/
folder. Thanks to the Magento Composer Installer it will also copy a lot of Magento 2 files into the root. But actually all your code comes from vendor/
.
Now, the app/code
folder isn't there by default. You can create it yourself and add your local modules there in this structure: app/code/<VendorName>/<ModuleName>
.
You could also develop your modules in a separate VCS (i.e. GIT) repository somewhere and add them to your composer.json
which will make them also being installed into the vendor/
directory.