Budgetary control to plan your expenses and savings.
- Technologies Used.
- How data is stored/retrieved in this application?
- Application Demo
- Description of data in
localStorage
. - Problems, Issues, and Solutions.
- TODO.
- Ideas for future improvements.
- HTML
- CSS
- Vanilla JavaScript
Live Demo: https://belalmosad.github.io/Budget-Manager/
The application relies on JavaScript's window
property: localStorage
as the method of storing/retrieving data.
-
localStorage.data
: associative array contains all the expenses data displayed in the table. key is item ID number, while value is an array that contains:- Expense category (Grocery, rent, transportation, ..etc).
- Description.
- Cost
- ID number
-
localStorage.nextID
: numeric value that assigns an ID number for the record. -
localStorage.totalBudget
: contains the total budget that the user can spend. The value is entered and edited by the user. -
localStorage.totalExpenses
: contains the total value of the expenses, when the user enters an expense item (e.g. car rent that costs 50$), the cost value (i.e. 50$) is added tolocalStorage.totalExpenses
. -
localStorage.remainingBudget
: contains the left amount of money after adding expenses. This value cannot be negative value, if the user attempts to add an expense item that costs more than theremainingBudget
value, the item will not be added, and the user will be informed he cannot add these expenses.
-
-
-
Problem 3: When click on the update ✎ button, a new form page should open, how to pass the data of a specific record to the update form page so that the form is filled with the original data to be updated?
-
localStorage.setItem("updateItemData", JSON.stringify(dataArr));
Then, after finishing the update process,localStorage.getItem("updateItemData");
localStorage.removeItem("updateItemData");
-
-
Problem 4: When trying to add new feature (quantity of each record), I faced alot of problems editing my code .. it was a miss.
- Solution: Realizing that the code was not clean enough to add new feature easily. So, I started learning practices of writing clean code and Design patterns in JavaScript (Not Implemented yet). But as an initial step, I separated dealing with data in a separate interface
DataModel
, and relied on an objectExpenseItem
instead of just an array.
- Solution: Realizing that the code was not clean enough to add new feature easily. So, I started learning practices of writing clean code and Design patterns in JavaScript (Not Implemented yet). But as an initial step, I separated dealing with data in a separate interface
-
- Solution: Using css property
display: flex
and wrapping it in class:row
, then using it for through the other components.
- Solution: Using css property
- Implement basic HTML and CSS for home page.
- Implement HTML and CSS for add expense page.
- Implement info legend that contains total budget, total expenses, and remaining budget.
- Implement add one item functionality.
- Implement delete all data.functionality.
- Implement delete single expense item functionality.
- Add constraints on total budget input (non negative real numbers).
- Add edit buttons for each expense record.
- Implement HTML and CSS for Edit single expense item.
- Implement Edit functionality for each expense item.
- Fix bugs with info legend.
- Implement data visualiation feature.
- First: Build a custom button for openning the visualization page.
- Second: Add the page of visualisation data.
- Third: Implement the visualization elements (normal divs bars).
- Fourth: Add dynamic data to the visualisation elements.
- Fifth: Animate the divs.
- Implement responsive design for main page.
- Implement responsive design for form page.
- Fix Issue: Responsive Issue when adding long description in data table.
- Implement responsiveness to Edit item form.
- Build custom Confirm, prompt, and alert components instead of relying on browser's built-ins.
- Implement pie charts in visualisation section.
- Aggregate each category in one separate table alongside with the main containing table.