Skip to content

feat: implement analytics dashboard and fix server-side filtering#255

Open
ishwari418 wants to merge 2 commits into
GitMetricsLab:mainfrom
ishwari418:feat/dashboard-and-filtering-fix
Open

feat: implement analytics dashboard and fix server-side filtering#255
ishwari418 wants to merge 2 commits into
GitMetricsLab:mainfrom
ishwari418:feat/dashboard-and-filtering-fix

Conversation

@ishwari418
Copy link
Copy Markdown

@ishwari418 ishwari418 commented May 15, 2026

Related Issue

Description
This PR introduces two major improvements to the GitHub Tracker:

Analytics Dashboard: Added a visual summary section at the top of the Tracker page using Recharts. It includes a Pie Chart for contribution mix (Issues vs. PRs) and a Bar Chart for activity by repository.
Server-Side Filtering: Refactored the filtering and search logic to use the GitHub Search API. This fixes a bug where filters only applied to the first 10 items. Users can now search and filter across their entire contribution history.
Code Optimization: Renamed core components for better maintainability and optimized API requests to reduce rate-limit usage.
How Has This Been Tested?
Manual Testing: Verified on localhost:5173 using a Personal Access Token.
Search Verification: Confirmed that searching for titles now works across multiple pages of data.
Visual Check: Verified that the Dashboard is fully responsive and compatible with the existing Dark/Light mode theme.

Type of Change
Bug fix
New feature

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a new Dashboard component with visual charts displaying GitHub issues and pull request statistics.
    • Enhanced data filtering capabilities with support for search, repository selection, date ranges, and state filtering.
    • Dashboard displays pie charts for issue/PR totals and bar charts for top repository metrics.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 15, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit 257c23d
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a070054c1f7a50009f6c7bf
😎 Deploy Preview https://deploy-preview-255--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@ishwari418 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 31 minutes and 40 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 690dc1b4-0649-4396-af6a-62493cff4385

📥 Commits

Reviewing files that changed from the base of the PR and between 6de67e9 and 257c23d.

📒 Files selected for processing (10)
  • package.json
  • src/components/Dashboard.tsx
  • src/hooks/useDebounce.ts
  • src/hooks/useGitHubAuth.ts
  • src/hooks/useGitHubData.ts
  • src/pages/ContributorProfile/ContributorProfile.tsx
  • src/pages/Contributors/Contributors.tsx
  • src/pages/Login/Login.tsx
  • src/pages/Signup/Signup.tsx
  • src/pages/Tracker/Tracker.tsx
📝 Walkthrough

Walkthrough

This PR adds an analytics dashboard with interactive charts to the GitHub tracker application. It extends the data fetching hook with server-side filtering capabilities, introduces a new Dashboard component using recharts to visualize issue/PR distribution and repository activity, and refactors the Tracker page to integrate the dashboard and support advanced filtering.

Changes

Analytics Dashboard Implementation

Layer / File(s) Summary
Library dependencies
package.json
Recharts, mongoose, and express packages added to support chart visualization and backend services.
Dashboard visualization component
src/components/Dashboard.tsx
New component renders pie chart for issue/PR status distribution and bar chart for top-5 active repositories; accepts totals, combined data array, and theme for responsive rendering with Recharts PieChart, BarChart, and associated chart elements.
GitHub data hook with advanced filtering
src/hooks/useGitHubData.ts
fetchPaginated helper extended to accept filters object and dynamically build GitHub search query with optional title, repository, date range, and state parameters; fetchData signature updated to accept optional type and filters, conditionally fetching single or both entity types with rate-limit detection.
Tracker page refactoring and dashboard integration
src/pages/Tracker/Tracker.tsx
Component renamed from Home to Tracker; useEffect now builds filters object from form inputs and passes type and filters to hook; client-side filtering removed and replaced with direct tab-based data selection; Dashboard component conditionally rendered above table with totals and current tab's raw data; default export updated to Tracker.

Sequence Diagram

sequenceDiagram
  participant User
  participant Tracker
  participant useGitHubData
  participant GitHubAPI
  participant Dashboard

  User->>Tracker: Set filters (search, repo, date, state)
  Tracker->>Tracker: Build filters object
  Tracker->>useGitHubData: fetchData(username, page, type, filters)
  useGitHubData->>GitHubAPI: GET /search/issues?q=...+filters
  GitHubAPI-->>useGitHubData: issues and PRs
  useGitHubData-->>Tracker: data with totalIssues/totalPrs
  Tracker->>Dashboard: Pass totals + data + theme
  Dashboard-->>User: Render pie chart + bar chart
  Tracker-->>User: Render data table
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • GitMetricsLab/github_tracker#149: Both PRs extend src/hooks/useGitHubData.ts with enhanced pagination and separate tracking of totalIssues and totalPrs, with this PR further adding type and filters parameters.
  • GitMetricsLab/github_tracker#182: Both PRs add or upgrade the recharts dependency in package.json, which this PR uses for the new Dashboard component.

