Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 9.41 KB

Code UPDATES.md

File metadata and controls

36 lines (31 loc) · 9.41 KB

DAY 1: I created the Readme.md for the project and explained the main purposes and objectives of it. Added the first code of implementing the very basics of JavaSwing UI with a simple window opening up and showing the clients balance and a deposit button.\

DAY 2: I learned more about the Java Swing elements and how to use them properly such as JButton . I added a withdraw button.Also learned how to properly use withdrawBtn.addActionListener, which allows the application to listen to the user input and decide how to act taking advantage of the core logic i implemented. (Withdraw removes money and deposit adds to the balance variable declared.) But still this needs a bit of improvement since the balance also cant be negative or the user cannot withdraw any money which exceeds the balance amount.
DAY 3: Today i decided to improve further more the logic of the app some of the core functions of the withdraw button which does not allow the user to withdraw more money than the balance it currently has and it shows a dialog box using the command: JOptionPane.showMessageDialog(frame, "Balance is too low!"); Also learned about the time library and also java.time.format.DateTimeFormatter; . Using these two libraries i managed to show a label text on the top right of my app which contained the current date and time.My future plan for tomorrow is to implement a history log taking advantage of the specific time and date libraries i used so that each transaction is shown alongside the time it happened.
DAY 4: Today i created a history log which shows the exact real time a transaction happened.I created a label for the history log and also used JScrollPane to make it possible to scroll down until the end of the transactions history.I realized that the time was not moving and stayed the same as the first time the application started. That so happened because i belive it treats the time date format as a string and does not continue to update it in real time,so my next step is to correct this bug and make it fully funcionable.
DAY 5 I corrected the bug of time showing wrong after a deposit or withdrawal. Also resized the window and made it a bit bigger to be able to show all history of transacions. Using a funcition of the timer class public void actionPerformed, we will be able to update the time each second giving us a more up to date value. My next goal is to create a download button which saves all the users transactions into a txt file.
DAY 6 Added a download button which currently does nothing when pressed but working on making it fully usable to extract the history log into a .txt file. UPDATE- Made the Download History button work using imports of java.io.FileWriter and java.io.PrintWriter. Using those i was abble to print the first few lines of the Bank Statement into a txt file then using pw.print(historyLog.getText()); i got all the dettails of the historyLog pannel and pasted into the txt file. Also used try catch for any type of exeption or error we might interefeere during the way and made it so it shows the specific error on JOptionPane.showMessageDialog(frame, ex.getMessage()); Plans for tomorrow are to create a login page since that is the most important security step \
DAY 7 Today i created a new class called LoginScreen which will be used first when the aplication opens. It requires a username and a password (4 digit PIN) from the user to authenticate and get accses into the banking app. For now i have used a hard coded username (Orest) and a hardcoded PIN(1234). Also corrected some errors by transfering the main method to the LoginScreen.java. The app starts with the login screen then if details (username & PIN) are correct the application starts.Also added comments for each and every line i commited changes to make it easier to understand. Future plans for tomorrow are to style the login page a little bit and learn how to transfer the labels background colors or buttons in java swing ui, also add a text label at the banking app containing a welcoming sentence like "Welcome (username) ".
DAY 8 Today i styled the app a little bit by making it appear in the center of the screen because it would start in the corner. Changed the background color using the Color class, and also the font using the Font class. This made the app appear better and get rid of the older dull look.
DAY 9 Today i made some small color adjustments and also added a new JLabelWelcomeLabel which is esentially a welcoming message for the user different for each one since the constructor of BankingApp.java takes as a parameter String user. Then used a setter to set the username to a different string which then will be used in the public constructor without making the initial username public but keeping it private. Future plans are to maybe implement a data base with more than one user or at least make a save button which saves these,and keeps them stored in the application the next time the application opens
DAY 10 Today i will try to implement a save button for the user which will make the application actually save this data and then use it to load the next time the user logs back on and wants to make further transactions. I will be using a text file first since i dont have many information about databases and sql, but still i am working on learning how they work and maybe implement it in the future.
DAY 11 I was able to create the save button which takes all the user data(balance,transaction history etc) using java.io.printwriter and file writer. Also using the File class we open the created file next time the app launches to load the data. But still there is a problem since the app now is not launching propperly and crashes after inputing the username and password. I will try to fix that. UPDATE I was finally anle to fix the bug even though it took some time. The reason the app was not starting was because of a bad reading of the file i was making using the scanner class, also the balance would fail to parse into a double type since it also had the word "Balance: " typed in front. Now everything is working correctly and for the future maybe i wil try to add a loading screen or make it so i can register many users on it and each one has its own save progress in his/her account. DAY 12Today i noticed a small bug which was allowing the user to input negative values in the amount variable so in that way the app would take it as the opposite. I corrected that bug by adding a if control which checks it the amount inputed at the withdraw and deposit btn is clicked, if(amount<0) we would create a JOptionPane which would give us a message saying that the amount cannot be negative. \ALSO UPDATE i will not be working too much on this project the upcoming days since i will mainly focus on learning C++ because i have an exam but I will make sure to come back and make some small improvments here when i have free time(Mostly organizing code since now it kinda has gotten really messy and needs to be cleaned).

DAY 13 I have been very busy during the last weeks but as of now i have made some very big improvements to my application using some guidance from my ai assistant for mostly the security part and adding the feature so that new users can register. EXPLENATION FOR UPDATE -> In this update i have added lots of new features which were lacking in the previous versions. One of the most important ones is the password storing way. Each password created for an account is converted into a hash which is then saved into a txt file meaning even if our files get compromised reverse engineering a hashed password is near impossible. I have added a create new account option for new users. Currently it only has a easy way of registering by a username and a password which also has to complete some security checks (being 6 characters long minimum). As i said this version is a bit better and well upgraded from the last but i also note that many core fundementals for uploading a banking application are missing such as : 1.Text file storage - Not suitable for production 2. No password salting - Same password = same hash 3. No session management - App closes when window closes 4. No password recovery - If you forget password, account is lost 5. Single computer only - Data stored locally I will be looking forward into improving it day by day.

DAY 14 I have decided to update it more in appearance by changing colors and fonts. I seem to have made some mistakes by using git and mixing two different branches main and master. I tried to commit and push but i didnt know how to pull request into my main one so now my main goal is to fix it and keep it simple by just updating code from my main branch not the master branch.---> I was able to fix it after a while and realised it was a error, or a misunderstanding of mine since im not very familiar with git, i created two seperated branches main and master which bassically had the same structure, but my main goal was only to update the main java src code colors and fonts to make it more appealing to the eye. Now that i fixed it i might be leaving it for now , maybe add an exit or log out button and then see what i can add in the future. I added a button which logs you out of that user and brings you back to the main Login page. Also added another button which lets you exit the application entirely and it gives you another pop up window if you want to save your changes or not.