<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aryaman Gandhi</title>
    <description>The latest articles on DEV Community by Aryaman Gandhi (@aryaman_gandhi).</description>
    <link>https://dev.to/aryaman_gandhi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4096423%2Ff21b1ae6-7028-4509-bb65-aba5ee133905.png</url>
      <title>DEV Community: Aryaman Gandhi</title>
      <link>https://dev.to/aryaman_gandhi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aryaman_gandhi"/>
    <language>en</language>
    <item>
      <title>We Didn't Build Multiple Versions of Our Game. We Built an App Store for Them.</title>
      <dc:creator>Aryaman Gandhi</dc:creator>
      <pubDate>Wed, 16 Sep 2026 17:07:23 +0000</pubDate>
      <link>https://dev.to/aryaman_gandhi/we-didnt-build-multiple-versions-of-our-game-we-built-an-app-store-for-them-1cmg</link>
      <guid>https://dev.to/aryaman_gandhi/we-didnt-build-multiple-versions-of-our-game-we-built-an-app-store-for-them-1cmg</guid>
      <description>&lt;p&gt;For the past few weeks I've been working on a stock market draft game with my teammates. You draft stocks by sector, hold them for years, and see how your picks would have played out. The core game was working, so the conversations shifted from "does it work" to "are these the right rules."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F823kmulep4gwuvj8x4gn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F823kmulep4gwuvj8x4gn.jpg" alt=" " width="799" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's where things got complicated.&lt;/p&gt;

&lt;p&gt;Too many good ideas&lt;/p&gt;

&lt;p&gt;Everyone had opinions on how the game should play. How many rounds? How many stocks should you see each round? Should you hold a stock for 3 years or 10? Should the board mix industries, or should some rounds be all tech? Should you split your money evenly or choose how much goes into each pick? Should you be able to sell halfway through and reinvest?&lt;/p&gt;

&lt;p&gt;Every idea sounded reasonable when someone described it. None of them could be settled by talking. You have to actually play a round to know if it feels good.&lt;/p&gt;

&lt;p&gt;So the ask was simple: make different versions of the game so we can try them.&lt;/p&gt;

&lt;p&gt;The obvious way (that we skipped)&lt;/p&gt;

&lt;p&gt;The obvious approach is to copy the real game a handful of times and change the rules in each copy. Real historical data, real scoring, the full thing.&lt;/p&gt;

&lt;p&gt;We thought about what that would look like a month later. Several codebases to keep in sync. A bug fixed in one version still broken in the others. And once we picked a favorite, most of that work would get thrown away.&lt;/p&gt;

&lt;p&gt;That's a lot of effort to answer a question that's really about feel.&lt;/p&gt;

&lt;p&gt;What we built instead&lt;/p&gt;

&lt;p&gt;We built one small website that works like an app store. The home page has a grid of cards, and each card is a different version of the stock game. Tap one, read the rules, and hit play.&lt;/p&gt;

&lt;p&gt;It's frontend only: no server, no API calls, no database. The companies and prices are fake. There's no score at the end either. The point isn't to see who won, it's to notice which version you want to play again.&lt;/p&gt;

&lt;p&gt;There are six preset modes:&lt;/p&gt;

&lt;p&gt;Classic Draft is closest to the original. 8 rounds, one stock per industry, money split evenly, and every pick held for 10 years.&lt;/p&gt;

&lt;p&gt;One Shot shows you a single stock each round. Take it or skip it, and decide whether it's worth 10% of your budget or 50%.&lt;/p&gt;

&lt;p&gt;Budget Boss is all about allocation. You have to spend a minimum on each pick, but everything above that is up to you.&lt;/p&gt;

&lt;p&gt;Active Trader throws 10 stocks at you every round, uses short 3 year holds, and lets you sell whenever you want.&lt;/p&gt;

&lt;p&gt;Sector Swap lets you sell a stock, but you have to replace it with one from the same industry that round.&lt;/p&gt;

&lt;p&gt;Sector Focus shows five stocks per round, all from one randomly chosen industry. You're not picking a sector, you're picking the best of one.&lt;/p&gt;

&lt;p&gt;And then there's a seventh card which is a Custom Mode builder.&lt;/p&gt;

&lt;p&gt;The card we almost didn't build&lt;/p&gt;

