All workCase study 01 / 03
ArchLens
Know how healthy any GitHub repo is, and what to fix first. Scores any public GitHub repository from 0 to 100 across seven engineering dimensions and checks its dependencies for known vulnerabilities, as a web app, a REST API, a CLI and a GitHub Action.
- Year
- 2026
- Built with
- FastAPI · SQLAlchemy · Docker

(01)The problem
Why it existsArchLens checks a repository's engineering health in one request.
By hand, you would open the README, look for a license, tests and CI, and scan recent commits and issues. ArchLens does those checks at once, shows what it found for each, and lists what is missing as fixes, most valuable first.
It reads repository metadata through the GitHub REST API and never clones the code, so an analysis takes six read-only API calls, plus one more for each dependency file it reads (seven at most). Every new analysis is stored in SQLite, so reports can be revisited, compared and shared.
(02)How it works
From the READMEDashed bracket: each step streams progress events to the browser as NDJSON, one per GitHub call.
Fetch repo metadata. Repository stats, the root file listing, languages, contributors, commits from the last 30 days and the workflow folder, read with one shared
httpx.AsyncClientandasyncio.gather. If one call fails, the others are cancelled.Check 7 dimensions. Documentation, activity, organization, community, maintainability, security and code quality: a README, license, test folder, CI workflows, lockfile,
SECURITY.md, linter and type-checker config, recent commits and open issues.Score and grade. Points add up to 100 and map to a grade from A+ (95 and above) to F (below 35) and a health tier, with the evidence behind every point.
Scan dependencies. Root manifests (
requirements*.txt,pyproject.toml,package.jsonwith its lockfile,go.mod) are read through the contents API, and pinned versions are checked against OSV.dev in one batch request, then each advisory is looked up for its severity and the version to upgrade to. If OSV is down, the report says it couldn't check, and the score formula is unchanged.Suggest next steps. Each failed check becomes a fix with the points it would add, ranked, and exportable as a Markdown checklist.
Gate pull requests. A composite GitHub Action runs the CLI in CI, writes the report to the job summary, keeps one updated PR comment and fails the job below a chosen score.
(03)Key decisions
6 choices-
One shared async client, metadata only
The six GitHub calls run concurrently through one
httpx.AsyncClientshared for the app's lifetime. If one fails (a 404 on the metadata call, say), the calls still running are cancelled instead of spending more GitHub quota. -
Upstream errors become clear responses
One error shape across the web app, the API and the CLI: a missing repository is a
404 REPO_NOT_FOUND, a used-up GitHub quota a503 RATE_LIMIT_EXCEEDED, an unreachable GitHub a502 GITHUB_UNAVAILABLE, and too many analyses a429withRetry-After. -
Cache and rate-limit for a free host
A report of the same repository and profile from the last hour is reused, and each client can start 5 new analyses per 10 minutes. An analysis that fails because GitHub is down or out of quota doesn't count towards that limit.
-
Progress from real events
POST /api/v1/analyze/streamstreams the pipeline's progress as newline-delimited JSON, one event per GitHub call, so the steps on the home page light up from what the server is actually doing, and a failed step says why. -
Scoring you can check
The
/scoringpage is generated from the scorer's own constants, and tests run the real scorer against it, so the explanation cannot drift from the code. -
Measured under load, then fixed
A Locust test against seeded reports found 30 s stalls at 50 users: async handlers made blocking database calls, so requests waiting for a pooled connection blocked the event loop. Read-only handlers became plain
defand SQLite moved toNullPool. At 50 users p95 is now 510 ms with 0 failures (one laptop run; the README has the method).
(04)Proof
Tests · CI · stack- pytest tests, GitHub mocked, no network
- 332
- CI on GitHub Actions: pytest on SQLite and PostgreSQL, Ruff, Black
- Passing
- GitHub API calls per analysis, run concurrently
- 6
Unit tests cover the scorer, the scoring page, the evidence (the real scorer over about 900 generated repositories), the fix plan, the progress events, the GitHub client and the rate limiter. Integration tests drive every page and API endpoint, including the progress stream, through FastAPI's TestClient. Dependency scanning is tested end to end with fake GitHub and OSV, and CI also runs the suite on PostgreSQL 16. CI runs
- Python 3.11+
- FastAPI
- httpx
- SQLAlchemy 2
- Alembic
- SQLite
- PostgreSQL
- OSV.dev API
- Jinja2
- Typer + Rich
- pytest
- Locust
- Ruff
- Black
- Docker
- GitHub Actions
(05)How it was built
Software development lifecyclePlan. The problem, users and scope are written down in the README. Checking a repository by hand takes about ten minutes of clicking, so ArchLens runs the checklist in one request, for people judging a repository and for maintainers who want a fix list.
Design. Routers call one service layer that the web app, REST API, CLI and GitHub Action all reuse. Four tables, versioned with six Alembic migrations.
Build. Pinned dependencies, Ruff and Black, and short-lived branches merged through pull requests since October 2026.
Test. 332 tests, run in CI on SQLite and PostgreSQL. Migrations are applied up, down and up again, and the Docker image is smoke-tested.
Deploy. A multi-stage Docker image on Render. A merge to
maindeploys only after the GitHub checks pass, and Render watches/health.Maintain. ArchLens scores itself every Monday in a scheduled workflow, and changes are recorded in a changelog.
Done: an automated acceptance check ran the main user tasks on the live demo at phone and desktop sizes, and every issue an accessibility scan (axe-core) found was fixed, both on 2026-11-09. Not done yet: testing with real users and a staging environment. Latest change, taken through every stage: an end-to-end review found that the timeout message blamed the visitor's connection when the free server was only waking up. The fix was made on a branch, tested, merged through a pull request after CI passed, and deployed. Full SDLC write-up
(06)Screenshots
From the repository



(07)Limitations
Honestly- Metadata only. It reads repository statistics, the root file listing and root dependency manifests. It does not read source files, run tests or measure coverage, and it checks direct, pinned dependencies only.
- Simple rules. A file earns points just by existing, whatever its quality, and stars say little about code health. Treat a low score as a list of things to check.
- Capped counts. Contributors and recent commits come from one page of GitHub results, so they stop at 100.
- Single instance. The rate limiter lives in memory and resets on restart.
- Ephemeral demo storage. On the free host, reports other than the bundled examples disappear when the service restarts.
A mini SRE lab in FastAPI: it detects anomalies in its own CPU and memory, fires alert rules, traces each incident to a likely cause, writes incident reports and restores from snapshots.