How to build view count each post like Prismic blog

I see that each post has a view count. How can I build this feature, or should I integrate a third-party service?

Hey!

That's a great question!

I developed the blog comments, views, and votes as a Supabase app integrated into our Next.js website.

I wrote a blog post that explains how the commenting feature works. To keep the post concise, I excluded the sections on views and votes, but the logic is similar. I send an increase in views to a Supabase entry for the post with each visit, and when the site is rebuilt, I read the total number of views.

Does that help?

All the best
Samuel

1 Like