thinc-org / cugetreg

A course registration planning application for CU students
https://cugetreg.com
77 stars 2 forks source link

[FEATURE] Sort front page by popularity #467

Open saengowp opened 1 year ago

saengowp commented 1 year ago

Is your feature request related to a problem? Please describe.

The current front page is ordered by Course ID, which is totally arbitrarily and waste valuable front page opportunity.

And we knows that front page is likely the page visit by all user, so that's a big loss of opportunity.

Describe the solution you'd like

As a new feature, the front page should be sorted by something that will be more helpful to the user.

For this task, We should start sorting by basic properties like popularity.

Requirements

  1. It should be extremely fast, since this is the front page.
  2. It should be approximately sorted such that the user will click on it.

Tasks

Concretely, you must performs following steps:

  1. Propose the design of the system for the team to review a. Things to think about: How to query for popularity, how and when to cache, fallback, extensibility. b. You might want to use: CGR's User Event Store (ElasticSearch), Backend (NodeJS), and Cache (Redis)
  2. Implement them
  3. A/B Test the feature a. We will use simple metric like click for this b. We have Google Optimize for A/B Test.

Required Skills

You will learn following things:

In the future, we may extends it to use CGR Computation's Ranking, but that's for another time.

Advisor is @saengowp Assigned to N'Jom

saengowp commented 1 year ago

Some design idea:

  1. The search function is located at course.service.ts
  2. We have to query ElasticSearch to find out which course are popular, then cache the result for some time in Redis a. This may be done periodically using NestJS's Task Scheduler b. You can try crafting the query using Kibana's DevTool
  3. In case that elastic or redis fail, we should fallback to old ordering
  4. We should add variant parameter to search GQL query, so that we could A/B test the new and the old ordering.
  5. We have to think about how ordering is achieved a. How to find out which course is popular? (Maybe user add course event in clientlogging would tell us) b. Should ordering be per semester, per year, per study program? c. What to do during new semester when data is sparse?