Skip to content

About

Dashboard that tracks Sitare University students' GitHub activity with scores, leaderboards and AI insights

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Sitare GitHub Activity Tracker

A dashboard that tracks the daily GitHub activity of Sitare University students and turns it into scores, leaderboards and alerts.

Live: https://sitare-github-tracking-system.onrender.com/

TypeScript React PostgreSQL

Overview

The app keeps a list of students (GitHub usernames grouped into batches), pulls their public activity from the GitHub API every day, and stores a per-day history of commits, pull requests, issues and stars in PostgreSQL. From that history it computes scores, streaks, rankings and inactivity alerts. Anyone can view the dashboards; changes such as adding students, triggering syncs or tuning scoring require signing in with GitHub as an admin.

Features

  • Dashboard with headline stats, recent activity charts, top performers and students who need attention.
  • Leaderboard by daily, weekly, monthly or all-time score, filterable by batch, with CSV export.
  • Student profiles: repos, languages, 30-day activity, streaks, yearly contribution heatmap, badges, skill ratings and weekly commit/PR goals.
  • Batches and Compare pages for side-by-side comparison of batches and students.
  • Alerts page for inactive students, and most-improved / most-declined lists on the dashboard.
  • Configurable scoring: default score is commits×2 + stars×3 + PRs×4 + issues×1; admins can change the weights from the dashboard.
  • Organization sync: imports members of the Sitare-University GitHub organization as students.
  • AI insights (optional): per-student insights, a weekly report, peer recommendations and a natural-language "ask about the data" box, using Google Gemini.
  • Automatic syncing: a daily cron job at 02:00 server time, an optional POST /api/run-daily endpoint for external schedulers, and an optional GitHub push webhook for near-real-time updates.
  • GitHub OAuth login with an admin allow-list for all write actions.

Tech stack

  • Frontend: React, Vite, Tailwind CSS, shadcn/ui (Radix), Recharts, Wouter, TanStack Query
  • Backend: Node.js, Express 5, node-cron, Pino
  • Database: PostgreSQL with Drizzle ORM
  • API contract: OpenAPI spec with Orval-generated React Query hooks and Zod schemas
  • AI: Google Gemini (@google/genai)
  • Tooling: pnpm workspaces, TypeScript, esbuild, Vitest
  • Hosting: Render (render.yaml)

How it works

flowchart LR
    GH[GitHub REST + GraphQL API] -->|daily cron / admin sync / webhook| API[Express API]
    API --> DB[(PostgreSQL)]
    API -->|optional| GEM[Gemini]
    UI[React dashboard] -->|/api| API
Loading

The API server fetches each student's profile, repositories and public events from the GitHub REST API and stores daily activity rows. With a GITHUB_TOKEN set it also reads the contribution calendar through the GraphQL API and gets a much higher rate limit. All statistics, leaderboards and alerts are computed from the stored history. In production the same Express server also serves the built React app.

Getting started

Prerequisites

  • Node.js 24 (the start script uses --env-file-if-exists, which needs Node 22.9 or later)
  • pnpm (installing with npm or yarn is blocked)
  • A PostgreSQL database

Install

git clone https://github.com/ISHANT57/sitare-github-tracker.git
cd sitare-github-tracker
pnpm install

Environment variables

Copy artifacts/api-server/.env.example to artifacts/api-server/.env and fill it in. The API server loads that file on start.

Variable Required Purpose
DATABASE_URL or NEON_DATABASE_URL Yes PostgreSQL connection string
PORT Yes Port for the API server
NODE_ENV Yes Set to production to serve the built frontend from the API server
SESSION_SECRET For login Signs the session cookie
GITHUB_OAUTH_CLIENT_ID, GITHUB_OAUTH_CLIENT_SECRET For login GitHub OAuth App; callback URL is <your origin>/api/auth/github/callback
ADMIN_GITHUB_USERNAMES For admin actions Comma-separated GitHub usernames allowed to make changes
PUBLIC_APP_URL No Public URL used to build the OAuth redirect
GITHUB_TOKEN No Raises GitHub rate limits and enables contribution calendars
GEMINI_API_KEY No Enables AI insights and AI queries
APP_TIMEZONE No IANA timezone used for "today" (defaults to UTC)
CRON_SECRET No Bearer secret for POST /api/run-daily
GITHUB_WEBHOOK_SECRET No Enables POST /api/webhooks/github

Run locally

# 1. Create the database tables (drizzle-kit reads DATABASE_URL from the shell, not from .env)
DATABASE_URL=<your connection string> pnpm --filter @workspace/db run push

# 2. Build the frontend and the API server
BASE_PATH=/ PORT=3000 pnpm --filter @workspace/github-tracker run build
pnpm --filter @workspace/api-server run build

# 3. Start the server (serves the API under /api and the dashboard at /)
pnpm --filter @workspace/api-server run start

Then open http://localhost:<PORT>. To populate students, sign in as an admin and use the dashboard's sync controls, or add students individually.

Other useful commands:

pnpm run typecheck                                  # typecheck all packages
pnpm --filter @workspace/api-server run test        # run the Vitest unit tests
pnpm --filter @workspace/api-spec run codegen       # regenerate the API client from openapi.yaml

Project structure

artifacts/
  api-server/       Express API: routes, GitHub sync, scoring, auth, AI insights
  github-tracker/   React dashboard (pages, charts, components)
lib/
  api-spec/         OpenAPI spec and Orval config
  api-client-react/ Generated React Query hooks
  api-zod/          Generated Zod schemas
  db/               Drizzle schema and database client
scripts/            One-off maintenance scripts (seeding, score recalculation)
render.yaml         Render deployment config

About

Dashboard that tracks Sitare University students' GitHub activity with scores, leaderboards and AI insights

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages