The idea is pretty much have the server render a lightweight web page with all the meta information needed.
When one thinks SPA, you think well how's the search engine supposed to view it. Well, search engines are actually pretty good about rendering SPA these days, but only to an extent.
Like let's day it takes too long to render your dynamic content, well how's a crawler supposed to know that? You also may change the title and meta tags to make sure the crawler has the correct information.
Essentially render a barebones page on the server side with no real styling or anything. It would be called an index friendly page like printer friendly pages. Only search engine robots would be served this page and it isn't hard to do either. My rationale is that search engine crawlers ignore a lot of detail already, so what's the point of serving all of that extra data. Crawler doesn't care about your css or javascript for analytics or advertising, so why serve it.
Modify nginx to detect user agent and direct it to a server side rendered area. This server side rendered area could just be a multi page server or a lightweight ssr framework. You need the page to be able to connect to a data backend to fetch content to render. One could cache the page on the server side as well, but then you'd need to invalidate it whenever content gets modified yada yada blah blah figure it out, but I don't recommend it.
One should be able to re-create reddit with the server side index friendly version showing blocks of unstyled content. No javascript preferably since crawlers tend to be terrible at wrapping and/or executing the different styles of javascript.
I would be concerned though that search engines might penalize this activity since the index friendly page does not match the regular page. The alternative is just go multi page rather than single page if you really need SEO though.
I'm going to try it with this blog and some others to see what happens.
Also Wayback machine is a crawler, but apparently doesn't do a good job around newer styles of js since it wraps js. Like if you have import in your js script, wayback machine doesn't know to how to deal with that. Would it be worth to direct wayback machine to an index friendly page then? Depends on how you want it. If all you care about is data, then index friendly otherwise just go multi page.
On the topic of multi page, now I get there are frameworks around the idea of the "islands architecture" and I'm not very interested in them. Just find zero interest in "full featured" frameworks these days. I no longer want to switch between this and that. If the islands architecture ever gets to the point where it is implemented with minimal dependency libraries, I'll consider reading more about it.