However, building out a user account system this way is probably theroetically doable, but definitely not practical.
Maybe we need a hybrid site generator. We could still write the content as seperate text files, but we would have the ability to integrate comment sections, user profiles etc. seemlessly.
Our posts could be parsed and recorded onto a database, for better indexing, search, analytics and reducing redundancies.
The generator would come with a web server and handle everything we throw at it. From ssl to comments to databases.
That's the future I dream of. Not full blown CMSs, but not web 1.0 either.
The Forestry.io blog has a number of articles covering some of these topics:
* eCommerce – https://forestry.io/blog/snipcart-brings-ecommerce-static-si...
* Search – https://forestry.io/blog/search-with-algolia-in-hugo/
* Forms – https://forestry.io/blog/5-ways-to-handle-forms-on-your-stat...
* Advanced Image Handling: https://forestry.io/blog/master-image-delivery-with-cloudina...
* Building APIs – https://forestry.io/blog/build-a-json-api-with-hugo/
Regarding user profiles, the Forestry website itself is built with Hugo and has a Rails app to handle profiles.
EDIT
I know you don't want to rely on third party services, but if it's possible to handle this with third party services then surely open source alternatives could be built.
It's not ideal, but it is as close as I have come to showing someone an article and asking for their comments IRL.
[1] https://discourse.gohugo.io/t/static-site-behind-login/10100