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
Proof
332 tests · CI passing
Source
github.com/vishnuatgit/ArchLens
Code on GitHub Download PDF
ArchLens home page analysing pallets/werkzeug: the How it works steps show 6 of 6 GitHub calls done while seven dimensions are checked, beside an example report for psf/requests scoring 77 out of 100

(01)The problem

Why it exists

ArchLens 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 README
ArchLens analysis pipelineA request from the web form, REST API or CLI is validated, reused if the same repository and profile were analysed in the last hour, and rate-limited per client. Then four steps run: fetch repository metadata with six concurrent GitHub calls through one shared async client, check seven dimensions, score and grade, and suggest fixes. The report is stored in SQLite. Progress streams to the browser as newline-delimited JSON, one event per GitHub call. Request web form, REST API or CLI Validate & reuse reuse if < 1 h old, per-client limit 1 Fetch 6 GitHub calls at once, one client 2 Check 7 dimensions: docs, CI, security … 3 Score 0 to 100, A+ to F, evidence per point 4 Suggest fixes ranked by points they add SQLite report, history, compare, badge each step streams progress events to the browser as NDJSON, one per GitHub call ArchLens analysis pipelineA request from the web form, REST API or CLI is validated, reused if the same repository and profile were analysed in the last hour, and rate-limited per client. Then four steps run: fetch repository metadata with six concurrent GitHub calls through one shared async client, check seven dimensions, score and grade, and suggest fixes. The report is stored in SQLite. Progress streams to the browser as newline-delimited JSON, one event per GitHub call. Request web form, REST API or CLI Validate & reuse reuse if < 1 h old, per-client limit 1 Fetch 6 GitHub calls at once, one client 2 Check 7 dimensions: docs, CI, security … 3 Score 0 to 100, A+ to F, evidence per point 4 Suggest fixes ranked by points they add SQLite report, history, compare, badge

Dashed bracket: each step streams progress events to the browser as NDJSON, one per GitHub call.

  1. 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.AsyncClient and asyncio.gather. If one call fails, the others are cancelled.

  2. 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.

  3. 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.

  4. Scan dependencies. Root manifests (requirements*.txt, pyproject.toml, package.json with 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.

  5. Suggest next steps. Each failed check becomes a fix with the points it would add, ranked, and exportable as a Markdown checklist.

  6. 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
  1. One shared async client, metadata only

    The six GitHub calls run concurrently through one httpx.AsyncClient shared 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.

  2. 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 a 503 RATE_LIMIT_EXCEEDED, an unreachable GitHub a 502 GITHUB_UNAVAILABLE, and too many analyses a 429 with Retry-After.

  3. 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.

  4. Progress from real events

    POST /api/v1/analyze/stream streams 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.

  5. Scoring you can check

    The /scoring page is generated from the scorer's own constants, and tests run the real scorer against it, so the explanation cannot drift from the code.

  6. 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 def and SQLite moved to NullPool. 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 lifecycle
  1. Plan. 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.

  2. 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.

  3. Build. Pinned dependencies, Ruff and Black, and short-lived branches merged through pull requests since October 2026.

  4. 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.

  5. Deploy. A multi-stage Docker image on Render. A merge to main deploys only after the GitHub checks pass, and Render watches /health.

  6. 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
ArchLens report for pallets/werkzeug: a score gauge at 85 out of 100, grade A, an executive summary with 13 points within reach, and repository facts such as stars, last push and CI workflows
A report: the score and grade, the summary, and the facts behind them.
ArchLens home page: the analysis form, the How it works steps that light up during an analysis, and an example report
The home page: the steps light up as the server streams its progress.
ArchLens report for anxolerd/dvpwa, a deliberately vulnerable training app: the Dependencies card lists 18 PyPI packages read from requirements.txt, each pinned to an exact version
Dependencies read from the repository’s manifests, pinned or not (anxolerd/dvpwa, a deliberately vulnerable training app).
ArchLens Known vulnerabilities card for the same report: 84 advisories from OSV.dev, each with its severity, advisory ID, the affected package version and the version to upgrade to
Known vulnerabilities from OSV.dev, each with the version to upgrade to.

(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.
Code on GitHub
Next case study DeepBell

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.