how do i mount an app as engine?

hi, i have an working rails4 app with devise user authentication and would like to mount that ap as an engine into a subdomain, but using the user authentication & table from the main app…

how do i do that?

thx