CSE 341: Web Services

W05 Assignment: Pagination and Searching

Overview

This week, your team will improve the Kizuna Rail API by adding pagination, searching, filtering, and sorting to selected list endpoints.

Each person must complete two pull requests that are for the same feature set. The first pull request will add pagination. The second pull request will build on that work by adding searching, filtering, querying, or sorting for that same route.

Your pull requests for this assignment will be reviewed by teammates at the beginning of Week 06.

Select One Route or Feature

Coordinate with your team so each person has responsibility for a different route or feature. Feel free to help one another as needed. For your selected feature set, create two related GitHub issues and two related pull requests.

Feature Set Options

Feature Set 1: Trip List

Add paging and filtering capabilities to the trip list EJS page (/trips). The list should be populated and updated by client-side JavaScript that calls the /api/trips web service.

Feature Set 2: User Admin

Add paging and filtering capabilities to the user admin EJS page (/users). The list should be populated and updated by client-side JavaScript that calls the /api/users web service.

Feature Set 3: Booking Admin

Add paging and filtering capabilities to the booking admin EJS page (/bookings). The list should be populated and updated by client-side JavaScript that calls the /api/bookings web service.

Feature Set 4: Trains

Add paging and querying capabilities to the trains EJS page (/trains). The list should be populated and updated by client-side JavaScript that calls the /api/trains web service.

Feature Set 5: Trips Admin

Add paging and filtering capabilities to the trips admin EJS page (/trips-admin). The list should be populated and updated by client-side JavaScript that calls the /api/trips web service.

This feature set is closely integrated with Feature Set 1 because both use /api/trips. If you choose this feature set, coordinate with the person working on the /trips page before changing the shared API.

Pull Request Workflow

For each of your two pull requests, use the same process you have practiced in earlier assignments.

Determine the spec

Decide exactly what the feature should do, including the route, query parameters, expected response shape, validation behavior, and Swagger documentation that will be needed.

Metadata in Results

For each API response that involves search, filtering, or pagination, make sure the response includes metadata about the query results, such as the search filters, the total number of items, the current page, and the number of items per page.

Create the plan

Create any GitHub issues needed for the work before you begin coding. The issue should describe the feature clearly enough that a teammate could understand what problem you are solving and how you plan to solve it.

Every pull request must have at least one related GitHub issue.

Implement the plan

Create a separate branch for the issue, implement the planned changes, test the feature, run the ESLint check and correct any reported errors, and then make sure the code is ready for teammate review.

Using AI while coding

You are welcome to use AI to help write code, but you should understand every line of code you submit clearly enough to explain to someone else why it is there and what it is doing. If you do not understand something, ask AI follow-up questions until you do.

Create a walk-through video

Record a short video that helps your reviewer understand what changed and why it was built that way.

Each video should be about 2 minutes long and no longer than 3 minutes.

  1. Explain the feature.
  2. Demonstrate the feature working.
  3. Show the code that makes the feature work and explain what each section of the code does.
  4. Discuss at least two decisions that needed to be made when the code was written. For each decision, identify the alternative choices and explain why you selected the approach you used.

Explain your understanding

Your explanation should help your teammates understand what the code does and why it is there.

In order to receive credit for this assignment, the video must clearly demonstrate that you understand the concepts and the code. If it does not, you will need to create a new video and resubmit.

Create the pull request

Create the pull request, reference the related GitHub issue, include a link to your walk-through video, and share the pull request in your Microsoft Teams channel when it is ready for review.

Requirements

Each feature must include the following:

Reflection

After both pull requests are complete, create a reflection document that describes your pagination and query work. Your reflection should include links to both pull requests you submitted for your selected route or feature.

Do not use AI for this reflection

The purpose of this document is to help you reflect on your own work and describe the choices you made. This reflection should be written in your own words.

Create your reflection document as follows:

  1. Download the Week 05 reflection template.
  2. Open the template in VS Code.
  3. Answer each question in your own words.
  4. Make sure the document includes links to both pull requests you submitted.
  5. Save the completed document as a .txt or .md file to upload to Canvas.

Submission

Return to Canvas to upload your completed reflection document.

Other Links: