8000 GitHub - kamranXd/devboard · GitHub
[go: up one dir, main page]

Skip to content
kamranXdPublic

Repository files navigation

📊 DevBoard

A developer productivity dashboard — projects, tasks, and real GitHub analytics in one place.

Built to show depth over breadth: no UI kit, no chart library, no state library — just React 18, TypeScript, and well-designed layers.

React TypeScript Vite Tailwind CSS License: MIT

Features · Tech stack · Architecture · Getting started · Roadmap

Tip

On the login screen, click “Try the demo account” to explore a fully pre-seeded dashboard instantly — no signup needed.

✨ Features

Area What's included
Dashboard Greeting + date, stat cards (active projects, due today, completed this week, GitHub streak), GitHub profile card, contribution-style activity heatmap, coding stats (stars/forks/languages), current projects with progress bars, upcoming deadlines, productivity overview with weekly chart + goal ring
Projects Create / edit / delete, status flow Planning → In Progress → Completed, progress sliders, technology chips, GitHub/demo links, status filter tabs
Task Manager Add / edit / delete, priorities, due dates (overdue + today highlighting), status/priority/project filters, free-text search, inline completion toggle
GitHub Integration Debounced username search against the real GitHub REST API, profile summary, activity heatmap from public events, repo grid (stars, forks, language, topics), repo details page with stats, language breakdown and recent commits
Auth simulation Login/register UI, protected routes, session persisted in localStorage, one-click demo account, per-user data namespaces. (Simulation only — passwords are obfuscated, not hashed.)
Settings Dark/light mode, profile settings, default GitHub username, optional personal access token, weekly task goal, JSON export, clear-all-data

🧱 Tech stack

Layer Choice Why
Build tool Vite Native-ESM dev server, instant HMR, esbuild production builds
UI React 18 Concurrent-friendly hooks model; StrictMode used to surface effect bugs in dev
Language TypeScript (strict) Domain models and GitHub API DTOs are fully typed end-to-end
Styling Tailwind CSS Utility-first with class-based dark mode, applied pre-paint to avoid theme flash
Routing React Router v6 Layout routes + <Outlet />-based protected routes
State Context + custom hooks App state is small and per-user; server (GitHub) data is request-scoped with its own cache

Only two runtime dependencies: react and react-router-dom. Icons are inline SVG components and the charts/heatmap are hand-rolled from divs and derived state — on purpose.

🏗 Architecture

GitHub REST API
     ↓
API service layer        src/services/githubApi.ts (fetch + sessionStorage cache + typed errors)
     ↓
Custom React hooks       src/hooks/useGitHub.ts (useGitHubSearch, useGitHubProfile, useGitHubRepo)
     ↓
State                    src/state/* (Auth, Theme, Settings, Projects, Tasks contexts)
     ↓
Components               src/components/* (UI kit, layout, dashboard widgets, forms)
     ↓
Pages / Dashboard        src/pages/* + src/App.tsx (routing with protected routes)

React code never calls fetch directly, and services never import React — any layer can be swapped (e.g. localStorage → a real backend) without touching the UI.

Key implementation details:

  • 🔁 Request caching + rate-limit handling — src/services/githubApi.ts: a single gh<T>() wrapper adds a 10-minute sessionStorage cache, optional Bearer-token auth, and maps 403/429 to friendly “rate limit exceeded — add a token in Settings” errors.
  • 🔎 Debounced search with race-condition safety — src/hooks/useGitHub.ts: 350 ms debounce plus a cancelled flag in effect cleanup so stale responses can never overwrite fresh ones.
  • 💾 Per-user persistence core — src/state/useUserCollection.ts: a generic hook that namespaces storage per user (projects:<uid>), seeds demo data, and persists on mutation, not in a render effect (avoids a StrictMode stale-write race).
  • 📅 Contribution heatmap from scratch — src/components/dashboard/ActivityHeatmap.tsx: buckets GitHub events by day, builds 26 Sunday-aligned weekly columns, maps counts to 5 color levels, and computes the current streak — all inside useMemo.
  • 🔐 Protected routes — src/router.tsx: redirects unauthenticated users to /login with replace + state.from so login can return you to where you were heading.

🚀 Getting started

git clone https://github.com/<your-username>/devboard.git
cd devboard
npm install
npm run dev      # → http://localhost:5173

Requires Node 18+. No environment variables needed — the GitHub integration works unauthenticated out of the box (60 req/hour), and you can optionally paste a personal access token in Settings → GitHub integration to raise it to 5,000 req/hour. The token never leaves your browser.

📜 Scripts

Command Purpose
npm run dev Vite dev server
npm run build tsc --noEmit typecheck + production build
npm run preview Serve the production build locally
npm run typecheck TypeScript only

📝 Notes

  • Rate limits: the unauthenticated GitHub API allows 60 requests/hour per IP. Responses are cached in sessionStorage for 10 minutes (per tab, so stale GitHub data never outlives the session).
  • Activity heatmap: GitHub's public events API retains roughly the last 90 days, so the ~6-month heatmap degrades gracefully for inactive accounts.
  • Persistence keys all live under the devboard: namespace: users, session, projects:<uid>, tasks:<uid>, settings:<uid>, theme, and the ghcache: prefix. All storage access is try/catch-wrapped so a full quota degrades to in-memory operation.

🗺 Roadmap

  • Drag-and-drop kanban board for tasks
  • Real backend behind the existing service seam (REST + proper password hashing)
  • Test suite: Vitest + React Testing Library, with msw mocking the GitHub API
  • Deployed live demo

📄 License

Released under the MIT License.


Built by @kamra — see also my pinned repos.

Releases

Packages

Contributors

Languages

0