In WebAssembly's current form, we can pass numbers between a Wasm module and JavaScript code with relative ease. An accounting application seems like a logical choice in terms of real-world applicability. The only contention I have with accounting software is that it's a little boring (no offense). We're going to spice it up a bit by building in some unethical accounting practices. The application is named Cook the Books, a term associated with accounting fraud. Investopedia provides the following definition of Cook the Books:
The Investopedia page at https://www.investopedia.com/terms/c/cookthebooks.asp offers detailed examples of what constitutes cooking the books. We'll take a simple approach for our application. We will allow the user to enter a transaction with a raw and cooked amount. The raw amount represents the actual amount of money that was either deposited or withdrawn, while the cooked amount is what everyone else will see. The application will generate pie charts that display expenses and income by category for either the raw or cooked transactions. The user will be able to easily toggle between the two views. The application consists of the following components:
- Tabs for switching between transactions and charts
- Table that displays transactions
- Buttons that allow a user to add, edit, or remove a transaction
- Modal dialog for adding/updating a transaction
- Pie charts to display the income/expenses by category