Price It Right is a pricing and demand simulator built with React, TypeScript, and Vite. You drag a price slider and Chart.js redraws demand, revenue, and profit live, and every so often a random market event (a crash, a new competitor, a viral trend) shows up and forces you to react instead of just watching the numbers. I built it as a final project meant to teach the pricing and supply & demand unit in Tesla STEM High School's Business & Econ class, and the course has since adopted it as official teaching material.
Pricing, elasticity, and profit optimization usually get taught with static graphs and formulas like Profit = (Price − Cost) × Demand, which describe how price and demand relate but never let a student watch it change. Students could recite that raising the price lowers demand, but had no hands-on way to explore the actual shape of that tradeoff, or to see how a shock like a competitor entering or a market crash moves the best price.
Live Chart.js demand curve driven by a single price slider
A single responsive slider controls price. Every change recalculates demand through an elasticity function and immediately redraws the Chart.js demand curve next to live revenue and profit numbers.
Reason:
Instant visual feedback turns an abstract formula into something students can figure out by trial and error. Moving the slider and watching profit climb, peak, and then fall explains elasticity a lot faster than a lecture does.
Tradeoff:
One simplified elasticity model is less rigorous than a full econometric demand model. It trades realism for something intuitive enough to teach with in one class period.
Randomized market events layered on top of the base simulation
A "Trigger Random Event" action can inject a market crash, a new competitor, or a viral trend, and each one temporarily reshapes the demand curve so the student has to find their optimal price again.
Reason:
Static pricing exercises teach students to find one right answer, and real markets don't hold still. Random events make students practice adjusting their pricing instead of reading a curve once.
Tradeoff:
Random events make outcomes harder to compare directly between students in a classroom, which the "Reset Market" control helps with by letting a scenario be replayed from a clean state.
- Adopted as official teaching material in Tesla STEM High School's Business & Econ class for the Pricing, Supply & Demand, Game Theory, and Econ Strategy units.
- Fully responsive slider-driven UI that models Profit = (Price − Cost) × Demand and Revenue = Price × Demand in real time.
- Something built to understand a concept yourself can end up being useful to a whole classroom. This went from a personal final project to the course material.
- The random events are what make it a practice tool. Without them there's one right price, and once you find it you're done.
