3rd term
University Maintenance Reporter (UniFix)
Objective: Create a prototype of a mobile application for reporting technical issues and damages across the university campus. 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: locations and reports.
Example db.json structure:
{
"locations": [
{ "id": "10", "building": "A-1", "room": "213", "type": "Laboratory" },
{ "id": "20", "building": "C-4", "room": "Main Hall", "type": "Lecture Hall" }
],
"reports": [
{ "id": "1", "locationId": "10", "issue": "Broken projector", "priority": "High", "status": "Pending" }
]
}
2. Navigation and Structure
The application must feature a logical navigation flow:
-
Login Screen: A simple form to access the application (using a PIN or password).
-
Main Panel (Tab Navigator):
-
Active Reports: A list of all ongoing issues fetched from the API.
-
QR Scanner: A module utilizing the camera to identify the room.
-
Profile: Displaying user data and the number of reports they have submitted.
-
-
Report Screen (Stack): A detailed form to submit a new issue for a specific location.
3. Core Functional Requirements
A. Scanning and Identification (Hardware)
-
Implement a scanning feature using the camera module (simulating a QR code found on a classroom door).
-
Upon "scanning" (or a button press simulating an ID read), the app should navigate directly to the Report Screen for that specific location, passing the
locationIdas a navigation parameter.
B. Reporting Logic & Validation
-
Users must provide a description of the issue and select a priority level (Low, Medium, High).
-
Validation: Before sending a
POSTrequest to/reports, the app must check if that specific room already has a report with a"status": "Pending". -
Conflict Handling: If a pending report already exists for that room, display a clear error message (Alert) and block the submission to prevent duplicates.
C. State Management and Storage
-
SecureStore: Store the user's authentication token or login credentials securely.
-
Context API: Manage global state for login status and the current list of reports submitted by the user.
-
AsyncStorage: Save a "Draft" of the report description locally, so it persists if the user accidentally closes the app before submitting.
D. UI and Components
-
Use Flexbox for clean layouts and forms (
justifyContent,alignItems,gap). -
Create a reusable IssueCard component using typed props (
issue,priority,status). -
Ensure the use of SafeAreaView to respect screen notches and system insets.
4. Grading Criteria
| No. | Requirement | Points |
| 1. | Navigation: Correct transitions and parameter passing (Location ID). | 0-3 |
| 2. | API (CRUD): Fetching data (GET) and adding reports (POST) with proper typing. | 0-3 |
| 3. | Logic: Handling duplicate reports and priority 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 |
