How easy is it to port Discourse community to custom webapp later?

That would largely be a data migration like any other.

The tables are pretty self-explanatory?

Or you could just do everything via the API and build your own front end, keeping the Discourse database structure and back end …