docs: top-level README + CLAUDE.md reflect three-service layout

This commit is contained in:
shay
2026-04-17 17:19:23 -04:00
parent a2e7a52169
commit 74047b28fc
2 changed files with 91 additions and 78 deletions
+28 -78
View File
@@ -1,90 +1,40 @@
# GitHub README Stats
# github-readme-stats
Generate polished SVG profile cards from your GitHub data. Fetches your repos, contributions, languages, and collaborators, then renders them into composable widgets you can drop into your profile README.
A monorepo of three independent Python services plus a React frontend,
each self-contained. See each service's README for details.
<p align="center">
<img src="widget_shaymanor.svg" width="420" alt="Example composite widget" />
</p>
## Services
## Widgets
| Folder | Port | Responsibility |
|---|---|---|
| [`fetcher/`](./fetcher/README.md) | 5001 | Owns GitHub PAT + `fetcher.db`; cron-refreshes data |
| [`generator/`](./generator/README.md) | 5002 | Settings + widgets DBs, build worker, serves React SPA + `/api/*` |
| [`edge/`](./edge/README.md) | 5003 | Cache-first SVG proxy; deploy globally |
| Widget | What it shows |
|--------|--------------|
| **Grade** | Letter grade (S through F) with score breakdown, stats, and inferred role tags |
| **Impact** | Contribution timeline over the last 6 months |
| **Collaborators** | Top people you've committed alongside, ranked by shared commits |
| **Focus** | Where your recent work falls (Backend, Frontend, ML, DevOps, etc.) |
| **Languages** | Donut chart of your most-used languages by LOC |
| **Achievements** | Custom badges you define (hackathons, awards, milestones) |
## Design Docs
Each widget is also saved individually as `widget_<name>.svg`.
- Spec: [`docs/superpowers/specs/2026-04-17-production-pipeline-design.md`](docs/superpowers/specs/2026-04-17-production-pipeline-design.md)
- Plan: [`docs/superpowers/plans/2026-04-17-production-pipeline.md`](docs/superpowers/plans/2026-04-17-production-pipeline.md)
## Quick Start
## Quick start (local dev, no Docker)
```bash
# Basic (public data only)
python run.py <username>
# 1) fetcher
(cd fetcher && pip install -r requirements.txt &&
FETCHER_INTERNAL_TOKEN=dev GITHUB_PAT=<your-pat> python -m src.api) &
# With a GitHub token for full commit/contribution data
GITHUB_PAT=<your-token> python run.py <username>
# 2) generator API, worker, cron (three processes)
cd generator && pip install -r requirements.txt
FETCHER_URL=http://localhost:5001 FETCHER_INTERNAL_TOKEN=dev python -m src.api &
FETCHER_URL=http://localhost:5001 FETCHER_INTERNAL_TOKEN=dev python -m src.worker &
FETCHER_URL=http://localhost:5001 FETCHER_INTERNAL_TOKEN=dev python -m src.cron &
# Choose a theme
python run.py <username> nord
```
# 3) edge
(cd ../edge && pip install -r requirements.txt &&
GENERATOR_URL=http://localhost:5002 python -m src.api) &
Output lands in the repo root as `widget_<username>.svg`.
# 4) frontend (dev server)
cd ../generator/frontend && npm install && npm run dev
## Themes
Test everything:
Five built-in themes:
| Theme | Style |
|-------|-------|
| `midnight` / `dark` | Dark blue-gray (default) |
| `onyx` | High-contrast on near-black |
| `nord` | Muted pastels on slate |
| `clean` / `light` | White background |
| `paper` | Warm off-white, sepia accents |
## Web UI
A React frontend lets you customize widgets interactively with live preview and per-widget advanced settings (colors, counts, etc.).
```bash
# Terminal 1 — start the generator API
python -m src.generator_api # :5002
# Terminal 2 — start the frontend
cd frontend && npm install && npm run dev # :3000
```
Open `http://localhost:3000`, enter a GitHub username, tweak settings, and hit Generate.
## Configuration
All tuning lives in `src/config.py` and can be overridden with environment variables. Key knobs:
| Variable | Default | What it does |
|----------|---------|-------------|
| `GITHUB_PAT` | — | GitHub personal access token |
| `COMMIT_MAX_REPOS` | 10 | Max repos to scan for commits |
| `COMMIT_PER_REPO` | 30 | Max commits per repo |
| `COLLABORATOR_MIN_COMMITS` | 3 | Minimum shared commits to show a collaborator |
| `API_TIMEOUT` | 5 | Per-request timeout in seconds |
See [CONFIGURATION.md](CONFIGURATION.md) for the full list.
## Project Structure
```
src/
data/ # GitHub API fetching + data processing
widgets/ # One SVG renderer per widget
themes/ # Color palettes
models/ # Typed data structures
utils/ # SVG helpers
config.py # All tunables
generate.py # CLI entry point
generator_api.py # Flask API for the web UI
frontend/ # React + TypeScript + Vite
```
(cd fetcher && pytest) && (cd generator && pytest) && (cd edge && pytest)