&lt;p&gt;Our first plan only had five fixed modes. When my teammate reviewed it, he pointed out two problems.&lt;/p&gt;

&lt;p&gt;First, the five modes didn't cover every option we'd been discussing. Nothing showed 10 stocks in a round, and there was no way to make a board where every stock came from the same industry.&lt;/p&gt;

&lt;p&gt;Second, and more important, picking five combinations meant we were locking in our guesses about what would be fun before anyone had played anything. That's the exact thing this project was supposed to avoid. If someone wanted to try a new combination next week, it would mean another round of development.&lt;/p&gt;

&lt;p&gt;So we went with both. The presets stay as quick starting points, and a Custom Mode card lets you set every rule yourself.&lt;/p&gt;

&lt;p&gt;How Custom Mode works&lt;/p&gt;

&lt;p&gt;Custom Mode is a single page with a section for each setting: rounds, stocks shown, hold time, how the board is filled, industry limits on your picks, how money works, and whether you can sell. Everything is a big tappable button instead of a dropdown, since a lot of us test on our phones.&lt;/p&gt;

&lt;p&gt;There's a row at the top to start from any preset and tweak from there. Below the form, a plain-English summary of your rules updates as you change things, like "5 stocks shown each round, all from one industry."&lt;/p&gt;

&lt;p&gt;The part I like most is how it handles combinations that don't work. If you ask for a board with one stock per industry but 10 stocks per round, it tells you there are only 8 industries and keeps the Start button disabled. Setups that work but might be surprising get a softer warning, like a 10 year hold in a 5 round game where nothing ever sells.&lt;/p&gt;

&lt;p&gt;When you hit Start, every setting goes into the URL. So when someone finds a combination they like, they just send the link and everyone else plays the exact same rules.&lt;/p&gt;

&lt;p&gt;One engine for everything&lt;/p&gt;

&lt;p&gt;What made Custom Mode cheap to add was that the game never knew about specific modes in the first place. Every mode, preset or custom, is just a set of settings, and one engine reads those settings and plays by them. The preset cards and the custom form both end up handing the same kind of settings to the same game.&lt;/p&gt;

&lt;p&gt;When we changed direction, the engine needed one new board type and a function to check configs. Everything else stayed.&lt;br&gt;
Making up a stock market&lt;/p&gt;

&lt;p&gt;For the original game we pulled real historical prices, and between API rate limits and missing data it took more work than we expected. For a prototype that felt like overkill.&lt;/p&gt;

&lt;p&gt;So we generated our own market: 80 made-up companies, 10 per industry, with 25 years of prices. Each company has a personality. Some grow steadily, some swing wildly, some slowly decline. Industries have good and bad years, and there's a crash followed by a recovery. We bumped it to 10 per industry specifically so an all-one-industry board could still show 10 stocks.&lt;/p&gt;

&lt;p&gt;Fake companies turned out to be better for this anyway. With real ones you end up playing from memory. With made-up ones, you're reacting to the rules.&lt;/p&gt;

&lt;p&gt;Three people working at the same time&lt;/p&gt;

&lt;p&gt;On the original game we mostly worked one after another, and at one point we spent an afternoon untangling merge conflicts from branches that all started at the same commit. We didn't want to repeat that.&lt;br&gt;
This time the first pull request was just the foundation: project setup, a shared file describing what a stock, a mode, and a game look like, and placeholder versions of every engine function with their final names. Once that merged, everyone knew what they were building against.&lt;/p&gt;

&lt;p&gt;Then we split the work by folder. One teammate built the engine: the config checks, drawing the board, buying, holding, auto selling, and reselling. Another teammate built the screens, like the stock cards, the four spending controls, the holdings panel, and the game over screen, all against sample data on a preview page so she never waited on the engine. I handled the fake market, the store pages, Custom Mode, and the final pull request that connected everything.&lt;br&gt;
Since nobody was editing the same files, merge conflicts were almost nonexistent.&lt;/p&gt;

&lt;p&gt;How we actually built it&lt;/p&gt;

&lt;p&gt;Before anyone wrote code, we wrote a detailed description for every pull request: which files to touch, the rules, the edge cases, and what the tests should check.&lt;/p&gt;

&lt;p&gt;Each of us took those into Cline in VS Code. I'd start in Plan mode and have it walk through what it was going to do before touching anything. That step caught more misunderstandings than code review did, because fixing a sentence in a plan is a lot easier than fixing a few hundred lines of code. Once the plan matched what I had in mind, I'd switch to Act mode, let it build, then run lint, typecheck, tests, and build before opening the PR.&lt;/p&gt;

&lt;p&gt;This helped a lot when we changed direction halfway through planning. We updated the PR descriptions and kept going. And because each PR said which files it owned, the changes stayed in their own lane, which matters when three people are working in the same repo.&lt;br&gt;
What I'd take from this&lt;/p&gt;

&lt;p&gt;If you're stuck choosing between versions of something, build the cheapest thing that lets you actually try them. Skip the backend, use fake data, and leave out anything that doesn't help answer the question.&lt;/p&gt;

&lt;p&gt;Keep your rules as data instead of hardcoding them. That one decision is why adding Custom Mode was a small change instead of a rewrite.&lt;br&gt;
And give people presets and a way to go off script. The presets get you playing in seconds, and the custom option makes sure you aren't limited by what the team guessed would be fun.&lt;br&gt;
What's next&lt;/p&gt;

&lt;p&gt;Now we play. Everyone runs through the presets, tries some custom setups, and shares links to the combinations they like. Whatever rules win get brought into the real game with real data and real scoring.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>nextjs</category>
      <category>showdev</category>
      <category>ai</category>
    </item>
    <item>
      <title>I Built a Stock Market Game in a Few Days</title>
      <dc:creator>Aryaman Gandhi</dc:creator>
      <pubDate>Wed, 26 Aug 2026 23:52:18 +0000</pubDate>
      <link>https://dev.to/aryaman_gandhi/i-built-a-stock-market-game-in-a-few-days-k2m</link>
      <guid>https://dev.to/aryaman_gandhi/i-built-a-stock-market-game-in-a-few-days-k2m</guid>
      <description>&lt;p&gt;The idea&lt;/p&gt;

&lt;p&gt;You're given a random year (2019-2022), then you pick one stock per sector without seeing prices. Eight sectors, eight picks. Allocate $10K however you want. See how you would've performed in that year.&lt;br&gt;
The mechanic is pure strategy. You know the year upfront. So the question becomes: which stocks will do well in 2022? Or 2019? That forces you to think about what actually happened in those markets. Tech dominated 2019-2021, got crushed in 2022. Energy was dead for years then suddenly mattered.&lt;/p&gt;

&lt;p&gt;You can't rely on current sentiment. You have to think about historical context and sector rotation. Pick Apple for 2022 and you're in for a rough time. Pick it for 2019 and you're golden. The game forces you to actually know something about what happened in different years, not just have opinions about which companies are good.&lt;/p&gt;

&lt;p&gt;It's interesting because most people don't think about markets this way. We know what's happening now. We have opinions about what's good now. But actually understanding how different years played out differently? That's harder. And more useful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz6t3n2s1wrq50gwe8cbh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz6t3n2s1wrq50gwe8cbh.jpg" alt=" " width="799" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Building it&lt;/p&gt;

&lt;p&gt;I started with the roughest possible version. Just enough to see if the idea was even playable. A basic draft flow, mock data, and a simple calculation to show returns. Nothing polished. No styling, minimal logic, just the core mechanic working.&lt;/p&gt;

&lt;p&gt;But that rough version was worth everything. Because the moment I had something interactive, I knew the idea worked. I wasn't building abstractions anymore. I was playing a game I'd made. And that's when you actually know if something is fun or not. You can't know that from a design document. You have to play it.&lt;/p&gt;

&lt;p&gt;The tricky part was the data. I needed historical stock prices for ~140 tickers across 4 years (2019-2022). Not just any data either, I needed to organize it by year, handle tickers that didn't have complete data (some companies went public after 2019, some got acquired), and make it queryable without hitting an API at runtime. The whole game needed to work client-side, which meant all the data had to be baked in.&lt;/p&gt;

&lt;p&gt;Fetching the data itself was a challenge. The API I was using had rate limits, and pulling data for 140 tickers across 4 years meant a lot of requests. Had to add delays between requests, handle failures gracefully, and retry when things timed out. Once I had all the data, organizing it into a structure that made sense for the simulation took a couple iterations. But once the data pipeline was solid, everything else fell into place.&lt;/p&gt;

&lt;p&gt;After the data pipeline worked, I added tests because the return calculations were complex. You're buying shares on the first trading day of a year at the opening price, then selling on the last trading day at the closing price. If you mess that up, the whole game gives wrong results. Tests caught bugs that would've shipped broken.&lt;/p&gt;

&lt;p&gt;Built a UI that didn't look like it was thrown together in an hour. Used React components, Tailwind for styling, kept it clean and simple. Restructured things a few times to make the code cleaner.&lt;br&gt;
The whole process was straightforward though. I didn't overthink it. I didn't spend days planning the perfect architecture. I just built it, saw what worked, and iterated. That's faster than you'd think.&lt;/p&gt;

&lt;p&gt;Tools&lt;/p&gt;

&lt;p&gt;Used Cline to write most of the code. Also used Next.js, TypeScript, and Tailwind. Historical data from Twelve Data. Nothing fancy, just tools that work together.&lt;/p&gt;

&lt;p&gt;Cline handled the heavy lifting: the simulation logic, the UI components, catching edge cases I didn't think of. I could've used other tools, but Cline's reliability mattered. It never broke something that was already working. When I asked it to refactor the data pipeline, it didn't touch the simulation logic. When I asked it to add a new feature, it didn't accidentally break the tests. That consistency matters more than raw speed when you're trying to ship something.&lt;/p&gt;

&lt;p&gt;The other thing that helped: being able to think through problems conversationally. "Here's what I'm trying to do, here's why it's not working, what should I try?" That back-and-forth helped me understand the problem better, not just get code faster.&lt;/p&gt;

&lt;p&gt;What stuck&lt;/p&gt;

&lt;p&gt;Shipping something rough beats perfecting something theoretical. I catch myself trying to build perfectly all the time. Spending days thinking about architecture, arguing with myself about the right approach, optimizing before anything ships. This time I just didn't. Had something playable in hours. Everything after that was making it better, not building from scratch.&lt;/p&gt;

&lt;p&gt;Tests give you confidence to refactor. Each change made the code better and tests made sure nothing broke. Tests aren't overhead. They're freedom.&lt;/p&gt;

&lt;p&gt;What's interesting about the mechanic&lt;/p&gt;

&lt;p&gt;The game actually teaches you something about markets. Everyone thinks they know which stocks are good. But "good" is context-dependent. The same stock performs completely differently depending on the year.&lt;/p&gt;

&lt;p&gt;You realize how much sector rotation matters. Energy stocks were terrible for years. Mining stocks, oil companies, all garbage from an investor's perspective. Then 2022 hit and suddenly they were the best performers. Interest rate hikes, inflation, oil prices spiking. The entire context changed.&lt;/p&gt;

&lt;p&gt;Tech did the opposite. Up massively for three years straight. Anything tech-adjacent was printing money. Then 2022 came and valuations compressed hard. Companies that seemed unstoppable got cut in half.&lt;/p&gt;

&lt;p&gt;Playing the game forces you to think historically instead of just having opinions. You can't just say "Apple is good." You have to know why it was good in 2019 but rough in 2022. What changed? What was the macro environment like? Why did investors care about different things?&lt;/p&gt;

&lt;p&gt;That's actually useful knowledge. It teaches you that markets aren't random, but they're not predictable either. Different years reward different things. Understanding that is worth more than just having strong opinions about stocks.&lt;/p&gt;

&lt;p&gt;What's next&lt;/p&gt;

&lt;p&gt;I want to add features like leaderboards, charts, and multiplayer eventually. But for now, I'm just sitting with having shipped something. Something that works. Something people can actually play.&lt;br&gt;
That's the win. Not the perfect architecture. Not the most optimized code. Just: I had something to build, and now it exists, and people can use it.&lt;/p&gt;

&lt;p&gt;If you're thinking about building something, don't wait for it to be perfect. Build the rough version. See if anyone cares. Then iterate. That's how everything gets made.&lt;/p&gt;

&lt;p&gt;Check it out: &lt;a href="https://github.com/ethantao14/cline-stock-market-game" rel="noopener noreferrer"&gt;https://github.com/ethantao14/cline-stock-market-game&lt;/a&gt;&lt;/p&gt;

</description>
      <category>stockmarket</category>
      <category>ai</category>
      <category>coding</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
