| | 1 | = Build Instructions = |
| | 2 | |
| | 3 | == Development environment description == |
| | 4 | |
| | 5 | The prototype application is implemented as a Java console application using Maven. It connects to the PostgreSQL project database through an SSH tunnel. The application uses JDBC for database access. |
| | 6 | |
| | 7 | Required software: |
| | 8 | |
| | 9 | * Java JDK 21 or compatible newer Java version |
| | 10 | * IntelliJ IDEA |
| | 11 | * Maven |
| | 12 | * PostgreSQL JDBC driver, included through Maven |
| | 13 | * DBeaver, used for database verification |
| | 14 | * SSH tunnel script provided through the EPRMS / Databases section |
| | 15 | |
| | 16 | The project structure is: |
| | 17 | |
| | 18 | {{{ |
| | 19 | room-reservation-prototype |
| | 20 | ├── pom.xml |
| | 21 | ├── README.md |
| | 22 | └── src |
| | 23 | └── main |
| | 24 | └── java |
| | 25 | └── mk |
| | 26 | └── finki |
| | 27 | └── roomreservation |
| | 28 | └── App.java |
| | 29 | }}} |
| | 30 | |
| | 31 | == Database connection requirements == |
| | 32 | |
| | 33 | The application does not connect directly to the remote database server. The SSH tunnel must be started first. The provided tunnel script opens access to the PostgreSQL database through: |
| | 34 | |
| | 35 | {{{ |
| | 36 | localhost:9999 |
| | 37 | }}} |
| | 38 | |
| | 39 | The application uses the following JDBC URL: |
| | 40 | |
| | 41 | {{{ |
| | 42 | jdbc:postgresql://localhost:9999/db_202526z_va_prj_room_reservation |
| | 43 | }}} |
| | 44 | |
| | 45 | The database username is: |
| | 46 | |
| | 47 | {{{ |
| | 48 | db_202526z_va_prj_room_reservation_owner |
| | 49 | }}} |
| | 50 | |
| | 51 | The database password is the database user password assigned in the EPRMS system. |
| | 52 | |
| | 53 | Important: real passwords are not written in the source code or in this documentation. The password is entered manually when starting the application. |
| | 54 | |
| | 55 | == Starting the SSH tunnel == |
| | 56 | |
| | 57 | Before starting the Java prototype, the SSH tunnel script must be started. |
| | 58 | |
| | 59 | Steps: |
| | 60 | |
| | 61 | 1. Open the folder containing the provided tunnel script and ''plink''. |
| | 62 | 2. Open PowerShell or Command Prompt in that folder. |
| | 63 | 3. Start the tunnel script. |
| | 64 | 4. Enter the SSH tunnel parameters provided in the EPRMS system if they are not already configured in the script. |
| | 65 | 5. Keep the tunnel window open while the Java prototype is running. |
| | 66 | |
| | 67 | The tunnel must remain active during the entire test. If the tunnel window is closed, the Java application will lose access to the database. |
| | 68 | |
| | 69 | == Build instructions == |
| | 70 | |
| | 71 | Open the project in IntelliJ IDEA. |
| | 72 | |
| | 73 | 1. Open IntelliJ IDEA. |
| | 74 | 2. Choose ''Open'' and select the ''room-reservation-prototype'' project folder. |
| | 75 | 3. Make sure that the project SDK is set to Java JDK 21 or compatible. |
| | 76 | 4. Wait until Maven imports the project dependencies. |
| | 77 | 5. Open ''src/main/java/mk/finki/roomreservation/App.java''. |
| | 78 | 6. Run the ''App'' class. |
| | 79 | |
| | 80 | The project can also be compiled with Maven using: |
| | 81 | |
| | 82 | {{{ |
| | 83 | mvn clean package |
| | 84 | }}} |
| | 85 | |
| | 86 | == Running the application == |
| | 87 | |
| | 88 | After starting the application, the program asks for database connection parameters. |
| | 89 | |
| | 90 | Use the default database URL by pressing Enter: |
| | 91 | |
| | 92 | {{{ |
| | 93 | jdbc:postgresql://localhost:9999/db_202526z_va_prj_room_reservation |
| | 94 | }}} |
| | 95 | |
| | 96 | Use the default database username by pressing Enter: |
| | 97 | |
| | 98 | {{{ |
| | 99 | db_202526z_va_prj_room_reservation_owner |
| | 100 | }}} |
| | 101 | |
| | 102 | Enter the assigned database password manually when prompted. |
| | 103 | |
| | 104 | If the connection is successful, the application displays: |
| | 105 | |
| | 106 | {{{ |
| | 107 | Connected to database successfully. |
| | 108 | }}} |
| | 109 | |
| | 110 | Then the main menu is shown: |
| | 111 | |
| | 112 | {{{ |
| | 113 | Main menu |
| | 114 | |
| | 115 | 1. Search available rooms |
| | 116 | 2. Create reservation request |
| | 117 | 3. Approve or reject reservation |
| | 118 | 4. Exit |
| | 119 | Choose option: |
| | 120 | }}} |
| | 121 | |
| | 122 | == Testing instructions == |
| | 123 | |
| | 124 | The prototype should be tested by executing the three implemented scenarios. |
| | 125 | |
| | 126 | === Test 1: Search available rooms === |
| | 127 | |
| | 128 | Select option: |
| | 129 | |
| | 130 | {{{ |
| | 131 | 1 |
| | 132 | }}} |
| | 133 | |
| | 134 | Example input: |
| | 135 | |
| | 136 | {{{ |
| | 137 | Reservation date: 2026-03-01 |
| | 138 | Start time: 09:00 |
| | 139 | End time: 10:00 |
| | 140 | Minimum capacity: 1 |
| | 141 | Room type filter: |
| | 142 | Required equipment name: |
| | 143 | }}} |
| | 144 | |
| | 145 | Expected result: |
| | 146 | |
| | 147 | The system displays a list of available rooms with room code, type, capacity, building name, and address. |
| | 148 | |
| | 149 | === Test 2: Create reservation request === |
| | 150 | |
| | 151 | Select option: |
| | 152 | |
| | 153 | {{{ |
| | 154 | 2 |
| | 155 | }}} |
| | 156 | |
| | 157 | Example input: |
| | 158 | |
| | 159 | {{{ |
| | 160 | Choose user number: 1 |
| | 161 | Reservation date: 2026-03-01 |
| | 162 | Start time: 09:00 |
| | 163 | End time: 10:00 |
| | 164 | Include room in reservation: y |
| | 165 | Minimum capacity: 1 |
| | 166 | Room type filter: |
| | 167 | Required equipment in room: |
| | 168 | Choose room number: 3 |
| | 169 | Request additional/general equipment: n |
| | 170 | }}} |
| | 171 | |
| | 172 | Expected result: |
| | 173 | |
| | 174 | The system creates a new reservation request and displays the generated reservation ID. The created reservation has status ''pending''. |
| | 175 | |
| | 176 | === Test 3: Approve or reject reservation === |
| | 177 | |
| | 178 | Select option: |
| | 179 | |
| | 180 | {{{ |
| | 181 | 3 |
| | 182 | }}} |
| | 183 | |
| | 184 | Example input: |
| | 185 | |
| | 186 | {{{ |
| | 187 | Choose reservation number: 2 |
| | 188 | Choose approver number: 1 |
| | 189 | Choose decision: 1 |
| | 190 | Decision note: Approved after checking room availability. |
| | 191 | }}} |
| | 192 | |
| | 193 | Expected result: |
| | 194 | |
| | 195 | The system saves the approval decision, updates the reservation status to ''approved'', and displays the final reservation details. |
| | 196 | |
| | 197 | == Database verification == |
| | 198 | |
| | 199 | The result can be verified in DBeaver by executing the following SQL statements: |
| | 200 | |
| | 201 | {{{ |
| | 202 | SELECT * |
| | 203 | FROM project.reservations |
| | 204 | ORDER BY reservation_id DESC; |
| | 205 | |
| | 206 | SELECT * |
| | 207 | FROM project.approvals |
| | 208 | ORDER BY approval_id DESC; |
| | 209 | }}} |
| | 210 | |
| | 211 | The created reservation should appear in the ''project.reservations'' table, and the approval decision should appear in the ''project.approvals'' table. |
| | 212 | |
| | 213 | == Notes == |
| | 214 | |
| | 215 | The prototype is intentionally minimal. It demonstrates the essential database operations required for the selected use-cases, but it is not a complete production application. The completion and extension of the application can be done in later project phases. |