PROJECT: ForumBook


Overview

ForumBook is a desktop forum application which allows students to exchange information of the courses offered by their school. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in OOP fashion.

Summary of contributions

  • Code contributed: [Functional code]

  • Main feature implemented:: added various commands to enable admin to manage ForumBook

    • What it does: allows admin to better manage ForumBook by providing the following commands:

      • AddUser: add user to the ForumBook database.

      • Login: allow user to login to the ForumBook to Read and Share comments.

      • Logout: allow user to logout of the ForumBook safely

      • SelfDeleteUser: user is able to delete himself from the ForumBook database.

    • Justification: This user management feature provides the users the most basic commands required for the user to use the ForumBook. These user commands provide a convenient way for users to better manage the ForumBook.

    • Highlights: This user management feature provides the most simplest and efficient way for users to use/manage ForumBook. User could easily add themselves to the ForumBook, login to use the other features, logout of the ForumBook and if there is a need to, delete himself from the ForumBook. It also made ForumBook more user-friendly as it provides a better way of viewing data by showing the login status of the current user in the label at the top right corner, as well as showing the latest announcement in a pop up window.

  • Other contributions:

    • Project management:

      • Managed releases v1.1(1 releases) on GitHub

    • Documentation:

      • Did cosmetic tweaks to existing contents of the User Guide: #85, #107, 119, #187

      • Did cosmetic tweaks to existing contents of the Developer Guide: #8, #107, 119, #187

    • Community:

      • PRs reviewed (with non-trivial review comments): #154, #45, #29,

      • Reported bugs and suggestions for other teams in the class: #123, #119, #116, #104

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.

Register a new User : addUser

Register a New User to the Forum. User Name is unique and case sensitive.
Format: addUser uName/USER NAME uPass/USER PASSWORD

Examples:

  • addUser uName/user1 uPass/user1

  • User Name and password is unique and case sensitive.

logIn to the forum : login

Login to the forum with a registered user name and password.
Format: login uName/USER NAME uPass/USER PASSWORD

Examples:

  • login uName/user1 uPass/user1 === Delete a user(User) : deleteMe

User deletes himself from the ForumBook.
Format: deleteMe

Example:

  • deleteMe

Logout from the forum : logout

Logout from the Forum.
Format: logout

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.

User management

Current Implementation

The user management is facilitated by various commands. It extends ForumBook with a user management tool. Additionally, it implements the following operations:

  • AddUserCommand — Add user to forum book.

  • LoginCommand: login to forum book.

  • LogoutCommand: logout from the forum book.

  • UserDeleteCommand: Self delete a user from the forum book.

Given below is an example usage scenario and how the user management behaves at each step.

-----------------------------------------------------------------------------------------------------------------------------------------------------
Given below is an example usage scenario and how the user management can be operated by user at each step.

Step 1. The user executes addUser uName/UserName uPass/password to add a new user into forum userStorage file. The addUser command calls 'unitOfWork.getUserRepository().getUserByUsername(userToAdd.getUsername())' to check if the name entered by the user is available. If there is not duplicate, User can be registered. If the registration is successful, addUser command calls UnitOfWork.commit() to save the modified forum book state into UserStorage.

Step 2. The user executes login uName/UserName uPass/password to login to the forum. The login command calls 'unitOfWork.getUserRepository().authenticate(userName, userPassword)' to check if the login can be authorise. If success, login command calls Context.getInstance().setCurrentUser(exist) to create an instance for the authorised user.

Step 3. The user executes logout to exit the forum or to switch user, logout command calls 'EventsCenter.getInstance().post(new UserLoginEvent("", false, false))' to close the instance created by the user. Next/ another user is able to login after a successful logout.

ToDo: Step 4. The user executes `UserDeleteComment ` to remove himself/herself from the forum book. User data will be removed from the storage.

-----------------------------------------------------------------------------------------------------------------------------------------------------
=== Registering and logging in

  1. Registering a new user

    1. Prerequisites: username must not be registered before.

    2. Test case: addUser uName/john uPass/123 Expected: the user john will be added to the UserStorage if there is no duplicate in the UserStorage.

  2. Loggin in

    1. Test case: login uName/abcd uPass/123 Expected: Log in with a random username and password that has not been registered. An error message will be shown in the result display panel.

    2. Test case: login uName/john uPass/234 Expected: Log in with a registered username and a wrong password. An error message will be shown in the result display panel.

    3. Test case: login uName/john uPass/123 Expected: Log in with a registered username and correct password, a success message will be shown in the result display panel.

Deleting a user(User)

  1. Self Deleting a user.

    1. Prerequisites: User who is interested in removing himself from the forum must login to his account. The given user must be in the UserStorage.

    2. Test case: deleteMe -user logged in Expected Success: The current user will be deleted from the UserStorage and a success message will be shown in the result display panel.

    3. Test case: deleteMe -user not logged in Expected Fail: Since the given user is not logged in, an error message will be shown in the result display panel.