RP UI Library
RP UI Library is a set of reusable React components for displaying researcher profiles: profile headers, expertise sections, paper lists, and so on. It is for React developers using these components against a Researcher Profile API.
This is a library, not a standalone app. For a ready-to-use profile browser, see RP Browser.
Layout
Section titled “Layout”| Path | Role |
|---|---|
rp-ui-lib/src/lib/ | Presentational components with no data layer. They take already-fetched props and do no fetching, auth, or host coupling. This is what other apps vendor. |
rp-ui-lib/src/types.ts | Generated TypeScript mirror of the HTTP wire contract. |
The library components cover the wire types:
ResearcherProfileViewer: the shell. It composes every section from{ detail, papers, loadSummary }.ProfileHeader,MetadataPanel:ProfileMetadataPayload.MarkdownSection: one titled markdown body; the shell renders it twice, for theexpertiseandsoulfields, via theMarkdowncomponent (marked+dompurify).PapersList/PaperRow:PaperEntry[], with lazyPaperSummaryexpansion.Markdown: the sanitized markdown renderer the sections share.worksGraphToPapers(works): maps asources/papers.jsonlddocument (aCollectionwithhasPart, a@graphdocument, or a bare array) toPaperEntry[].
The package also exports the types ResearcherProfileViewerProps,
LoadSummary, ProfileDetail, ProfileMetadataPayload, ProfileSummary,
PaperEntry, and PaperSummary.
Typed contract and regeneration
Section titled “Typed contract and regeneration”src/types.ts is generated from the pydantic wire models in
researcher_profiles.api_models. It is the single typed contract the
components speak. The pipeline (npm run gen:types):
rp schema export-wire <tmp>/wire.schema.jsondumps the combined wire JSON Schema fromapi_models.pyto a gitignored intermediate file.json-schema-to-typescriptcompiles that schema tosrc/types.ts.
Only src/types.ts is committed. Regenerate whenever api_models.py or the
wire types change, and keep the committed output in sync. A CI check that
fails when gen:types would produce a diff is the way to enforce that; the
repository does not have one yet.
Where the UI is served
Section titled “Where the UI is served”The FastAPI app in rp-sdk serves the JSON API only; it mounts no static
files and has no built-in viewer. The browser is a separate SPA, built from
this library plus rp-browser, served by whoever deploys it. For local
review, run npm run dev in rp-browser/.
Downstream vendoring
Section titled “Downstream vendoring”src/lib/ and src/types.ts are the vendorable surface: a consumer may copy
those files wholesale and wrap them with its own data layer and design system.
See rp-ui-lib/README.md for the sync workflow.