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 a delete command.
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, TabSection,
ListSection 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 objects 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 a delete command 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).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 object.Model represents data entities of the domain, they should make sense on their own without depending on other components)Note: An alternative (arguably, a more OOP) model is given below. It has a Tag list in the AddressBook, which Person references. This allows AddressBook to only require one Tag object per unique tag, instead of each Person needing their own Tag objects.

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.
HallLedger stores demerit incidents as resident-level records instead of storing only a mutable running total.
Each demerit incident records:
The resident’s total demerit points are derived by summing the points applied across all stored demerit incidents. This avoids duplicated derived state and keeps the resident’s demerit history auditable.
The demerit feature is split into two user-facing commands:
demeritlist — displays the indexed demerit rule catalogue and point tiers.demerit — applies an indexed demerit rule to a resident identified by student ID.A resident may commit the same rule multiple times, and the DPS applies different point tiers based on repeated occurrences. Hence, storing only a running total would lose important context such as:
By storing incidents individually, HallLedger can:
HallLedger currently records resident demerit incidents and computes accumulated totals. It does not yet automatically enforce semester-based or lifetime housing sanctions tied to DPS thresholds.
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 a delete command to delete a resident in the address book. The delete command calls Model#commitAddressBook(), causing the modified state of the address book after the 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 an add command to add a new resident. 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 resident 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 earlier add 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).{more aspects and alternatives to be added}
{Explain here how the data archiving feature will be implemented}
HallLedger is a desktop application for Resident Assistants (RAs) and other hall administrators who need to manage resident contact records quickly and accurately. It is optimized for hall-level resident administration, where users frequently need to search, update, and maintain resident details such as student ID, room assignment, contact information, and emergency contact details.
Beyond basic resident record management, HallLedger is intended to support common hall-administration workflows such as tagging residents by attributes (e.g. year of study, major, gender), monitoring occupancy at the room level, tracking demerit incidents, and serving as a foundation for future hall-management features such as retention-related review and other resident administration tasks.
HallLedger is not intended to replace university-wide housing allocation systems, payment systems, or institutional access-control systems. Its scope is limited to block-level or hall-level resident management and operational tracking.
Target user profile:
Value proposition: HallLedger helps hall administrators manage resident records faster and with fewer errors than spreadsheets or manual lists, while providing a centralized and command-driven workflow tailored to hall operations.
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a(n) … | I want to … | So that I can… |
|---|---|---|---|
* * * | new user | see usage instructions | refer to instructions when I forget how to use the App |
* * * | RA | add a new student contact | keep up-to-date records of students under my care |
* * * | RA | list all student contacts | get an overview of students assigned to me |
* * * | RA | search for existing student contacts | quickly find a specific resident's information |
* * * | RA | delete records of students | remove entries of students no longer in hall |
* * * | RA | clear all current student records | quickly reset the system for a new semester |
* * * | RA | edit existing contacts | maintain accurate and up-to-date student resident records |
* * * | RA | add demerit records to a student profile | track resident behaviour incidents accurately |
* * | RA | view the data file in JSON | enjoy data portability without opening the app |
* * * | RA | filter existing contacts based on attributes (e.g., block, year) | easily view and manage specific groups of resident students |
* * * | RA | add custom tags to students | allow for efficient categorisation of students |
* * | RA | add and administer CCA point records to a student's profile | track their CCA contributions accurately |
* * | RA | view student CCA records | minimize chance of someone else seeing them by accident |
* | RA | rank students by their total accumulated points | prioritize residents based on points-related review |
* * | RA | view student demerit records | assess a student's overall behaviour |
* | RA | generate occupancy reports by block and room | plan effectively for next semester's housing allocation |
* | RA | export all data to a CSV file | share or analyse data externally for admin use |
{More to be added}
(For all use cases below, the System is HallLedger and the Actor is the Residential Assistant (RA), unless specified otherwise)
Use case: UC01 - Add a new student
MSS
Use case ends.
Extensions
1a. RA provides an invalid format for the details (e.g., incorrect phone number format).
1b. A student with the exact same details already exists in the system.
1c. RA fails to provide compulsory details (name, phone, email, room number).
Use case: UC02 - View a student's details (basic info, demerit records)
MSS
Use case ends.
Extensions
Use case: UC03 - Edit a student's info
MSS
Use case ends.
Extensions
1a. The given student ID does not exist.
1b. RA provides an invalid format for the details to be updated.
1c. RA provides details that are exactly the same as the existing ones, resulting in no changes. Use case resumes from step 1.
Use case: UC04 - Delete or Clear student records
MSS
Use case ends.
Extensions
1a. The student list is already empty. Use case ends.
1b. If deleting, the given student ID is invalid.
Use case: UC05 - Search and filter students
MSS
Use case ends.
Extensions
1a. RA provides empty keywords or invalid criteria format.
2a. No students match the given criteria.
Use case: UC06 - Add a demerit record
MSS
Use case ends.
Extensions
1a. No demerit rules are available.
3a. The given student ID is invalid.
3b. The given rule index does not exist.
Use case: UC07 - Export data
MSS
Use case ends.
Extensions
Should work on any mainstream OS as long as it has Java 17 or above installed.
Should be able to store up to 1000 students without noticeable sluggishness in performance for typical usage.
Should have a response time of < 2 seconds for all instructions.
A user with above-average typing speed for regular English text (i.e., not code, not system admin commands) should be able to accomplish most tasks faster using commands than using the mouse.
Interaction with the product should be intuitive even for non-technical users, e.g., simple error messages should be displayed and help should be easily available when needed.
The product is not required to handle more than one user at a time.
The product should be free to use and open source.
The product should not need an internet connection to use.
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
Download the jar file and copy it into an empty folder.
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
Resize the window to an optimum size. Move the window to a different location. Close the window.
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
Prerequisites: List all persons using the list command. Multiple persons in the list.
Test case: delete i=A1234567X
Expected: The matching resident is deleted from the list. Details of the deleted resident are shown in the status message. Timestamp in the status bar is updated.
Test case: delete i=A0000000Z
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same.
Other incorrect delete commands to try: delete, delete x, delete i=notAStudentId
Expected: Similar to previous.
Listing demerit rules
demeritlistAdding a demerit record
Prerequisites: At least one resident exists in the list.
Test case: demerit i=A1234567X di=18
Expected: A success message is shown. The resident's displayed demerit total increases according to the first-offence tier of rule 18.
Test case: Repeat demerit i=A1234567X di=18
Expected: A success message is shown. The resident's displayed demerit total increases again according to the next offence tier.
Test case: demerit i=A9999999Z di=18
Expected: No demerit is added. An error message is shown indicating that the resident was not found.
Test case: demerit i=A1234567X di=999
Expected: No demerit is added. An error message is shown indicating that the rule index does not exist.
Dealing with missing/corrupted data files
Delete or rename the data/addressbook.json file, then relaunch the app.
Expected: HallLedger starts with sample data or an empty initialized data file instead of crashing.
Edit data/addressbook.json into an invalid JSON format, then relaunch the app.
Expected: HallLedger detects that the data file cannot be loaded and starts safely without using the corrupted data.