Skip to content
mianazPublic

About

Labmate — local-first lab companion for biologists. Protocol library, buffer calculator, plate designer.

Resources

Stars

8 stars

Watchers

0 watching

Forks

Repository files navigation

LabMate

A fast, offline-first lab bench assistant for molecular biology and biochemistry — protocols, buffer & media recipes, calculators, plate design, sample inventory, evidence maps, an experiment notebook, and a calendar, all running client-side in the browser. Part of Bioinfospace.

Live: https://apps.bioinfospace.com/labmate/

Everything is stored locally in your browser (IndexedDB) — no account, no server-side database, your data never leaves the device. It installs as a PWA and works fully offline after the first load.

LabMate — Recipes

Features

Organized into sections — grouped as Library, Tools, My lab and Help in the desktop sidebar — and routed under a locale prefix (/en/… or /zh/…):

Tab What it does
Recipes Curated buffers, media, and staining solutions with per-component amounts, notes, cross-links, and one-click volume scaling.
Protocols ~100 step-by-step molecular biology protocols with brief and detailed step views, reagents, and durations.
Calculator Dilution (C₁V₁=C₂V₂), mass, molarity, percent (w/v, v/v), dead-volume, unit conversion, molecular weight, and a 118-element periodic table.
Plate Designer Design 6–384-well layouts (templates + free editing) and Reader Import — auto-detects Tecan / BioTek / SpectraMax CSV/TSV exports and pivots them to tidy long-format data with a heatmap and per-sample stats.
Links A curated directory of external bench tools and databases (ELISA standard-curve fitting, NEB Tm, and more), filterable by category.
Inventory Sample / box / freezer inventory with position tracking and CSV import/export (per-box or full, with a template).
Evidence map (beta) Map the logic behind a paper, grant aim or hypothesis: split a draft into claims, evidence, assumptions and experiments, connect them by hand, and a logic check shows which claims rest on nothing, which premises don't stand, and which experiments you still need. Experiments go to the Notebook and their results come back as evidence. Arrange the graph by hand (drag nodes, drag a handle to link). Export a Markdown outline, or AI-native JSON (self-describing, with statuses and logic-check findings) to hand to an AI tool and import back; nodes changed outside LabMate return marked for review.
Notebook Structured experiment records — import a protocol, log materials, procedure, and results.
Calendar Schedule protocol steps and experiments on a timeline.
Guide How-to intro, local data backup/import, replay the onboarding tour, and privacy/storage info.
Assistant Optional LLM lab assistant (searches protocols, runs calculators, drafts experiment records, splits a pasted draft into an evidence map). Retrieval-only for bio content — never invents protocol steps or amounts, and an evidence-map split may only quote the user's own text. Hidden unless a backend key is configured (see The Assistant).

Also app-wide: bilingual English / 中文 (carried in the URL), global search (⌘/Ctrl-K, keyboard-navigable), a quick timer and quick calculator that are always one click away, favorites and custom recipes, and an offline PWA with installability and a unified local backup/restore of all your data (with a "last backup" status in the sidebar).

Screenshots

Calculator Plate Designer
Calculator Plate Designer
Protocols Inventory
Protocols Inventory
Notebook Calendar
Notebook Calendar

LabMate on mobile

Installable PWA — top bar, bottom navigation and a "More" sheet on phones.

Tech stack

  • React 19 + React Router 7
  • Vite 6 (build tooling, code-split lazy tabs)
  • Tailwind CSS v4 (via @tailwindcss/vite, no config file)
  • Dexie 4 over IndexedDB for all client-side persistence
  • Vitest + Testing Library for unit tests
  • No backend required for the core app — it's a static single-page app served under /labmate/.

Getting started

Requires Node 22 (matches CI and the deploy build).

npm install
npm run dev        # http://localhost:5173/labmate/   (note the /labmate/ base path)

The dev server serves the app under the /labmate/ base — open http://localhost:5173/labmate/, not the bare root.

Scripts

Command Purpose
npm run dev Start the Vite dev server.
npm run build Production build into dist/ (base /labmate/).
npm run build:native Production build with a relative base, for the native desktop/mobile shells.
npm run preview Serve the production build locally.
npm run lint ESLint over src/.
npm run test / npm run test:run Vitest (watch / once).
npm run format Prettier-format src/.

No secrets are needed for local development — see .env.example. VITE_BASE (default /labmate/) controls the deployed base path.

Project structure

src/
  App.jsx              # Router, locale prefixing, app shell (sidebar / top bar / bottom nav)
  components/          # Shared UI (Sidebar, MobileTopBar, BottomNav, MoreSheet, PageHeader,
                       #   RecipeRow/Detail, modals, Toast, Timer, icons…)
  features/            # One folder per section: library (shared Recipes/Protocols view), buffers,
                       #   protocols, calc, plate, tools, inventory, evidence, notebook, calendar, refs, agent
  lib/                 # Data + logic layer (nav config, Dexie db, calculators, experiments, evidence maps, backup, agent/)
  data/                # Code-defined app data (gel formulas, references, plate configs, taxonomy)
  i18n/                # English + 中文 translations
  styles/              # global.css (design tokens + component CSS)
recipes.json           # Committed mirror of the recipe content (see Content)
public/sw.js           # Service worker (offline PWA)

The root index.html is the retired pre-Vite monolith, kept intentionally. The real build entry is index.vite.html (Vite renames it to index.html in dist/ at build time).

Content

Recipe and protocol content lives in a separate repo, mianaz/labmate-recipes: its recipes/ folder is the single source of the library. On every change there, CI builds and signs dist/recipes.json. That one published library feeds both ways the app gets recipes:

  • Bundled copy — recipes.json here (the file the app loads first) is the published library, verbatim. Don't edit it; add or change recipes in labmate-recipes, then run npm run recipes:pull (downloads dist/, verifies the ed25519 signature with the app's pinned key, writes recipes.json).
  • In-app Refresh — fetches the same dist/, verifies it, and only accepts a library that still contains every recipe the app ships with; otherwise it keeps the bundled copy and says why.

npm run recipes:check replays that Refresh against the published library and fails if it would be rejected — the recipes-sync CI job runs it, so a recipe can no longer be added to the app alone (that drift is what broke Refresh until 2026-10). Recipe ids are a stable identifier — user favorites, experiments, and progress are keyed by them in IndexedDB, so ids must not be renamed.

The Assistant

The Assistant is capability-gated: its UI (launcher, panel, ⌘/Ctrl-J) only appears when the backend reports a configured model key — it probes GET /api/labmate/agent/models at load and stays hidden otherwise (VITE_AGENT_ENABLED=1/0 forces it). In production the model calls are relayed by the Bioinfospace site backend (an owner-key proxy) — the browser never holds a model key. Bio content is retrieval-only, calculator numbers are computed deterministically, and write actions go through a per-tool permission gate. The core logic in src/lib/agent/ is provider- and DOM-agnostic and unit-tested with a scripted fake model.

Deployment

Push to main runs the Deploy workflow (.github/workflows/deploy.yml): it builds with VITE_BASE=/labmate/ and swaps dist/ into /var/www/apps.bioinfospace.com/labmate/. CI (.github/workflows/ci.yml) runs lint + build + tests on every push and PR. Vite's content-hashed filenames handle cache invalidation — do not add a ?v=… query to asset URLs (it breaks ES-module identity for the lazy chunks).

Desktop & mobile

Native shells wrap this same web app: Tauri 2 (desktop) and Capacitor (iOS/Android), both loading a relative-base build (npm run build:native). Mobile/desktop configuration lives in capacitor.config.ts; native projects are generated in a dev environment and are not committed.

Design

LabMate implements the shared Bioinfospace v2 design system — "Lab-Manual Brutalism × Sequence Telemetry" (paper and carbon ink, signal green #16B364, zero border-radius, monospace as structural type), refined for an all-day bench tool: flat 1px-framed panels, soft interior hairlines, hard offset shadows reserved for primary actions and floating surfaces, a grouped sidebar on desktop and a bottom bar on phones. See DESIGN.md for tokens, component classes and page patterns; the ground truth in code is src/styles/global.css, src/lib/nav.jsx and the shared components in src/components/.

License

The LabMate application source code is licensed under the MIT License — free to use, copy, modify, and distribute (including commercially) with attribution. See LICENSE.

Bundled recipe/protocol data (recipes.json) comes from the separate labmate-recipes dataset, licensed CC BY 4.0 (attribution). The underlying procedures are adapted and restated from third-party sources (protocols.io, academic journals, manufacturer manuals) and are not claimed as original work — see that repo's LICENSE for provenance.

Disclaimer

LabMate is an independent community project and is not affiliated with, endorsed by, or sponsored by any of the commercial products, reagents, kits, or instruments it references — including but not limited to Thermo Fisher Scientific, Invitrogen / TRIzol, New England Biolabs, Promega, QIAGEN, Cell Signaling Technology, Abcam, ATCC, 10x Genomics, BioLegend, Tecan, BioTek, and Molecular Devices. All product names and trademarks are the property of their respective owners and are used only to identify the reagents or instruments a protocol or tool refers to. Protocols and calculators are provided for reference, "as is" and without warranty — always follow your institution's safety guidance and the manufacturer's current instructions, and validate before laboratory use.

About

Labmate — local-first lab companion for biologists. Protocol library, buffer calculator, plate designer.

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages