Matrix Helper
⭐ NOTE: this project is a work in progress.
Algebraic matrix operations like inverting a matrix and converting a matrix to reduced row echelon form require precision. This tool helps high school students and their parents go to bed on time by letting them focus on the strategy behind matrix operations, not the computations. source code is on GitHub.
Technologies used:
- Nuxt
- Vue 3
- TypeScript
- Bootstrap
- Vitest
- Docker development environment
- Cursor Cloud Agents
Purpose and goal
Matrix arithmetic is easy to get wrong by hand, and the mistake usually hides in a step that you did 20 minutes ago. This tool:
- Applies multiply and add-and-replace row operations for you.
- Records each intermediate matrix in a step-by-step history.
- Keeps that history in the browser across refreshes (so when your undercaffeinated, late-night self accidentally closes the tab you don't lose 25 minutes of work) ☕
I also wanted a small public repository that shows how I write a Nuxt app: Composition API, TypeScript, tests, and a short written decision when a choice will be hard to undo later. The app is usable and still in progress.
Technologies used and why they were chosen
I chose Nuxt and Vue 3, with the Composition API, because that is the front-end stack I use for production work. I made the repository public so the code is an up-to-date example of how I write it.
I chose TypeScript so that I don't accidentally try to add numbers to strings. Bootstrap covers the forms, cards, and history list without a custom design system.
The matrix itself is a Map keyed by row number, starting at 1. An array of arrays
would have turned "row 2" into index 1 for the life of the project and that's just confusing. History goes in
localStorage. A high-school problem is a small matrix and a few dozen steps.
localStorage is synchronous, it survives a refresh, and it was familiar enough to
ship. IndexedDB would have been more capacity and more machinery than that data needs.
Session storage and in-memory Nuxt state both disappear too easily for a page you might reload
mid-problem.
Vitest covers the transformation math and the history helpers. ESLint, Prettier, Husky, and a
dev container (Node version pinned in package.json) keep the repository consistent
from one machine to the next.
Problems and thought process
The two decisions I wrote down before coding were how to store the matrix and how to store the
history. Both notes live in the repository. The matrix note compares an array of arrays, a plain
object, and a Map, and keeps the Map because get and
set read like the worksheet. The storage note rejects session storage and Nuxt state
because a refresh would erase the work. IndexedDB is overkill for a 3×3 problem, and its asynchronous
nature may make failue detection problematic.
The calculation that took the most care was add-and-replace. The finished matrix is one new row, but a student writes several lines: scale the first row, scale the second, add them into the row being replaced, then restore the row that was only borrowed. The history records those lines. Scaling a row by 1 is not recorded in the history because the matrix did not change.
A few gaps are still open. When history already exists, loading the page should resume at the last step. The add form can still name the same row twice. Enter does not submit the operation yet. These are things I plan to fix in the coming days.
Lessons learned
Recording the worksheet line by line mattered more than jumping to the final matrix. The value of the tool is that you can see how the matrix changed, which means the intermediate scaled rows have to stay on screen until the step where you would have unscaled them by hand.
Short decision notes kept those choices easy to revisit. Once the Map and
localStorage were written down, the components could assume them and the tests
could pin the step order.
Publishing the working RREF path, with the inverse page marked unfinished, was the right cut. The repository shows current code, including the parts that are still on the list.
Let's connect
If you'd like to talk shop about this project or a related open-source idea drop me a line.