Overview
DRINK I/O is a desktop inventory application for small enterprises. The product aims to increase the productivity and efficiency of companies by digitizing the paperwork.
Most of the user interactions are via CLI, while there exists a GUI created with JavaFX. It is written in Java and has about 10kLoC.
Summary of contributions
-
Major enhancement 1: Partition command into 3 roles (manager, accountant and stock taker)
-
What it does: Allow 3 roles to do explicit command that only related to their roles(more details are in the user guide)
-
Justification: This prevents one user from misuse or abuse other user commands. Hence, it increases the security of the application.
-
Highlights: The implementation too was challenging as it required changes to existing initiation,model, storage. SOLID principle are followed.
-
-
Major enhancement 2: User login
-
What it does: Allows different user to login to the system.
-
Justification: This features increase the security of the product significantly because it restrict the application user to account holder.
-
Highlights: The implementation too was challenging as it required changes to existing initiation and UI. It also create a standalone "addressbook" that stores user information using JSON file. I have use javax.crypto and other java function to hashed and verify password. Credits: learning material
-
-
Minor enhancement: Create command and command parser for the product
-
Minor enhancement: Create individual help window for respective roles.
-
Code contributed: [Reposense]
-
Other contributions:
Contributions to the User Guide
Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users. |
Logging in
Upon entering starting up the application, you will be met by the login page below:
To login, you can use either the CLI or GUI to input your USERNAME
and PASSWORD
.
GUI Login
-
Enter your
USERNAME
andPASSWORD
into the respective username and password fields -
Click on the LOGIN button
CLI Login
-
Enter your
USERNAME
andPASSWORD
into the terminal in this format-
Format:
USERNAME
PASSWORD
-
-
Press the ENTER key
|
Examples for CLI input:
User Name | Password | Authentication Level |
---|---|---|
tester |
123 |
ADMIN |
manager |
123 |
MANAGER |
stocktaker |
123 |
STOCKTAKER |
accountant |
123 |
ACCOUNTANT |
The example provided is a default login account for admins. This account is created only for testing purposes. |
After successfully logging in, a confirmation message would be shown indicating your authentication level:
Logging out
Logging out of the application will bring you back to the login screen.
-
To log out, enter the following command into the command bar
-
Command format:
logout
-
-
Press the ENTER key
Managing Your Drink I/O Account
Drink I/O has a login feature. This ensure that every user has to have an account before using the application. Hence, it would increase the security of the application.
Confirmation of Command
When you enter command that will change the data storage, you will be prompted with a message as shown below:
If you have confirmed the command, key in y or Y to confirm.
Changing your password
When you receive an account from manager, you want to change the password to increase security.
Format: changePassword o/[OLD_PASSWORD] n/[NEW_PASSWORD]
Examples for changePassword:
-
changePassword o/123 n/1234
If password changes is successful, a message will be shown:
Create additional account
As a manager or administrator, you want to create new account for new employee.
Format: createAccount u/USER_NAME p/PASSWORD a/AUTHENTICATION_LEVEL
AUTHENTICATION_LEVEL
must be one of:
-
ADMIN
-
MANAGER
-
STOCKTAKER
-
ACCOUNTANT
Examples for create new account:
-
createAccount u/tester2 p/myPassword a/ADMIN
If create account is successful, a message will be shown:
Delete account
As a manager or administrator, you might want to delete a account when it is no longer used.
Format: deleteAccount u/USER_NAME
Examples for delete old account:
-
deleteAccount u/tester
If delete account is successful, a message will be shown:
Contributions to the Developer Guide
Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project. |
Command partition
Current Implementation
The command partition is an implementation of the role system.
The model
contain all the
API that is common for every user. StockTakerModel
contains API for for stockTaker. Similar
idea applied to AccountantModel
and ManagerModel
. However, AdminModel
extends all three models.
As such, adminModel
will contains all APIs.
After login, logicManager
will assign a particular role to user according to their
authenticationLevel
. As such, it will prevent one role from accessing other role’s
command.
=== Login/logout feature
Current Implementation
The login feature is a standalone feature that enable security check on user. It has a fxml page that name LoginPage.fxml
at main\resources\view
The controller of the fxml page named LoginController
at seedu.address\controller
The model of is at loginInfo
which storage the format in JSON with the help of JsonUtils
.
Also, there is a loginInfoManager
which include all the API for loginInfo
.
As such, this is a design that fulfil the Model-View-Controller pattern.
Given below is a class diagram for login function. LoginUtils has attributes of LoginInfoModel
userName
and Password
. It also use passwordUtils
to hashed verify the password with LoginInfoModel
Given below is an example usage scenario and how login mechanism behave at each step.
The LoginController
will check for username and password will the LoginUtils
.
Save information about user account
Given below is a structure of Model
components that is related to login feature.
The model stores loginInfo of the user.
The sequence diagram below shows the interactions within the logic components for the execuion of createAccount
command.
Given below is an sequence diagram of access login information for loginInfoList.json
during initiation of the application.
The program also save the the login information to loginInfoList.json
when logout
or exit
.
Design Considerations
Aspect: How to store the data
-
Alternative 1 (current choice): Saves the login detail in a json file called
loginInfoList.json
.-
Pros: Have a systematic and elegant way to store data.
-
Cons: Hard to implement
-
-
Alternative 2: Store the data in enum.
-
Pros: Easy to implement
-
Cons: Fixed database. Cannot add /modify/delete accounts. (suitable for very small project)
-
Aspect: Data format for store data
-
Alternative 1 (current choice): Store in Json file.
-
Pros: Json is popular and have many support online.
-
Pros :JSON is relatively easier to implement compared to XML
-
Cons: Have to write serialized method for JSON file.
-
-
Alternative 2: Store in XML file
-
Pros: Classic and matured product
-
Pros: Have serialized code in original ab4.
-
Cons: It has many rules to set before implementation.
-