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(CRUD) to enable users and admin to use ForumBook

    • What it does: allows users to use ForumBook by providing the following commands:

      • CreateThreadCommand: unblocked users and admin are able to create a new thread under a specific module.

      • CreateCommentCommand: unblocked users and admin are able to create a new comment under a specific thread.

      • UpdateThreadCommand: thread owner and admin are able to update the thread title.

      • UpdateCommentCommand: comment owner and admin are able to update the comment content.

      • DeleteThreadCommand: thread owner and admin are able to delete the thread.

      • DeleteCommentCommand: comment owner and admin are able to delete the comment.

      • ListModuleCommand: all logged in users are able to list all the modules exist in the ForumBook.

      • SelectModuleCommand: all logged in users are able to select a specific module code to list all threads under that module.

      • SelectThreadCommand: all logged in users are able to select a specific thread to list all comments under that thread.

    • Justification: This CRUD feature is the basic function of the ForumBook. It provides the essential commands for users to share and communicate through the ForumBook.

    • Highlights: This CRUD feature would greatly satisfy all the users who can type fast when using this CLI ForumBook Application. The prefixes of all the parameters used in the commands are simple and meaningful.

  • Other contributions:

    • Project management:

      • Managed releases v1.3 - v1.4 (2 releases) on GitHub

    • Documentation:

      • Did cosmetic tweaks to existing contents of the User Guide: #3, #100, #151

      • Did cosmetic tweaks to existing contents of the Developer Guide: #7, #65, #100, #118

    • Community:

      • Reported bugs and suggestions for other teams in the class: #154, #169

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.

Listing all the modules : listModule

List all the existing modules in the forum book.
Format: listModule

Examples:

  • listModule

Listing all the forumThreads : selectModule

List all the existing forumThreads under a specific module that exists as well.
Format: selectModule mCode/MODULE CODE

Examples:

  • selectModule mCode/CS2113

Listing all the comments : selectThread

List all the existing comments under a specific forumThread that exists as well.
Format: selectThread tId/THREAD ID

Examples:

  • selectThread tId/123

Creating a new forumThread : createThread

Create a new forumThread under a specific module that exists
Format: createThread mCode/MODULE CODE tTitle/THREAD TITLE cContent/COMMENT CONTENT

Examples:

  • createThread mCode/CS2113 tTitle/Exam Information cContent/All the best for the final guys

Creating a new comment : createComment

Create a new comment under a specific forumThread that exists.
Format: createComment tId/THREAD ID cContent/COMMENT CONTENT

Examples:

  • createComment tId/1 cContent/This is a new comment

Updating a forumThread title : updateThread

Update an existing forumThread title in the forum book.
Format: updateThread tId/THREAD ID tTitle/NEW THREAD TITLE

  • Only admin and the forumThread creator(unblocked) are allowed to update the title.

Examples:

  • updateThread tId/123 tTitle/This is a new title

Updating a comment content : updateComment

Update an existing comment title in the forum book.
Format: updateComment cId/COMMENT ID cContent/NEW COMMENT CONTENT

  • Only admin and the comment creator(unblocked) are allowed to update the content.

Examples:

  • updateComment tId/123 tTitle/This is a new title

deleting a forumThread : deleteThread

Delete an existing forumThread in the forum book.
Format: deleteThread tId/THREAD ID

  • Only admin and the forumThread creator are allowed to delete the forumThread.

Examples:

  • deleteThread tId/1

deleting a comment : deleteComment

Delete an existing comment in the forum book.
Format: deleteComment cId/COMMENT ID

  • Only admin and the comment creator are allowed to delete the comment.

Examples:

  • deleteComment cId/1

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.

CURD feature

Current Implementation

CURD refers to create, update, read and delete. This feature is implemented to achieve the basic functionalities of the Forum Book. It extends ForumBook with various commands and supports the following operations:

  • createThread: Create a new thread under a specific module that exists with comment.

  • createComment: Create a new comment under a specific thread that exists.

  • updateThread: Update an existing thread title created(unblocked) by its user.

  • updateComment: Update an existing comment content created(unblocked) by its user.

  • listModule: List out all the modules in the Forum Book.

  • selectModule: Select a specific module and list out all the threads under the module.

  • selectThread: Select a specific thread and list out all the comments under the thread.

  • deleteThread: Delete a specific thread.

  • deleteComment: Delete a specific comment.

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

Step 1. The user launches the application, executes createThread mCode/CS2113 tTitle/Exam Information cContent/What is the topic coverage for the final? to create and add the thread into storage file. The createThread command calls UnitOfWork.commit(), saving the modified forum book state into ForumBookStorage.

Step 2. The user executes createComment tId/123 cContent/This is a new comment content to create and add the comment into storage file. The createComment command calls UnitOfWork.commit(), saving the modified forum book state into ForumBookStorage.

Step 3. The user executes updateThread tId/123 tTitle/This is a new thread title to update the title of the specific thread from storage file. The updateThread command calls UnitOfWork.getForumThreadRepository().getThread(threadId)forumThread.setTitle() and lastly UnitOfWork.commit(), saving the modified forum book state into ForumBookStorage.

Step 4. The user executes updateComment cId/123 cContent/This is a new comment content to update the content of the specific comment from storage file. The updateComment command calls UnitOfWork.getCommentRepository().getComment(commentId)comment.setContent() and lastly UnitOfWork.commit(), saving the modified forum book state into ForumBookStorage.

Step 5. The user executes listModule to retrieve all the existing modules from storage file. The listModule command calls UnitOfWork.getModuleRepository().getAllModule() which returns the module list to be shown in the panel.

Step 6. The user executes selectModule mCode/CS2113 to retrieve the module with module code CS2113 and its thread list from storage file. The selectModule command calls UnitOfWork.getModuleRepository().getModuleByCode(moduleCode) and UnitOfWork.getForumThreadRepository().getThreadsByModule(module) to return the module and thread list to be shown in the panel.

Step 7. The user executes selectThread tId/123 to retrieve the thread with ID 123 and its comments from storage file. The selectModule command calls UnitOfWork.getForumThreadRepository().getThread(threadId) and UnitOfWork.getCommentRepository().getCommentsByThread(threadId) to return the thread and comment list to be shown in the panel.

Step 8. The user executes deleteThread tId/123 to delete/remove the thread with ID 123 from storage file. The deleteThread command calls UnitOfWork.getForumThreadRepository().deleteThread(threadId) and UnitOfWork.commit() to save the modified forum book state.

Step 9. The user executes deleteComment cId/123 to delete/remove the comment with ID 123 from storage file. The deleteComment command calls UnitOfWork.getCommentRepository().deleteComment(commentId) and UnitOfWork.commit() to save the modified forum book state.

If the syntax of a command is wrong, the program will prompt the user to try again and show a suggested command format.