Refer to the guide Setting up and getting started.
The Architecture Diagram given above explains the high-level design of the App.
Given below is a quick overview of main components and how they interact with each other.
Main components of the architecture
Main
(consisting of classes Main
and MainApp
) is in charge of the app launch and shut down.
The bulk of the app's work is done by the following four components:
UI
: The UI of the App.Logic
: The command executor.Model
: Holds the data of the App in memory.Storage
: Reads data from, and writes data to, the hard disk.Commons
represents a collection of classes used by multiple other components.
How the architecture components interact with each other
The Sequence Diagram below shows how the components interact with each other for the scenario where the user issues the command delete 1
.
Each of the four main components (also shown in the diagram above),
interface
with the same name as the Component.{Component Name}Manager
class (which follows the corresponding API interface
mentioned in the previous point.For example, the Logic
component defines its API in the Logic.java
interface and implements its functionality using the LogicManager.java
class which follows the Logic
interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the implementation of a component), as illustrated in the (partial) class diagram below.
The sections below give more details of each component.
The API of this component is specified in Ui.java
The UI consists of a MainWindow
that is made up of parts e.g.CommandBox
, ResultDisplay
, PersonListPanel
, StatusBarFooter
, ChartDisplay
etc. All these, including the MainWindow
, inherit from the abstract UiPart
class which captures the commonalities between classes that represent parts of the visible GUI.
The UI
component uses the JavaFx UI framework. The layout of these UI parts are defined in matching .fxml
files that are in the src/main/resources/view
folder. For example, the layout of the MainWindow
is specified in MainWindow.fxml
The UI
component,
Logic
component.Model
data so that the UI can be updated with the modified data.Logic
component, because the UI
relies on the Logic
to execute commands.Model
component, as it displays Person
object residing in the Model
.API : Logic.java
Here's a (partial) class diagram of the Logic
component:
The sequence diagram below illustrates the interactions within the Logic
component, taking execute("delete 1")
API call as an example.
Note: The lifeline for DeleteCommandParser
should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram.
How the Logic
component works:
Logic
is called upon to execute a command, it is passed to an AddressBookParser
object which in turn creates a parser that matches the command (e.g., DeleteCommandParser
) and uses it to parse the command.Command
object (more precisely, an object of one of its subclasses e.g., DeleteCommand
) which is executed by the LogicManager
.Model
when it is executed (e.g. to delete a person).Model
) to achieve.CommandResult
object which is returned back from Logic
.Here are the other classes in Logic
(omitted from the class diagram above) that are used for parsing a user command:
How the parsing works:
AddressBookParser
class creates an XYZCommandParser
(XYZ
is a placeholder for the specific command name e.g., AddCommandParser
) which uses the other classes shown above to parse the user command and create a XYZCommand
object (e.g., AddCommand
) which the AddressBookParser
returns back as a Command
object.XYZCommandParser
classes (e.g., AddCommandParser
, DeleteCommandParser
, ...) inherit from the Parser
interface so that they can be treated similarly where possible e.g, during testing.API : Model.java
The Model
component,
Person
objects (which are contained in a UniquePersonList
object), and all Lesson
objects (which are contained in a UniqueLessonList
object).Person
objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Person>
that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.UserPref
object that represents the user’s preferences. This is exposed to the outside as a ReadOnlyUserPref
objects.Model
represents data entities of the domain, they should make sense on their own without depending on other components)API : Storage.java
The Storage
component,
AddressBookStorage
and UserPrefStorage
, which means it can be treated as either one (if only the functionality of only one is needed).Model
component (because the Storage
component's job is to save/retrieve objects that belong to the Model
)Classes used by multiple components are in the seedu.address.commons
package.
This section describes some noteworthy details on how certain features are implemented.
The ImportCommand class in ImportCommand.java
allows users to import data from a CSV file and add multiple persons at once to the address book.
The import process reads the CSV file, validates the data, and converts each row into a JsonAdaptedPerson object, which is then added to the model if it meets specified constraints. If any rows fail validation or contain duplicates, they are skipped, and detailed feedback is provided to the user.
The ImportCommand
makes use of the CsvImport
helper class, which is responsible for parsing and validating CSV data.
Here's how the command works:
Step 1. File Path Input: The command accepts a file path as an argument, specifying the location of the CSV file to import.
Step 2. CSV Parsing: The CsvImport class reads and processes the CSV file, verifying headers, formatting, and constraints.
Step 3. Duplicate and Constraint Validation: Rows with duplicate entries or invalid values (e.g., empty fields for required information) are tracked and not added to the address book.
Step 4. Result Messaging: After import, the command returns a message indicating how many records were successfully added, along with details about any failed rows or duplicates.
The Import mechanism is facilitated by CsvImport
which is responsible for parsing and validating CSV data.
CsvImport#read()
- Reads the CSV file and imports the data into the provided model.
CsvImport#validateHeaders(FileReader reader)
: Ensures that the CSV file has the correct headers: name, phone, email, address, hours, tags, role, and subjects.
CsvImport#validateCsv(FileReader reader)
: Validates the format of each row, checking that each row has the expected number of columns.
Tracking Duplicates and Failures: The class maintains duplicates and failedRows lists to track any rows that fail due to duplicate entries or constraint violations.
The View Tutor Chart (VTC) feature in ViewTutorChartCommand
displays tutors in a bar chart, sorted by their tutoring hours in ascending order.
The ViewTutorChartCommand class retrieves all tutors from the Model, sorts them in ascending order by tutoring hours, and generates a message alongside a bar chart displaying this data in the UI.
Note: The VTC does not have a parser class, and ViewTutorChart is returned directly to AddressBookParser.
The proposed undo/redo mechanism is facilitated by VersionedAddressBook
. It extends AddressBook
with an undo/redo history, stored internally as an addressBookStateList
and currentStatePointer
. Additionally, it implements the following operations:
VersionedAddressBook#commit()
— Saves the current address book state in its history.VersionedAddressBook#undo()
— Restores the previous address book state from its history.VersionedAddressBook#redo()
— Restores a previously undone address book state from its history.These operations are exposed in the Model
interface as Model#commitAddressBook()
, Model#undoAddressBook()
and Model#redoAddressBook()
respectively.
Given below is an example usage scenario and how the undo/redo mechanism behaves at each step.
Step 1. The user launches the application for the first time. The VersionedAddressBook
will be initialized with the initial address book state, and the currentStatePointer
pointing to that single address book state.
Step 2. The user executes delete 5
command to delete the 5th person in the address book. The delete
command calls Model#commitAddressBook()
, causing the modified state of the address book after the delete 5
command executes to be saved in the addressBookStateList
, and the currentStatePointer
is shifted to the newly inserted address book state.
Step 3. The user executes add \n David …
to add a new person. The add
command also calls Model#commitAddressBook()
, causing another modified address book state to be saved into the addressBookStateList
.
Note: If a command fails its execution, it will not call Model#commitAddressBook()
, so the address book state will not be saved into the addressBookStateList
.
Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the undo
command. The undo
command will call Model#undoAddressBook()
, which will shift the currentStatePointer
once to the left, pointing it to the previous address book state, and restores the address book to that state.
Note: If the currentStatePointer
is at index 0, pointing to the initial AddressBook state, then there are no previous AddressBook states to restore. The undo
command uses Model#canUndoAddressBook()
to check if this is the case. If so, it will return an error to the user rather
than attempting to perform the undo.
The following sequence diagram shows how an undo operation goes through the Logic
component:
Note: The lifeline for UndoCommand
should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
Similarly, how an undo operation goes through the Model
component is shown below:
The redo
command does the opposite — it calls Model#redoAddressBook()
, which shifts the currentStatePointer
once to the right, pointing to the previously undone state, and restores the address book to that state.
Note: If the currentStatePointer
is at index addressBookStateList.size() - 1
, pointing to the latest address book state, then there are no undone AddressBook states to restore. The redo
command uses Model#canRedoAddressBook()
to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.
Step 5. The user then decides to execute the command list
. Commands that do not modify the address book, such as list
, will usually not call Model#commitAddressBook()
, Model#undoAddressBook()
or Model#redoAddressBook()
. Thus, the addressBookStateList
remains unchanged.
Step 6. The user executes clear
, which calls Model#commitAddressBook()
. Since the currentStatePointer
is not pointing at the end of the addressBookStateList
, all address book states after the currentStatePointer
will be purged. Reason: It no longer makes sense to redo the add \n David …
command. This is the behavior that most modern desktop applications follow.
The following activity diagram summarizes what happens when a user executes a new command:
Aspect: How undo & redo executes:
Alternative 1 (current choice): Saves the entire address book.
Alternative 2: Individual command knows how to undo/redo by itself.
delete
, just save the person being deleted).Target user profile:
Value proposition: Manage volunteering tutor and tutee records and scheduling faster than a typical mouse/GUI-driven app, while efficiently tracking volunteer engagement.
Priorities: High (must have) - * * *
, Medium (nice to have) - * *
, Low (unlikely to have) - *
Priority | As a … | I want to … | So that I can… |
---|---|---|---|
* * * | new user | see usage instructions | refer to instructions when I forget how to use the App |
* * * | supervisor | view the contact details of tutors | reach out to them for administrative matters |
* * * | supervisor | view the contact details of tutees | reach out to them for administrative matters |
* * * | supervisor | add a new tutor and their details | keep track of the tutors and their personal information |
* * * | supervisor | add a new tutee and their details | keep track of the tutees and their personal information |
* * * | supervisor | add a tutor's tutoring subject | match them with tutees who need help in that subject |
* * * | supervisor | add a tutee's required subject for tutoring | match them with a suitable volunteering tutor |
* * * | supervisor | update a tutor's contact information | keep the details accurate |
* * * | supervisor | update a tutee's contact information | keep the details accurate |
* * * | supervisor | delete details of an inactive tutor | keep the database up-to-date |
* * * | supervisor | delete details of a former tutee | keep the database up-to-date |
* * * | supervisor | view the address of a tutor | arrange tutoring sessions in locations that are convenient for them |
* * * | supervisor | view the address of a tutee | arrange tutoring sessions by tutors located near them |
* * * | supervisor | update a tutor's address | keep the details accurate |
* * * | supervisor | update a tutee's address | keep the details accurate |
* * * | supervisor | update a tutor's total volunteer hours | keep track of the number of hours they have put into volunteering |
* * * | supervisor | view a tutor's total volunteer hours | track their productivity and contributions over time |
* * * | supervisor | interact with the application's GUI easily | enjoy the application and use it intuitively |
* * * | supervisor | find a tutor or tutee by name | locate details of tutors or tutees without going through the entire list |
* * * | supervisor | undo the last command executed | easily correct mistakes without re-entering the data manually |
* * * | supervisor | redo a previously undone command | reapply actions if undone by mistake |
* * * | supervisor | view the history of commands from most recent to least recent | track the actions performed and verify changes |
* * | supervisor | filter persons by subject | locate a tutor and tutee easily for matching purposes |
* * | supervisor | view a tutor's total hours in graphs or charts | easily analyze tutor engagement and allocate resources efficiently |
* | supervisor | add the available timeslots of tutors | allow tutoring sessions to be arranged |
* | supervisor | update the available timeslots of tutors | ensure tutors can conduct tutoring sessions as scheduled |
* | supervisor | view the availability of tutors | schedule tutoring sessions that matches their availability |
* | supervisor | view the total number of tutors and tutees in graphs or charts | identify any inefficient allocation of resources and adjust accordingly |
* | supervisor | sort tutors in different orders | locate a tutor easily |
* | supervisor | read large amount of data at once by importing an excel file | quickly populate the system without manually entering each data point |
* | supervisor | have an autocomplete feature when typing commands | save time and reduce errors while entering commands or data |
* | supervisor | utilize keyboard shortcuts | navigate to a different page quickly and conveniently |
(For all use cases below, the System is the VolunTier
and the Actor is the user
, unless specified otherwise)
Use case: UC1 - View list of persons
MSS
User requests to list persons
VolunTier shows a list of persons
Use case ends.
Extensions
1a. The list is empty.
Use case ends.
Use case: UC2 - Delete a person
MSS
User views list of persons (UC1)
User requests to delete a specific person in the list
VolunTier deletes the person
Use case ends.
Extensions
2a. The given index is invalid.
2a1. VolunTier shows an error message.
Use case resumes at step 2.
Use case: UC3 - Add a new person
MSS
User requests to add a new person
VolunTier prompts the user to input the person's details (e.g., name, contact details, address)
User provides the relevant details
VolunTier saves the new person in the system
VolunTier confirms that the person has been successfully added
Use case ends.
Extensions
3a. User inputs a name and address that already exists.
Use case resumes at step 2.
3b. User inputs invalid or incomplete details.
Use case resumes at step 2.
Use case: UC4 - Update a person's details
MSS
User views list of persons (UC1)
User requests to update the details (e.g., contact details, address) of a specific person on the list
VolunTier displays the person's current detailsx
User provides the updated details
VolunTier updates the person's details in the database
VolunTier confirms that the details has been successfully updated
Use case ends.
Extensions
2a. The given index is invalid.
Use case resumes at step 2.
4a. User inputs invalid or incomplete details.
Use case resumes at step 4.
Use case: UC5 - Import a list of persons
MSS
User requests to import a list of persons from a CSV file
VolunTier prompts the user to input the file path of the CSV file
User provides the file path
VolunTier reads the CSV file and imports the list of persons
VolunTier confirms that the persons have been successfully imported
Use case ends.
Extensions
3a. The file path is invalid.
Use case resumes at step 2.
3b. The format of the file is incorrect.
4a. The CSV file has some invalid entries.
4a1. VolunTier confirms that the valid entries have been successfully imported.
4a2. VolunTier shows an error message specifying the invalid entries.
Use case resumes at step 2.
17
or above installed.Given below are instructions to test the app manually.
Note: These instructions only provide a starting point for testers to work on; testers are expected to do more exploratory testing.
Initial launch
1a. Download the jar file and copy into an empty folder
1b. Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.
Saving window preferences
2a. Resize the window to an optimum size. Move the window to a different location. Close the window.
2b. Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
Deleting a person while all persons are being shown
1a. Prerequisites: List all persons using the list
command. Multiple persons in the list.
1b. Test case: delete 1
Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated.
1c. Test case: delete 0
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same.
1d. Other incorrect delete commands to try: delete
, delete x
, ...
(where x is larger than the list size)
Expected: Similar to previous.
Adding a tutor with all fields filled
1a. Test case: addTutor \n Alice \p 81234567 \e alice@gmail.com \a Block 123, Alice Street, 123456 \h 20 \s math
Expected: New contact is added to the list. Details of the new contact shown in the status message.
1b. Test case: addTutor \n Bob \p 98765432 \e invalid \a Block 123, Bob Street, 223456
Expected: No contact is added. Error details shown in the status message for invalid email.
1c. Other incorrect add tutor commands to try: addTutor \x y
(where x is a tag and y is an invalid value for that field)
Expected: Similar to previous.
Editing a tutor with all fields filled
1a. Prerequisites: Add a tutor with the command addTutor \n Alice \p 81234567 \e alice@gmail.com \a Block 123, Alice Street, 123456 \h 20 \s math
.
Add another tutor with the command addTutor \n Bob \p 98765432 \e bob@gmail.com \a Block 123, Bob Street, 223456 \h 20 \s math
.
1b. Test case: edit 1 \n Alicia
Expected: Contact is updated in the list. Details of the updated contact shown in the status message.
1c. Test case: edit 2 \n Alice
Expected: No contact is updated. Error details shown in the status message for duplicate name.
1d. Other incorrect edit tutor commands to try: edit 1 \x y
(where x is a tag and y is an invalid value for that field)
Expected: Similar to previous.
Finding tutors by subject
1a. Prerequisites: Add a tutor with the command addTutor \n Alice \p 81234567 \e alice@gmail.com \a Block 123, Alice Street, 123456 \h 20 \s math
.
Add another tutor with the command addTutor \n Bob \p 98765432 \e bob@gmail.com \a Block 123, Bob Street, 223456 \h 20 \s science
.
1b. Test case: findSubject math
Expected: List of tutors (only Alice) with the subject math
is shown.
1c. Test case: findSubject chinese
Expected: No tutor is found. Error details shown in the status message.
Adding a lesson with all fields filled
1a. Prerequisites: Clear the list with the command clear
Add a tutor with the command addTutor \n Alice \p 81234567 \e alice@gmail.com \a Block 123, Alice Street, 123456 \h 20 \s math
.
Add a tutee with the command addTutee \n Bob \p 98765432 \e bob@gmail.com \a Block 123, Bob Street, 223456 \h 20 \s math
.
1b. Test case: addLesson 1 2 \s math
Expected: New lesson is added to the list. Details of the new lesson shown in the status message.
1c. Test case: addLesson 1 2 \s math
Expected: No lesson is added. Error details shown in the status message for duplicate lessons.
Team size: 5
Customizable Subject Management
Enhanced find
for Role-Specific Searches
find
command to allow searching by role, making it easier to locate either tutors or tutees for creating a lesson. For example, find \r tutor
would list only tutors. This enhancement streamlines the process of identifying suitable tutors or tutees based.toTimetable Function for Adding Lessons
Improve vtc
Chart UI for Large Hour Discrepancies
vtc
command to accommodate tutors with significantly different hour totals. For example, when one tutor has very high hours (e.g., 100,000) and another has low hours (e.g., 15), the chart should still visibly differentiate each tutor's hours. This enhancement ensures that tutors with fewer hours are accurately represented, avoiding the appearance of zero hours due to chart stretching.Improve vtc
Tutor Hours Chart Rendering
vtc
to address JavaFX’s limitation with duplicate names. Currently, random index numbers are added to each tutor entry to ensure uniqueness. In future updates, we aim to explore more effective solutions to clearly differentiate tutors with identical names, maintaining clarity in the chart.Improve Chart UI for Long Names in vtc
Command
vtc
command to accommodate very long names, ensuring they display correctly without disrupting chart formatting. This could involve wrapping or truncating names within the chart view to maintain readability and avoid overlap or distortion.Fix Disappearing Text on Hover in Help and File Tabs
Person with no subject check hours
Improve UI in personCard to wrap long fields