Feature: Add click tracking for resource cards (clickCount & clickEvents)
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #64 @rootsiemen による — マージ済み
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 65/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- supabase, typescript
- 領域
- analytics, database, full-stack
調査の方向性
Start with the schema entries in src/db/schema.ts lines 59 and 94-101, then read the View offer link in src/components/directory/resource-card.tsx lines 130-134 and the patterns in src/lib/resources.ts. Add the requested click recording through the proposed API or server-action path, including the optional signed-in user. Done means each click increments clickCount, creates a clickEvents row, and the existing admin dashboard displays the count.
索引モデルが issue の本文から書いたものです。
説明
Description
The database schema (src/db/schema.ts lines 59, 94-101) includes:
clickCounton resources table (integer, default 0)clickEventstable for detailed click analytics
But neither is used in the UI. When users click "View offer" on a resource card, the click should be tracked.
Current State
src/components/directory/resource-card.tsxline 130-134: "View offer" link is a plain<a>tag with no click tracking- No API endpoint for recording clicks
- Admin dashboard shows
clickCountin theory but it's always 0
Expected Behavior
- Clicking "View offer" increments
clickCounton the resource - Creates a row in
clickEventswithresourceId, optionaluserId(if signed in), and timestamp - Admin dashboard displays click counts (already set up to show if data exists)
Good First Issue Because
- Full-stack feature (frontend + API + database)
- Good for learning the codebase patterns (Server Actions, Drizzle, Supabase)
- Schema already exists - just need to wire it up
- Valuable analytics feature
Files to Modify/Create
src/app/api/click/route.ts(new) - API endpoint to record clickssrc/components/directory/resource-card.tsx- add click handler before navigationsrc/lib/resources.ts- helper function to increment click count- Optional:
src/app/admin/(dashboard)/actions.ts- if admin needs click analytics
Implementation Approach
Option A: Client-side fetch to API route before navigation (use navigator.sendBeacon for reliability)
Option B: Server Action called from the link's onClick handler
Option C: Middleware/proxy tracking (more complex)
Recommend Option A with sendBeacon for reliability.
- 主要言語
- TypeScript
- スター
- 1
- フォーク
- 6
- 平均マージ
- 1日 45分
- マージ済み PR(30日)
- 52
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apex-dev-tools/apex-log-parser#199 ·
メンテナーはふだん 1 日以内に返信
-
area/frontend/library-panels automated-triage type/bug type/ux
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
PostHog/posthog.com#21607 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
ajv-validator/ajv#2689 ·
-
[Bug]: IME confirmation Enter can submit the SSH port-forward dialog対応中かも @seijikohara が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信