David Mashiah

Note · Real-time systems

SkillSwap had 700 users. Then I priced a message.

In 2024 I built a social network without knowing how to code. It reached about 700 users. Private messaging did not die because I could not write it. It died when I worked out what every message, every like and every read would cost, and the bill had no ceiling I could pay.

In the summer of 2024 I decided to build a social network from scratch, without knowing how to code.

There were no AI tools then that could write and run code for you the way they do now. I started with nothing and learned on the way.

Two weeks to a working feed

It was called SkillSwap. I built it on Firebase. After two weeks of a lot of work it had a feed, working profiles, likes and comments.

People used it. It reached about 700 users, maybe a little fewer. Then I started on the feature a social network is mostly for: private messages between people.

Every like had a price

That is when I read the pricing properly. Firebase bills per operation. A like is a write. A message is a write, and every time someone opens the conversation it is read again. Everything a user does is a line on the bill.

I worked out what messaging would cost for the users I already had: something like 500 dollars a month, before any growth. Unless the platform went viral fast, I had no way to fund that.

So messaging stopped there. Not because the code was too hard. Because the bill grew with exactly the thing I wanted to grow, usage, and nothing in my plan grew with it to pay.

The 10,000-line file

There was a second problem, and it would have caught up with me anyway. The backend was one Express.js file of more than 10,000 lines.

Every change meant finding the right place inside it, by hand. Adding messaging to that file was going to be painful whatever it cost to run. Even today, with AI tools that can read code, a single file that size is a bad place to work.

What I do differently now

Two rules came out of SkillSwap. The first: modularise everything, and decide the maximum length of a file before the project starts, not after it has grown. Everything I build now has that limit, and a check refuses the commit when a file crosses it.

The second: the running cost is part of the design, and it has to be read before the first line, not discovered after the first users. When I later built 1 vs 100, a live quiz where a whole lecture hall answers at once, it ran on Cloudflare’s free plan: one Durable Object per room, outgoing messages free, idle connections costing nothing.