HACKER Q&A
📣 _448

What tech-stack would you use for the following?


Lot of questions appear on HN about which tech-stack to use. So I thought let us all do a thought experiment together. I collected most common features required by apps today(you can suggest additional features, and I will include them in the post), and came up with a hypothetical product. Say, we want to develop a platform with the aim of monetising it and later scaling it to millions of users. The product has following requirements to start with:

0. A user should be able to login via various methods: username/password, finger-print, face-recognition. Login should support 2FA.

1. A user should be able to create a:

  1.1. Post.

    1.1.1 A post could have an optional title.

    1.1.2 A post could have optional tags.

    1.1.3 A post could be edited later.

    1.1.4 A post could be hidden by creator.

    1.1.5 Multiple creators could collaborate on a post; and a post could be moderated.

    1.1.6 A post could have comments and up/down votes.

    1.1.7 A post could be reported by users to the moderators of the platform.

    1.1.8 A user can mark a post as favourite.

  1.2. Request for post.

    1.2.1 A user can request a post on a topic from other users on the platform.

    1.2.1 As with the post, the request can have similar features e.g. title, tags, votes, comments etc.
3. A user can create a group; posts and requests can be posted to a group.

4. A group could be moderated, private, open, or invite-only.

5. Users will earn karma/points for the content they create and the upvotes they receive.

6. Users can create tags that they can use with a post or request. These tags will be available to others too.

Now, this is the basic requirement. But we are ambitious and we dream of building a platform that millions of users will use everyday. And we want to build more features into this platform later on; like specifying Authorisation for users, Real-time text, audio and video communication, collaborative editing, casual multi-player games like snakes-and-ladder, multilingual support, and support for web and native platforms like mobile and desktop. We also want a mechanism where multiple users can share an account, if required. Allow real-time notifications. Also, when we become a unicorn (heck, why not dream big ;)) we want users to be able to contact support using the platform. Later on we also want to do analytics, and also want users to know their history on the platform. And last but not the least, we want to add payments support where users will be able to pay each other for the content and the platform takes commission on each transaction.

Now, keeping these requirements in mind, and the often repeated mantra on HN that one should use the language and stack one knows best to start the project, my stack for the project is as follows(please suggest improvements to this C/C++ based tech-stack if you think it can be better):

Backend: C and C++, uWs, cppgraphqlgen, sqlpp11, postgresql(with pgpool, postgis, patroni, pgbouncer, greenplum), rethinkdb and haproxy.

Frontend: Flutter

What would be your tech-stack for this hypothetical project? Please chime in. Let the crowd be educated :)


  👤 willy_k Accepted Answer ✓
Sounds like a perfect application for an MVC framework. RoR is the most popular, but I would recommend Phoenix (and Elixir) for your project, specifically because you mentioned that scaleability was important to you, and Elixir has a very powerful concurrency and scaling model, as well as a bunch of other features from Phoenix that would benefit your project.

👤 alex14fr
Backend: PHP/MySQL Frontend: HTML, Vanilla JS

👤 c7b
Great discussion question! It's also interesting for people moving into web development to see what experienced devs think about this - the sheer quantity of tools and their fast-changing nature can seem quite overwhelming at first.

I just asked a related question [0], if you have any beginner-focussed opinions would appreciate :)

[0] https://news.ycombinator.com/item?id=32724950


👤 swah
In my case maybe Typescript + NodeJS + Prisma, rewrite the hot paths later in C++ (actually: Go) services.

👤 benstopics
My choice of techstack has nothing to do with the feature list because at the end of the day it is whatever gives you an advantage which is whatever you are better at than everything else so long as it has a rich third party library ecosystem to borrow from.

For the database I would choose PostgreSQL because you can rollback schema changes which you can’t in MySQL. SQL Server would also be good but it is more expensive which it is not always supported well depending on the platform, so you would end up gravitating towards Microsoft cloud services for convenience, which can get pricy if you’re not careful.

For the application layer I would pick either ASP.NET Core/C# if I was going the Microsoft route, otherwise Python all the way for everything. I admit that I always thought Python was comparable to PHP in terms of a terrible programming language, but I have discovered that the lack of types, similar to JavaScript, is it’s power. I will say in the wrong hands it will be a disaster for a large monolithic application due to lack of unit testing and clean code principles, and static typing is a great first line of defense from a regression testing standpoint. However, if you know what you’re doing, Python allows you to build infinitely complicated software at the speed of light which is exactly what a startup needs to be able to do: iterate as fast as you can. Build the MVP as fast as possible and user test it, and then go back and unit test as much as you can and also write e2e for the main workflows. If you don’t get into the habit of doing this, or don’t foresee yourself writing unit tests, avoid Python like the plague and stick to a typed programming language. I would not use your product at least because your site is going to go down at some point because a junior dev you hired had a typo and you were too tired or busy or lazy to properly review their code.

For frontend, React. I think any framework would be fine, including vanilla HTML/CSS/JS. I would vouch for any framework that has a lot of third party libraries, although the upside of React is how fast you can build things. I’ve heard of Angular and I’m sure there is so many more, if you’re familiar with it then you will probably be fine.

I know this is a hypothetical situation, but I think in reality you would not really know what all features your users want from the getgo because you have no users yet. One thing I noticed, and I know this is more to do with picking techstacks than a discussion on product market fit, but what is the problem you are trying to solve? It seems like you have a product in mind that you are trying to find a problem for it to solve, which is not recommended. Assuming this hypothetical scenario is in present day, it sounds like you would have Facebook, Reddit, Hacker News, and a multitude of other platforms to compete with. The problem they are trying to solve is that people want to connect with other people. It is interesting to point out that they all solve that problem in similar but different ways and are better at connecting certain kinds of personalities better than others. So I’d just be interested in whether you have thought about a specific type if person you are thinking of or have met that would be better suited for your platform than the others available?