If I was building a new forum software today...
February 12, 2018, 01:48:43 am
I've thought about what it would look like if I were to build a new forum application many times over the years. Every time I think I learn something new and add or remove some ideas from my previous thoughts. I have no intention of creating something new, but if I were this is what I think it would look like...Built in Javascript Typescript It's not that I think Javascript is a great language because I don't. I think the lack of types makes it hard. Typescript adds something there, but it's not true type safety. You only get so far with it. What I like about JS/TS is that I can write isomorphic code, any frontend developer can read most of the backend stuff, and there's a package to do everything. The last part might not be a good thing, but for someone looking to bootstrap something quickly, they can just pick one and be on their way. I'd use React + Redux and all of the great things that go with that. There would be server-side rendering. I'd require JS for any interactions but since the site is server-side rendered, a user wouldn't need it to display public content. I could do so much with caching and an ORM since the Node process would build when it starts and wouldn't have PHP's awesome (and sometimes horrible) "know nothing" startup.Mostly static Most pages would be static with only user-specific content (login state for instance) and actions (post, reply, moderation, etc) having to be generated. The entire public-facing site can be static with those pieces loaded dynamically. That means it could all be pushed to a CDN. If you make a change to the theme, it would flush that cache and start recompiling all pages. A separate process would build them or when a user visits a page that wasn't already built. You might even be able to host a whole forum on Github. Any posts that aren't accessible to all would be served after authentication and authorization, but they would be injected onto a page and would be cached.Microservices It is hell to setup, but once you do, you can run a massive forum using AWS Lambda functions and not have to worry about scaling it up/down. So long as your code is written as many microservices. I'd probably tie it all together with a message queue. A user wants to see the post they made after they made it, so I'd probably cache that locally until the MQ caught up with actually posting it.GraphQL Much of the site would work using GraphQL. With all of those microservices, you want to have a layer that will grab the information without returning too much. This is extremely important for low-bandwidth devices.WebSockets On a busy site, I always feel like I'm missing something because I have to keep refreshing the page. I feel like a WS would help me with notifications. Also, I could run all of the GraphQL queries through it. I could also use this to track where I left off in a conversation.More like Slack with rich text than email I want a site that feels like a lot of little conversations going on. I'd probably have a bar on the left with conversation I'm participating in. When someone replies, it would show a number of the replies since the last time I saw it. I want to be able to compose messages like an Office document though. I used to hate the WYSIWYG editors. Now I value my keystrokes and want to save myself from having to type out the characters. I want the Word or Google Docs editor. I want my posts to have the structure that HTML has provided.PWA Progressive Web Apps are the new hot thing and for good reason. I think forums fit perfectly with them: long conversations that may be read and responded to on mobile at varying times. I'd love to be able to start reading a topic on the train, then reply to it while without an internet connection, but have it upload when I do. I think a shortcut for my favorite forum on my mobile home screen would help me read it much more often.Material Design I am only using it as an example, but I want to highlight a lot of the UX research that companies like Google, Microsoft, and Facebook have done.So much more There's so much more I'd do, but it's late. Maybe I'll write more later.