DEV Community

Cover image for I'm 15, Building My Own Social Media Platform — Here's How Its Backend Works
Puneet Kumar Mishra
Puneet Kumar Mishra

Posted on

I'm 15, Building My Own Social Media Platform — Here's How Its Backend Works

I was building a social media platform with a special algorithm to make engagement better for new users and communities, instead of being judged based on followers or compared to larger accounts!!

And this is how I'm here with Crowdwide.

Today, I'm gonna tell you about some of the breakdowns of Crowdwide.

How does Crowdwide actually work?

Crowdwide is a social media platform made using the MVC stack: MongoDB, Node.js, Express, and their dependencies.

Firstly, it has a basic authentication system that allows users to log in, sign up, reset passwords, and enable 2FA verification.

For 2FA, I created an authenticator system. Users have to scan a QR code using an authenticator app and enter the generated number to enable it. They need to do the same when logging in later. It also provides recovery codes, so users can still access their accounts if needed.

The main and most interesting part: How the feed is built

When I started building Crowdwide, I already had an idea that I wanted new users to get a chance to showcase their content too.

So, firstly, I came up with the idea of reserving a certain ratio for different kinds of posts.

It was something like this:

  • 40% for new users' posts
  • 40% for posts from larger communities/users with more followers
  • 10% for viral posts

And that's it. That's what I made in the initial phase.

But there were still some problems.

I thought, what if a post the user likes is at the very end of the feed? They would have to scroll through boring content before reaching it.

So, I made a scoring system to decide which posts should be shown first.

Posts with hashtags that the user likes get higher priority. Posts on which the user comments or reacts are also included in the score.

This gave me a slightly better feed.

But how would the feed know about a user's interests in the initial phase?

To solve this, I made an initial page where, when a user logs in for the first time, they're asked about their interests.

And now we have the user's interests and post priorities!

Still, something was missing.

Let's assume a user is watching content they like, but what if their interests change after two months?

So, I added one more thing.

Out of every few posts, there will be a new random post to see how the user reacts to it.

If the user starts liking it, starts a conversation, or reacts to the post, that interaction is counted.

So, there are two factors that determine which posts are shown:

  1. Interests selected by users.
  2. Changes in interests observed while they're browsing posts.

Some other things I added

  1. Role of each member in a community: I've made a kind of list based on the number of posts a user has published in a community. It is shown just below the member list in that community.

  2. Recently viewed, Followed topics, and Conversations: These are a few basic pages that I think I skipped earlier, but they're now added. I think you know how these work. Pretty straightforward!

  3. Trending discussions: I got this idea from the DEV community itself. The top trending posts from the last 24 hours are shown here.

  4. AMA (Ask Me Anything): It's a tag that you can enable in your post!

Yea, these are the main features I added...

Further, what do you think about it?

Links:
Crowdwide: https://www.crowdwide.run.place
Github: https://github.com/DeveloperPuneet/Crowdwide

Top comments (2)

Collapse
 
userxnom profile image
Abdullah Naseer •

The 40/40/10 split is a genuinely good answer to cold start — most feeds either bury new users completely or pretend the problem doesn't exist. Reserving 40% of the feed for new users is a real design decision, not a slogan. The part I'd push on is the exploration slot: a random post every few items is how you learn interest drift, but random also means a brand-new user with no signal yet can hit noise first. One thing I'm curious about: does the scoring decay over time, so a hashtag you liked two months ago counts less than one you engaged with yesterday? That drift handling is where most hand-rolled feeds quietly go stale.

Collapse
 
puneetkumar2010 profile image
Puneet Kumar Mishra •

Yes, I already have an interaction-based scoring system where user's selected interests, likes, comments and reactions affect the priority of posts.

I also have an exploration system where after every few posts, a new post is shown to see how the user reacts to it.

But your point about interest decay is interesting!

For example, assume a user was really into photography 2 months ago, but now they're mostly engaging with programming and AI posts. The feed shouldn't keep prioritising photography just because of their older interactions.

I'm thinking of implementing exponential decay for this.

Something like:

W = S × 2^(-t/H)

Where:

  • W = Current interaction weight
  • S = Original interaction strength
  • t = Time since interaction
  • H = Half-life

For example, with a 30-day half-life:

  • Today: 100%
  • After 30 days: 50%
  • After 60 days: 25%
  • After 90 days: 12.5%

So older interactions won't disappear completely, but their influence will gradually decrease. And if the user starts engaging with photography again, its priority can increase again.

And about random posts, I agree that completely random content isn't always the best approach.

I'm thinking of making exploration a bit smarter:

  1. Related interests: If someone likes programming, show them AI, web development, open source, etc.
  2. Adjacent interests: Occasionally introduce topics they haven't interacted with but might like.
  3. New creator discovery: Show relevant posts from creators they haven't discovered yet, especially smaller creators.

Also, I'll make sure one skipped post doesn't automatically mean the user dislikes that topic.

I think these two improvements together could make the feed much better at adapting to users instead of just showing them what they liked months ago.

Thanks again for pointing this out!!