The short answer
Before development, identify what each party brings, what will be created for the project and what rights are needed to make and support the product.
In more detail
Your existing design, software and know-how should be distinguished from a pre-developed platform or third-party component. The project scope should also name the files and materials to be delivered.
Ownership, licenses, permitted use and source access belong in the signed agreement. The terms need to match the selected platform and any third-party restrictions.