Skip to content
This repository was archived by the owner on Oct 18, 2025. It is now read-only.

Conversation

@ramonechen
Copy link
Contributor

What?

Implemented a course search algorithm that accepts 4 optional parameters: a search prompt, department filters, attribute filters, and semester filters. Comes with two endpoints that makes use of this algorithm: one to fetch all courses and one to fetch courses based on the 4 parameters.

Why?

The course planner website needs a way to fetch all of RPI's courses and to search/filter them based on user-provided parameters. Therefore, the backend needed functions to fetch this data from the MySQL database and serve it to the client.

How?

The course search functions were implemented across controller, service, and repository components. The controller component includes endpoint mappings and top-level logic, the service component contains the Java-side search logic, and the repository component contains a Frankenstein SQL query responsible for actually fetching course data based on search
parameters. A course entity and DTO was also created to store search result data and to be served to the client.

Testing?

I used the course search endpoints and manually inputted search parameters; it hasn't given me any wrong results so far.

Anything Else?

https://www.youtube.com/watch?v=1xtFp2Wu_To

anthonyrys and others added 10 commits October 4, 2024 17:49
- Add Course Controller
- Add Course Entity
- Add Course Key
- Add Course Repository
We now have a working endpoint that takes in a single search term parameter, and returns a list of raw CourseSearchResult entities.

Not the final product by the way; CourseSearchResult contains some extraneous fields (pkCourses, codeMatch, titleExactMatch, etc.) that the client doesn't need.

I want to make some mapper class that'll be able to map the relevant fields from a CourseSearchResult to a Course entity or a proper DTO. Afterwards, I don't think anything really needs to be done to the search algorithm.
I changed this dependency in the last commit from com.mysql to mysql, but after a bit of research I realize that the one from before is the correct one to use (developed officially by MySQL). This change has been reverted.
Implemented the course DTO and used the ModelMapper library to map from CourseSearchResult entities to CourseDto DTOs, in the controller.

Added an ApplicationConfig.java for general configuration and beans.
The course DTO now includes information about the semesters it's been offered in, and a list of it's special attributes (HASS Inquiry, etc.).

Issues that need to be worked on:

Attributes haven't been added to the database at this point in time, so the attribute filter has been commented out.

Only a single department filter, attribute filter, and semester filter can be applied. There is currently no support for multiple department filters, etc.

Co-Authored-By: Jack Zgombic <69125339+jzgom067@users.noreply.github.com>
Added in attribute filtering, and query parameters now allow for a sequence of filters of the same type.

For example, you can now filter by both "CSCI" and "ITWS" and get courses that are from either department. You can also filter by "Communication Intensive" and "HASS Inquiry" attributes and get courses that have both of them.
@ramonechen ramonechen merged commit 9f848f0 into main Nov 15, 2024
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants