Improve blog post view counting to track unique visitors
Add `article_views` table and update logic in `server/routes.ts` and `server/storage.ts` to record and check IP hashes before incrementing view counts, ensuring unique visitor tracking. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 23852c00-4779-460a-9e0c-d09fee4b6c92 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: d8397246-0deb-4af1-ac00-7fcd2a5d3a42 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/23852c00-4779-460a-9e0c-d09fee4b6c92/8XlN305 Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -24,6 +24,7 @@ The official website for Folx Music Television (folx.tv). Dark-themed bento grid
|
||||
|
||||
## Data Model
|
||||
- `articles`: id (serial), title, slug (unique), excerpt, content (HTML), coverImage, category, author, featured, views, publishedAt
|
||||
- `article_views`: id (serial), articleId, ipHash (sha256 truncated to 16 chars), viewedAt — tracks unique IP views per article
|
||||
|
||||
## API Endpoints
|
||||
- `GET /api/articles` - All articles
|
||||
|
||||
Reference in New Issue
Block a user