Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Feature: Add click tracking for resource cards (clickCount & clickEvents)

クローズ
#26 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

関連するプルリクエストがすでにマージされています。

  • #64 @rootsiemen による — マージ済み

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
65/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
supabase, typescript

調査の方向性

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 の本文から書いたものです。

説明

enhancement good first issue

Description

The database schema (src/db/schema.ts lines 59, 94-101) includes:

  • clickCount on resources table (integer, default 0)
  • clickEvents table 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.tsx line 130-134: "View offer" link is a plain <a> tag with no click tracking
  • No API endpoint for recording clicks
  • Admin dashboard shows clickCount in theory but it's always 0

Expected Behavior

  1. Clicking "View offer" increments clickCount on the resource
  2. Creates a row in clickEvents with resourceId, optional userId (if signed in), and timestamp
  3. 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 clicks
  • src/components/directory/resource-card.tsx - add click handler before navigation
  • src/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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。