Suggested labels

gssoc25, level2

Poem

🐰 A dashboard of charts now gleams so bright,
With pies and bars to catch the light,
Issues and PRs in colors dancing free,
The big picture at last, for all to see! 📊✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR partially addresses #253 with a Pie Chart and Bar Chart but omits Activity Timeline (30-day line graph) and Activity Summary Cards (Total Issues, PRs, Merged count display). Implement the missing Activity Timeline visualization and Activity Summary Cards with specific metric counts to fully satisfy #253 requirements.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the two main changes: implementing an analytics dashboard and fixing server-side filtering with specific terminology.
Description check ✅ Passed The description follows the template with all sections filled: Related Issue (#253), comprehensive Description, How Has This Been Tested, and Type of Change selections.
Out of Scope Changes check ✅ Passed All changes are directly aligned with #253 objectives: Dashboard implementation, server-side filtering via GitHub Search API, component renaming for maintainability, and API optimization are all in scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Thank you @ishwari418 for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/hooks/useGitHubData.ts (1)

47-89: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

rateLimited is set but never cleared — the hook gets permanently blocked.

Once a 403 is hit, setRateLimited(true) runs and the early return on line 50 (if (!octokit || !username || rateLimited) return;) prevents every subsequent call for the lifetime of the component. There's no timeout, no reset on token/username change, and no manual recovery path, so users have to do a full page reload after a single rate-limit error — even after the GitHub window resets or they paste a different PAT.

Consider resetting rateLimited when getOctokit/username changes, or expose a reset function from the hook and call it on form submit / auth change. Optionally honor the X-RateLimit-Reset header and auto-clear after that timestamp.

🛠️ Suggested reset on auth change
   const fetchData = useCallback(
     async (username: string, page = 1, perPage = 10, type?: 'issue' | 'pr', filters: any = {}) => {
       const octokit = getOctokit();
       if (!octokit || !username || rateLimited) return;
+      // reset transient errors on a fresh, non-rate-limited call
+      setError('');
       ...
     },
     [getOctokit, rateLimited]
   );
+
+  const reset = useCallback(() => {
+    setRateLimited(false);
+    setError('');
+  }, []);
+
   return {
     issues,
     prs,
     totalIssues,
     totalPrs,
     loading,
     error,
     fetchData,
+    reset,
   };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/useGitHubData.ts` around lines 47 - 89, The hook permanently blocks
fetches because fetchData (inside useCallback) returns early when the
rateLimited flag is true; update the hook to clear rateLimited when auth or
username changes and provide a manual reset: add logic to reset
setRateLimited(false) when getOctokit() or the username argument changes (e.g.,
in an effect watching getOctokit/username) and expose a reset function from the
hook (e.g., resetRateLimit) that calls setRateLimited(false) so callers (form
submit/auth change) can clear the block; optionally, when catching the 403 in
fetchData, parse the X-RateLimit-Reset header from the response returned by
fetchPaginated and schedule an automatic setRateLimited(false) after that
timestamp.
🧹 Nitpick comments (5)
src/hooks/useGitHubData.ts (1)

12-19: ⚡ Quick win

Replace filters: any with an explicit type.

any removes the main benefit of TS here — typos in keys (startData instead of startDate) silently produce broken queries. A small interface near the top of the file documents the contract and protects callers like Tracker.tsx.

♻️ Suggested type
+export interface GitHubDataFilters {
+  search?: string;
+  repo?: string;
+  startDate?: string;
+  endDate?: string;
+  state?: 'all' | 'open' | 'closed' | 'merged';
+}
+
   const fetchPaginated = async (
     octokit: any,
     username: string,
     type: string,
     page = 1,
     per_page = 10,
-    filters: any = {}
+    filters: GitHubDataFilters = {}
   ) => {
-    async (username: string, page = 1, perPage = 10, type?: 'issue' | 'pr', filters: any = {}) => {
+    async (username: string, page = 1, perPage = 10, type?: 'issue' | 'pr', filters: GitHubDataFilters = {}) => {

Also applies to: 47-48

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/useGitHubData.ts` around lines 12 - 19, Define a strict interface
(e.g., GitHubFetchFilters) near the top of the file and replace the loose
filters: any in the fetchPaginated function signature with filters:
GitHubFetchFilters; the interface should include the expected keys (for example
optional startDate?: string, endDate?: string, repoNames?: string[],
includeForks?: boolean, etc.) so typos are caught at compile time, and update
the other occurrences that currently use filters: any (the ones referenced
around the other function signatures/calls) to use GitHubFetchFilters as well.
src/pages/Tracker/Tracker.tsx (1)

131-171: 💤 Low value

Reuse currentFilteredData instead of recomputing the tab selection.

currentFilteredData on Line 132 already represents tab === 0 ? issues : prs. Passing it through keeps the two sites in sync if the selection rule ever changes.

♻️ Tiny dedup
-        <Dashboard 
-          totalIssues={totalIssues} 
-          totalPrs={totalPrs} 
-          data={tab === 0 ? issues : prs} 
-          theme={theme}
-        />
+        <Dashboard
+          totalIssues={totalIssues}
+          totalPrs={totalPrs}
+          data={currentFilteredData}
+          theme={theme}
+        />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/Tracker/Tracker.tsx` around lines 131 - 171, The Dashboard is being
passed a recomputed tab selection (data={tab === 0 ? issues : prs}) even though
currentFilteredData already holds that value; update the Dashboard invocation to
pass data={currentFilteredData} instead (referencing currentFilteredData and the
Dashboard component) so the selection logic is centralized and stays consistent
if the rule changes.
src/components/Dashboard.tsx (3)

27-30: 💤 Low value

Consider adding empty state handling.

When both totalIssues and totalPrs are 0, the pie chart renders but displays no meaningful data. Consider showing a "No data available" message instead.

📊 Proposed empty state check
+const hasData = totalIssues > 0 || totalPrs > 0;
+
 const pieData = [
   { name: 'Issues', value: totalIssues },
   { name: 'Pull Requests', value: totalPrs },
 ];

Then conditionally render the chart or a fallback message based on hasData.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Dashboard.tsx` around lines 27 - 30, The pie chart should
handle the empty state when both totalIssues and totalPrs are 0: compute a
hasData flag (e.g., const hasData = totalIssues + totalPrs > 0) and
conditionally render either the pie chart using pieData or a simple fallback
UI/message like "No data available" inside the Dashboard component (where
pieData, totalIssues and totalPrs are defined) so the chart area shows a clear
empty state instead of an empty pie.

32-32: 💤 Low value

Consider using theme-aware colors for better consistency.

The hard-coded COLORS array doesn't adapt to the theme. Using theme palette colors would ensure consistency with the rest of the application's color scheme.

🎨 Proposed theme-aware colors
-const COLORS = ['#0088FE', '#00C49F'];
+const COLORS = [theme.palette.primary.main, theme.palette.secondary.main];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Dashboard.tsx` at line 32, The hard-coded COLORS array in
Dashboard (const COLORS) should be replaced with theme-aware colors so the chart
adapts to the app palette; inside the Dashboard component use the app theme
(e.g., via useTheme() or the project’s theme hook) and derive COLORS from
theme.palette (for example primary/main and secondary/main or suitable
contrast/variant keys) and update any consumers of COLORS (chart props or
components that reference const COLORS) to use the new theme-derived array.

17-22: ⚡ Quick win

Replace any types with proper TypeScript interfaces.

Using any for data and theme defeats TypeScript's type safety and can lead to runtime errors if the wrong shape is passed.

♻️ Proposed type definitions
+interface DataItem {
+  repository_url: string;
+  // Add other properties as needed based on the actual data structure
+}
+
+interface Theme {
+  palette: {
+    background: {
+      paper: string;
+    };
+  };
+}
+
 interface DashboardProps {
   totalIssues: number;
   totalPrs: number;
-  data: any[];
-  theme: any;
+  data: DataItem[];
+  theme: Theme;
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Dashboard.tsx` around lines 17 - 22, The DashboardProps uses
unsafe any types for data and theme; define proper interfaces (e.g., DataItem or
IssuePrItem and DashboardTheme) that reflect the actual shapes used by the
component (for DataItem include fields like id, type ('issue'|'pr'), title,
createdAt, author, state, url and any metadata the component accesses; for
DashboardTheme include colors, spacing, and any theme properties read by the
component) and replace data: any[] with data: DataItem[] and theme: any with
theme: DashboardTheme in the DashboardProps (and update the Dashboard component
signature and any usages to import/consume these interfaces).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 22: package.json includes server-side dependencies "express" and
"mongoose" that likely aren't used in this frontend React/Vite project; search
the repository for imports/usages of express and mongoose (look for "express"
and "mongoose" strings and any server-related folders or files) and if there are
no imports or backend files (no API/server code), remove these dependencies from
package.json and package-lock or yarn.lock and update install scripts (run
npm/yarn install after removal); if they are required by a new backend module,
instead move that module into a dedicated backend package or workspace and add
express/mongoose only to that server package to avoid bloating the frontend.

In `@src/components/Dashboard.tsx`:
- Around line 36-39: The loop using data.forEach that computes repoName from
item.repository_url is unsafe and fragile: add a null/undefined guard for item
and item.repository_url before splitting and fallback when parsing fails, then
derive repoName more robustly (e.g., trim, remove trailing slashes, attempt to
parse with the URL constructor or split on '/' from the end while ignoring empty
segments) and only increment repoCounts[repoName] when repoName is non-empty;
update the function/loop that references repository_url and repoCounts to use
this validated parsing and fallback behavior to avoid runtime errors.

In `@src/hooks/useGitHubData.ts`:
- Around line 56-76: When fetching GitHub data in the type-branching block,
avoid leaving the inactive tab’s total stale and stop older requests from
stomping newer state: update the flow in the function that calls fetchPaginated
so that when filters/search/repo/date change you still fetch both sides (or at
minimum fetch the other side’s total) instead of only updating
setIssues/setTotalIssues or setPrs/setTotalPrs for the active type; and add
request cancellation/ordering protection by using an AbortController passed into
fetchPaginated/octokit.request or by tracking an incremental requestId in the
enclosing fetchData and ignoring any responses whose id is older than the latest
before calling setIssues/setPrs/setTotalIssues/setTotalPrs.

In `@src/pages/Tracker/Tracker.tsx`:
- Line 95: The effect in the Tracker component currently includes searchTitle
and selectedRepo in its dependency array and those states update on every
keystroke (handlers around lines 175–202), causing a GitHub Search API call per
character; fix by introducing debounced versions of those inputs (e.g.,
useDebouncedValue or a small debounce hook) and use the debounced values in the
effect dependency array and API call instead of raw searchTitle/selectedRepo,
with the input handlers still updating immediate state but the API driven only
by the debounced state (debounce delay ~300–500ms) so rapid typing won’t trigger
multiple search requests.
- Around line 82-101: The effect that calls fetchData omits username from its
dependency array and handleSubmit is a no-op when page is already 0, so add
username to the useEffect deps and make handleSubmit explicitly trigger a fetch
(or set a submitted boolean that is included in the deps) to guarantee an
initial fetch; specifically, update the dependency list of the useEffect that
references fetchData/username/tab/page/... to include username, and modify
handleSubmit (which currently calls setPage(0)) to either call
fetchData(username, 1, ROWS_PER_PAGE, tab === 0 ? "issue" : "pr", { search:
searchTitle, repo: selectedRepo, startDate, endDate, state: tab === 0 ?
issueFilter : prFilter }) directly or set a new submitted state that the
useEffect watches so the fetch runs even when page === 0.

---

Outside diff comments:
In `@src/hooks/useGitHubData.ts`:
- Around line 47-89: The hook permanently blocks fetches because fetchData
(inside useCallback) returns early when the rateLimited flag is true; update the
hook to clear rateLimited when auth or username changes and provide a manual
reset: add logic to reset setRateLimited(false) when getOctokit() or the
username argument changes (e.g., in an effect watching getOctokit/username) and
expose a reset function from the hook (e.g., resetRateLimit) that calls
setRateLimited(false) so callers (form submit/auth change) can clear the block;
optionally, when catching the 403 in fetchData, parse the X-RateLimit-Reset
header from the response returned by fetchPaginated and schedule an automatic
setRateLimited(false) after that timestamp.

---

Nitpick comments:
In `@src/components/Dashboard.tsx`:
- Around line 27-30: The pie chart should handle the empty state when both
totalIssues and totalPrs are 0: compute a hasData flag (e.g., const hasData =
totalIssues + totalPrs > 0) and conditionally render either the pie chart using
pieData or a simple fallback UI/message like "No data available" inside the
Dashboard component (where pieData, totalIssues and totalPrs are defined) so the
chart area shows a clear empty state instead of an empty pie.
- Line 32: The hard-coded COLORS array in Dashboard (const COLORS) should be
replaced with theme-aware colors so the chart adapts to the app palette; inside
the Dashboard component use the app theme (e.g., via useTheme() or the project’s
theme hook) and derive COLORS from theme.palette (for example primary/main and
secondary/main or suitable contrast/variant keys) and update any consumers of
COLORS (chart props or components that reference const COLORS) to use the new
theme-derived array.
- Around line 17-22: The DashboardProps uses unsafe any types for data and
theme; define proper interfaces (e.g., DataItem or IssuePrItem and
DashboardTheme) that reflect the actual shapes used by the component (for
DataItem include fields like id, type ('issue'|'pr'), title, createdAt, author,
state, url and any metadata the component accesses; for DashboardTheme include
colors, spacing, and any theme properties read by the component) and replace
data: any[] with data: DataItem[] and theme: any with theme: DashboardTheme in
the DashboardProps (and update the Dashboard component signature and any usages
to import/consume these interfaces).

In `@src/hooks/useGitHubData.ts`:
- Around line 12-19: Define a strict interface (e.g., GitHubFetchFilters) near
the top of the file and replace the loose filters: any in the fetchPaginated
function signature with filters: GitHubFetchFilters; the interface should
include the expected keys (for example optional startDate?: string, endDate?:
string, repoNames?: string[], includeForks?: boolean, etc.) so typos are caught
at compile time, and update the other occurrences that currently use filters:
any (the ones referenced around the other function signatures/calls) to use
GitHubFetchFilters as well.

In `@src/pages/Tracker/Tracker.tsx`:
- Around line 131-171: The Dashboard is being passed a recomputed tab selection
(data={tab === 0 ? issues : prs}) even though currentFilteredData already holds
that value; update the Dashboard invocation to pass data={currentFilteredData}
instead (referencing currentFilteredData and the Dashboard component) so the
selection logic is centralized and stays consistent if the rule changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b38d8a7c-dcbf-42d0-9f20-ef0cd431796c

📥 Commits

Reviewing files that changed from the base of the PR and between 56e17a3 and 6de67e9.

📒 Files selected for processing (4)
  • package.json
  • src/components/Dashboard.tsx
  • src/hooks/useGitHubData.ts
  • src/pages/Tracker/Tracker.tsx

Comment thread package.json Outdated
"@primer/octicons-react": "^19.15.5",
"@vitejs/plugin-react": "^4.3.3",
"axios": "^1.7.7",
"express": "^5.2.1",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚖️ Poor tradeoff

Verify that express and mongoose are actually required.

These are backend/server-side packages being added to a frontend React application. Based on the PR context, this appears to be a Vite-based frontend-only app with no backend server implementation shown. Adding server-side dependencies to a frontend project can:

  • Bloat node_modules unnecessarily
  • Create confusion about the application architecture
  • Potentially cause build issues if accidentally imported in client code

If server-side filtering is implemented purely through the GitHub Search API (as the PR summary suggests), these dependencies may not be needed.

Run the following script to check if these packages are actually imported anywhere in the codebase:

#!/bin/bash
# Description: Search for imports of express and mongoose in the source code

echo "=== Searching for 'express' imports ==="
rg -n --type=ts --type=tsx --type=js --type=jsx "from ['\"]express['\"]|require\(['\"]express['\"]\)" src/

echo -e "\n=== Searching for 'mongoose' imports ==="
rg -n --type=ts --type=tsx --type=js --type=jsx "from ['\"]mongoose['\"]|require\(['\"]mongoose['\"]\)" src/

echo -e "\n=== Checking for any server/backend files ==="
fd -e js -e ts "server|backend|api" --type f

Also applies to: 25-25

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 22, package.json includes server-side dependencies
"express" and "mongoose" that likely aren't used in this frontend React/Vite
project; search the repository for imports/usages of express and mongoose (look
for "express" and "mongoose" strings and any server-related folders or files)
and if there are no imports or backend files (no API/server code), remove these
dependencies from package.json and package-lock or yarn.lock and update install
scripts (run npm/yarn install after removal); if they are required by a new
backend module, instead move that module into a dedicated backend package or
workspace and add express/mongoose only to that server package to avoid bloating
the frontend.

Comment thread src/components/Dashboard.tsx
Comment thread src/hooks/useGitHubData.ts Outdated
Comment thread src/pages/Tracker/Tracker.tsx
Comment thread src/pages/Tracker/Tracker.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add Analytics Dashboard with Contribution Charts

1 participant