- Continuation of Assignment 1, now with backend implementation:
https://github.com/rmit-fsd-2025-s1/s3934367-s4079204-a2 - cloned and forked from the original repository: full stack development assignment 2
- databse hosted on PHP MyAdmin - RMIT
- READme document formatter
- ChatGPT - Used to create this readme file (slightly modified from the first one)
- signin with graphQL
- authentication with GraphQL
- youtube video - React Login with Apollo Server
- week 10 Lecture Slides
- week 10 Lab materials
- graphQL documentation
- real-time dashboards using graphQL
- graphQL vs REST API
- Pie Chart Integration:
We've integrated a dynamic pie chart using this TypeScript example:
StackBlitz TypeScript Pie Chart Example- for assignment 2, this has been modified to get the applications from the backend, using SelectedCandidates and stores it in LocalStorage
Please refer to
PieChart.tsandapplicationStats.tsx.
- for assignment 2, this has been modified to get the applications from the backend, using SelectedCandidates and stores it in LocalStorage
Please refer to
- Search and Sort Integration:
We've implemented search and sort functionality according to the Assignment Brief specifications. - How to Sort and Filter Data in React using TypeScript (Note: we did not use the
filterObjfunction mentioned in the video) - React TypeScript: Generic Search and Sort Filters
- for assignment 2, this has been modified to get the applications from the backend.
Please refer to
SearchApplicants.tsx.
- for assignment 2, this has been modified to get the applications from the backend.
Please refer to
We have integrated a MySQL database, hosted via phpMyAdmin, to store all core application data. Data is retrieved and persisted using backend API endpoints built with Express and connected via Sequelize ORM.
users— Stores account credentials and rolescourses— Contains course informationapplications— Stores tutor applicationsselected_candidates— For shortlisted applicants (localstorage - selected_candidates gets the application from the database, and the selected applications are saved to localstorage)
🔄 Note: For this part of the assignment, we removed the
final_selected_candidatestable to avoid confusion between shortlisted and hired candidates. Instead, selected candidates for the pie chart are stored in localStorage, and the application data is fetched dynamically using a custom-made REST API.
We use cookies to manage login sessions securely and persistently. This is due to LocalStorage not working for us. we have decided to use a different approach. Thanks to Liam for helping us figure this out.
- When a user submits login credentials, an API call checks the
userstable in the MySQL database. - If valid, a cookie is set with
isSignedIn = trueto persist the session. - If invalid, the backend returns an error, and the cookie is not set.
- On logout, the cookie is deleted, ending the session. (the cookies expiry date is set to 1970, making it invalid.)
This approach avoids exposing credentials on the frontend and improves UX by allowing persistent login states across reloads.
| Role | Password | |
|---|---|---|
| Lecturer | Ridge@gmail.com | Testing12345678 |
| Tutor | Yuki@gmail.com | Yuki1234 |
Use these credentials to test login functionality.
feel free to create more users (either Tutor or Lecturer)
Feel free to create a user as well. we have implemented the sign in page to communicate with the backend database and a custom-made REST API.
You will need to fill out:
| Role | Password |
|---|
then, you can use these credentials to test login functionality.
- Stores user credentials and roles for login authentication.
- Contains structured course info (e.g.,
courseCode,courseName).
- Holds tutor applications submitted through the form.
- Stores shortlisted applicants after review and ranking.
Tutor fills out a form → API call made → data stored in applications table.
Lecturer selects a course, reviews applicants, and ranks them.
Results are saved to the selected_candidates table.
Instead of using a selected_candidates table, which are the final selections are stored in localStorage array on the frontend.
This simplifies flow and avoids redundancy/confusion, and prevents confusion in databases.
The pie chart dynamically reflects real-time data:
- Total applications per course
- Breakdown: Selected, Pending, and Not Selected
- Application data is fetched from MySQL using a custom REST API.
- When a lecturer confirms a final selection, the candidate is stored in localStorage.
- The pie chart reads from both the API (for applications) and localStorage (for selections) to build a visual report.
Check applicationStats.tsx for the implementation.
-
you can access the API using the endpoint localhost:3001/api
-
we have a variety of APIs available:
get all courses: http://localhost:3001/api/courses
get course via course id: http://localhost:3001/api/courses/(courseID)
get all applications: http://localhost:3001/api/applications
get applications via application id: http://localhost:3001/api/applications/(applicationID)
check sign in: http://localhost:3001/api/me
get all users: http://localhost:3001/api/users
- Use sample users listed above.
- Inspect cookies via Dev Tools → Application → Cookies.
- View localStorage selections for pie chart under Local Storage.
- Monitor live data via browser DevTools network tab or phpMyAdmin directly.