Yes, it’s been done before, the process of applying from the US is called AOS (Adjustment of Status). You and your soon to be spouse’s eligibility to process AOS depends on your DV CN and current status in the US (when it expires).
I recommend you start by going through the AOS Process Spreadsheet (link to the spreadsheet can be found in the signature section of any of my posts or on the first post on page one of the DV2024 AOS thread). After going through the spreadsheet, you’re encouraged to post your follow up questions on the 2024 AOS thread - we prefer to keep AOS related questions in the same thread.