These will be good starting points / sources of inspiration for how our plugin directory works:
This is the post where I discussed how I set this up.
There’s also this one in the repository: https://wordpress.org/plugins/wp-plugin-update-server/ - it has an example theme/plugin as well as option for license keys on premium products.
Not tested yet!
Ran across another one today: https://wppusher.com/
It has been closed on the 20th March 2019…
So why would that be banned, but this allowed: https://wordpress.org/plugins/cloud-blocks/
I think their reasoning is that the code for the blocks never ends up on the server.