Unable to setup frappe ui with custom app

I m having a custom app, trying to setup frappe ui and top of it. Both frontend and backend running on a different port. How to interlink both frontend and backend ? ex: Frappedesk

you can make build and put your dist package inside the www directory

dist package was not found while running build, can you mention the steps to acheive this?