the-canonizer / canonizer-3.0-api

1 stars 0 forks source link

Tracking Topic/Camp Views #1020

Open sunnyjindal opened 5 months ago

sunnyjindal commented 5 months ago

Each camp should have a view count. The idea of the view count is to increase it by 1 whenever any user views that camp statement.

Certain things to consider: Database Logging: Each time a page is requested, the server logs the request and increments the view count stored in a database. Session Handling: To avoid counting multiple views from the same user within a short period, the server can track user sessions and ensure that repeated views within a single session are only counted once. Cookies: By setting cookies, the camp page can track if a user has visited the page before and decide whether to increment the view count based on that information.

array-junkie commented 4 months ago

After deploying this ticket (Backend)

  1. Add the following keys to the .env file
HASH_MEMORY_COST=
HASH_ITERATION=
HASH_PARALLELISM_FACTOR=
  1. Run the migration
php artisan migrate
  1. Create a new queue in Service Repo with the name camp-views-count.
sajid315 commented 1 week ago

@saniatg , @rupalichavan9860 this ticket has been verified on ux-dev server and working as expected. Views are increasing for each camp, once the view is counted for a user system will recount it after the time set in front-end ENV (probably 4 hours for each user each view). Also cookies are creating on ux-dev as above described in the ticket details.