2nd term
University Room Reservation System (UniRes)
Objective: Create a prototype of a mobile application for managing university room reservations. The project must integrate API communication , hardware handling (camera) , and persistent data storage.
1. Architecture and Server Setup
Prepare a local API using json-server running on port 4000. Your db.json file should contain two collections: rooms and reservations.
Example db.json structure:
{
"rooms": [
{ "id": "1", "name": "A-213", "type": "Laboratory", "capacity": 20 },
{ "id": "2", "name": "C-4", "type": "Lecture Hall", "capacity": 150 }
],
"reservations": [
{ "id": "101", "roomId": "1", "timeBlock": "08:00-10:00", "user": "Student123" }
]
}
2. Navigation and Structure
The application must feature a logical navigation flow:
-
Login Screen: A simple form to access the application.
-
Main Panel (Tab Navigator):
-
Room List: A list of all available rooms fetched from the API.
-
QR Scanner: A module utilizing the camera.
-
Profile: Displaying user data and their current reservations.
-
-
Reservation Screen (Stack): A detailed view of a selected room with a reservation form.
3. Core Functional Requirements
A. Scanning and Identification
-
Implement a scanning feature using the camera module (simulating a room's QR code).
-
Upon "scanning" (or a button press simulating an ID read), the app should navigate directly to the Reservation Screen for that specific room, passing the room ID as a navigation parameter.
B. Reservation Logic (2-Hour Blocks)
-
Reservations must be made in fixed 2-hour blocks (e.g., 08:00–10:00, 10:00–12:00).
-
Validation: Before sending a
POSTrequest to/reservations, the app must check if the room is already occupied for that specific block. -
Conflict Handling: If the room is occupied, display a clear error message (Alert) and block the submission.
C. State Management and Storage
-
SecureStore: Store the user's authentication token or login securely.
-
Context API: Manage global state for login status and the user's active reservations.
-
AsyncStorage: Save the user's reservation list locally so it persists after restarting the app.
D. UI and Components
-
Use
Flexboxfor clean layouts and forms (justifyContent,alignItems,gap). -
Create a reusable RoomTile component using typed
props(name, type, capacity). -
Ensure the use of
SafeAreaViewto respect screen notches and insets.
4. Grading Criteria
| No. | Requirement | Points |
| 1. |
Navigation: Correct transitions and parameter passing (Room ID). |
0-3 |
| 2. |
API (CRUD): Fetching rooms ( |
0-3 |
| 3. |
Reservation Logic: 2h block handling and availability validation.
|
0-4 |
| 4. |
Hardware: Functioning camera/scanner and permission handling.
|
0-2 |
| 5. |
State & Storage: Implementation of Context API, AsyncStorage, and SecureStore. |
0-3 |
| TOTAL | 15 pts |
