Skip to content

Adithya Popularity By Timeline Chart Backend#1704

Merged
one-community merged 11 commits intodevelopmentfrom
adithya_impl_popularity_timeline_backend
Oct 15, 2025
Merged

Adithya Popularity By Timeline Chart Backend#1704
one-community merged 11 commits intodevelopmentfrom
adithya_impl_popularity_timeline_backend

Conversation

@adithya-6101
Copy link
Copy Markdown
Contributor

@adithya-6101 adithya-6101 commented Sep 5, 2025

Description

This backend PR implements the Popularity Timeline chart for Job Posting Page Analytics.
It introduces a new popularityTimeline model and APIs to fetch monthly hits and applications for job postings, with filters for date range and job role.

Screenshot 2025-09-05 004008

Related PRS (if any):

This backend PR is related to the frontend PR Adithya Popularity By Timeline Chart Frontend.
To test this backend PR, checkout the corresponding frontend PR.

Main changes explained:

  • Added popularityTimeline.js model to store:
    • Month (e.g., "January 2024")
    • Hits count
    • Applications count
    • Role (for filtering)
    • Timestamp (for sorting & filtering)
  • Added new routes in popularityTimelineRoutes.js:
    • GET /popularity?range=12months — fetch last 12 months data
    • GET /popularity?roles=[role1,role2] — filter by roles
    • GET /popularity?start=YYYY-MM&end=YYYY-MM — fetch custom date ranges
  • Aggregates data by month and role for frontend consumption.
  • Implements efficient database indexing for faster queries.

How to test:

  1. Checkout the branch adithya_impl_popularity_timeline_backend.
  2. Run npm install to install dependencies.
  3. Run the backend locally with npm run dev.
  4. Test the API endpoints using Postman:
    • GET http://localhost:4500/api/popularity?range=12months
    • GET http://localhost:4500/api/popularity?roles=["Backend Developer", "Full Stack Developer"]
    • GET http://localhost:4500/api/popularity?start=2024-03&end=2025-09
  5. Verify that the response includes hits and applications.
  6. Optionally, test with the frontend to confirm chart updates correctly with filters.

Screenshots or videos of changes:

Screenshot 2025-09-04 213008 Screenshot 2025-09-04 213111 Screenshot 2025-09-04 213054

Note:

  • This PR focuses only on backend logic and API endpoints.
  • Frontend visualization and chart rendering are handled in the related frontend PR.

@adithya-6101 adithya-6101 added the Do Not Review Do not review or look at code without full context label Sep 5, 2025
@adithya-6101 adithya-6101 removed the Do Not Review Do not review or look at code without full context label Sep 5, 2025
Copy link
Copy Markdown
Contributor

@akshith312 akshith312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the PR locally. All the end points return the desired results with different parameters.

image image image

Copy link
Copy Markdown
Contributor

@harshavarma29 harshavarma29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested the PR for the below listed scenarios, it is working fine. However, I have request changes in the related Frontend PR.

  1. Range fitler:
    date_range_working_fine

  2. Role filter:
    roles_filter_working_fine

  3. Custom range filter:
    custom-date-range-working-fine

@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Oct 6, 2025
@one-community
Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community one-community merged commit bb81894 into development Oct 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants