Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a total visitor count section #42

Open
kaali001 opened this issue Dec 4, 2024 · 9 comments
Open

feat: Add a total visitor count section #42

kaali001 opened this issue Dec 4, 2024 · 9 comments
Assignees
Labels

Comments

@kaali001
Copy link
Owner

kaali001 commented Dec 4, 2024

Describe the solution you'd like

The landing page requires a section which tells the total number of visitor visited this site. It can be implemented below feedback section.

Additional context

Add a API call at landing page to fetch a visitor count and also a post request API to update this count in backend. this visitor model should include timestamp of creation.

@Sourav6971
Copy link

@kaali001 I can work on this feature. Do you want to use any third party API or we could just create a database schema and implement it.

@kaali001
Copy link
Owner Author

kaali001 commented Jan 1, 2025

Hey @Sourav6971 ,
This feature is expected to be implemented on the home page, It's better to not use third party API for this, you can create a model for this as mentioned in description. And this section should be added on the home page below feedback section.
Good to go.

@Sourav6971
Copy link

Do you have any specific design in your mind regarding how it should be implemented

@kaali001
Copy link
Owner Author

kaali001 commented Jan 2, 2025

I don't have figma design for this right now but you can consider another sites for general idea of how it must appear, and follow the colour pallet and text font of home page. You can find this mentioned in previous closed issues.

@Sourav6971
Copy link

My proposed solution is to add a middleware where whenever the home page url is hit or refreshed it increments the total visitors count. Can I ho ahead with this approach?

@kaali001
Copy link
Owner Author

kaali001 commented Jan 2, 2025

And you have to consider below points:

  1. use local storage to store if the visit already counted , use a boolean value with 24 hour expire time to store it in local storage, this will ensure not count again and again in this time frame.

  2. Create a model name "visitor" with date of creation and store it.

  3. The total visitor count would be no. of datasets in "visitor" model. Which will be further fetched on home page.

  4. Add some animation on visitor count numbers , and it should dynamically change.

@Sourav6971
Copy link

The visitor model will have date of what? visiting the page?

@kaali001
Copy link
Owner Author

kaali001 commented Jan 2, 2025

See the existing model at server/model. Its attribute "created At".

@Sourav6971
Copy link

got it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants