Back to Blog
GeneralAUG 20, 20264 Min Read

From Localhost to the Market: Building iMockMarket and Fixing My Past Mistakes

Building iMockMarket: How I created a stock trading simulator with leaderboards and trade-shadowing while cleaning up past code mistakes.

From Localhost to the Market: Building iMockMarket and Fixing My Past Mistakes

I want to learn stock trading, but I don’t want to get burnt.

It’s a familiar story many people can relate to. I was genuinely interested in getting into the stock market space early last year (specifically around February 2025). However, I had heard the stories of how people lost money in the stock market and how, to some, the market was nothing more than a shark waiting to attack those unwary enough to venture into its waters. How, then, do I acquire the knowledge required to navigate said "waters" while remaining afloat long enough to avoid getting bit?

My first thought was that I should build a simulator to experience stock trading without losing my hard-earned money. Now, before you judge; yes, I probably should have researched existing simulators before building one from scratch (do not reinvent the wheel and what not). However, I was a hot-blooded dev who felt he could develop anything he put his mind to (still do, if I'm being honest), plus I loved the challenge.

So what did I do? I got to building.

The first thing I needed was an understanding of the stock market and how it works. Since I had zero market knowledge, I reached out to a senior of mine, Victoria Awopetu, who was in the space to guide me. After a short conversation with her and a contact she recommended, I felt armed with enough knowledge to begin development.

And boy did I "build." Upon completion of my simulator, I took the natural next step: leaving it to fester on GitHub after minimal testing on http://localhost:3000/, like a real dev should.😉

Risk comes from not knowing what you're doing. — Warren Buffett


Fast forward to this year, and I randomly decided to start completing my backlog of existing projects. I came across iMockMarket and decided to review it because, again, why not?

The codebase that was my pride and joy last year looked like a complete hot mess to me. I had made some very critical security and engineering mistakes. Here are a few of my personal favorites:

  1. My JWT secret doubled as my API key (so leaking one leaked the other).
  2. I was logging sensitive information (like very sensitive information).
  3. I wasn't checking whether a user had sufficient funds before executing a transaction (free money for all I guess 🙂).
  4. I used floats to store money (not decimals, not minor units—floats, literal floats, with all their rounding error glory waiting to generate fractional penny discrepancies).

I fixed those errors and added several new features. One addition I am most proud of is the Shadow Feature, which allows users to let other users shadow their trades in real time using backend event triggers (don’t worry, followers won’t see your exact order quantities, just that you bought or sold specific shares). God knows I needed a social learning feature like that when I was just starting out!

Taking inspiration from Fantasy Premier League (FPL), I also built a custom Leaderboard feature. Users can create private or public leagues, invite friends, and rank each other based on percentage change in stock portfolio value over a set period. Nothing drives learning like a little friendly competition and trash talk! 😄

I’ve officially deployed it, and you can check it out live here: iMockMarket Live Demo.

Is it perfect now? Far from it. There are still features to add, optimizations to make, and plenty of room for improvement. However, building and refining iMockMarket didn't just teach me how to write cleaner code and avoid security footguns—it finally gave me the safe sandbox I wanted to learn trading mechanics without burning real cash. Revisiting this project showed me just how much I've grown as an engineer compared to where I started.


On to the next one!

P.S. It’s fully open-source! You can check out the repository code here: Frontend Repo | Backend Repo

Toluwalase Akinyemi

Toluwalase Akinyemi

Software Engineer & Law Student

Share

Related Insights

View All Posts
From Localhost to the Market: Building iMockMarket and Fixing My Past Mistakes | Toluwalase Akinyemi