I went through a similar situation recently. It isn't straight forward for getting the logic app out of the portal. But they way to do is viewing the workflow.json. By selecting Logic app code view in the portal will reveal this json. You can copy and paste that json into your empty file.
This should help get you started but as for creating the other project files, you will end up having to recreate those on your own.
EDIT 24 September 2024
For Standard Logic Apps, it is possible to download the logic app flow. There's a Download app content button in the portal that will produce a zip package of all workflows and host files.
This button is located next to the Delete button on the tool bar.For Consumption base Logic Apps, the appropriate step is to use the Export template under Automation.