A calculator to help myself deal with the food fine collection matters in Anglo-Chinese School (Independent) Boarding School.
The calculator takes care of all the boarders' deposits and debts. The user just needs to key in how many breakfast / lunch / dinner that each boarder skips when fining him, and how much each boarder pays in cash when the boarder is paying off his debt.
Framework: electron
Database: NeDB
UI (CSS Framework): Materialize CSS
- Clone the repository (using HTTPS:
git clone https://github.com/CT15/FF-Calculator.git) - Depending on your OS, run the following from
FF-Calculatordirectory:- Linux
$ npm run package-linux
- Mac
$ npm run package-mac
- Windows
$ npm run package-win
- Find the application inside the
release-buildsfolder and run it
- Go to
Settingstab - Click EDIT button
- Edit the price of breakfast / lunch / dinner
- Click DONE button
- Go to
Deposittab - Click + button
- Observe that an
Add Studentwindow appears - Fill in all the fields (name and deposit amount)
- Click ADD button
- Go to
Deposittab - Click on EDIT button beside the student name you want to edit
- Observe that an
Edit Studentwindow appears - Change necessary field(s)
- Click DONE button
- Go to
Deposittab - Click on FINE button beside the student name you want to fine
- Observe that a
Fine Studentwindow appears - Key in the number of breakfast / lunch / dinner that the student skips
- Click FINE button
P.S. If the amount of fine is greater than the student's deposit, you will be able to see the student's debt at the Debt tab.
- Go to
Debttab - Click PAID if the student pays the exact amount of money (done), OR
- Click PAY if the student pays more or less than this debt
- Observe that a
Pay Debtwindow appears - Key in the amount paid by the student.
- Click PAY button
P.S. If the amount paid is greater than the student's debt, the remaining amount will be added to the student's deposit.
This project is available under the MIT license. See the LICENSE file for more info.
As there are many renderer windows involved in this program, many of the data is passed arounf using ipcRenderer and ipcMain. Many of the ipcMain end up having the same functionality while listening to different channels. In the future, more strategic naming of the channels can reduce the channels that the ipcMain needs to listen to.
The mainWindow.html file contains 3 tabs, and each has its own Javascript file in the HTML file to do processing. An example of duplicates is the initialisation of the DataSource object since all 3 tabs require DataSource object. My solution for this project is to extract the common modules out into a separate Javascript file. Another way that I can consider is to have separate HTML file for each of the tab. In this way, each initialisation in the Javascript files will not clash as they are contained in different HTML files.
