Calculators and a 96-well plate map for screening colonies after ligation and transformation.
Live: https://cloning-assistant.onrender.com/
API docs: https://cloning-assistant-api.onrender.com/docs
(free tier: the API sleeps when idle, so the first calculation can take up to a minute while it wakes up)
Python/FastAPI backend, React/TypeScript frontend
- Dilution calculator
- Endpoint returning standard buffers (predefined set)
- Endpoint returning ligation reaction volumes (frontend coming soon)
- The calculators: ligation (in progress), restriction digest, gel loading dye, colony PCR master mix
- The 96-well plate map: configurable start well, well states, multi-plate overflow, print and JSON export
- Docker image
Built to WCAG 2.2 AA. Current state:
- Automated: axe DevTools reports zero violations on every page, including best-practice rules.
- Manual: keyboard navigation throughout, including the menu button (WAI-ARIA APG pattern); visible focus; forced-colors and
prefers-reduced-motionhonoured; per-route page titles; calculation results announced via a live region, tested with a screen reader (NVDA). The live-region behaviour is additionally covered by a DOM-level test.
Colour tokens are checked against 1.4.3 and 1.4.11 in both light and dark mode.
You do not need to install Python separately. uv reads backend/.python-version
and downloads the right interpreter itself.
macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | shWindows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Or, with a package manager: brew install uv, winget install --id=astral-sh.uv -e.
macOS / Linux - with nvm:
Run the command from frontend/:
nvm installthen once it installs, point it at the Node version that this project uses with:
nvm useWindows - nvm-windows, fnm, or the installer from nodejs.org.
then once it installs, point it at the Node version that this project uses with:
nvm useCommands below for running each server are identical on Linux, macOS and Windows.
cd backend
cp .env.example .env
uv sync
uv run devServes on http://localhost:8000.
- http://localhost:8000/api/health - health check
- http://localhost:8000/docs - interactive API documentation (Swagger UI)
- http://localhost:8000/redoc - the same API as reference documentation
In a second terminal:
cd frontend
npm ci
npm run devServes on http://localhost:5173.
This is possible only on Linux, macOS and WSL (no Windows support). To run both servers at once from a single terminal, run from the repo root:
uv run dev.pyThen stop both with Ctrl+C. If one server crashes, the other one is stopped to free the port.
Issues and feedback are very welcome. If you'd like to work on an issue, first comment on it - for now I'm writing issue descriptions for myself, so it might not be fully clear what is the scope of work. Get it touch and I'll contact you with futher details.
This repo uses pre-commit hooks. To set it up, install pre-commit after cloning:
uv tool install pre-commit
pre-commit installThis runs on every commit, only against the staged files:
ruff- lint and format the backendeslint- lint the frontend- trailing whitespace, end-of-file newline, YAML/JSON validity, large-file guard
Most hooks fix files in place. When one does, re-stage and commit again.
To run everything without committing:
pre-commit run --all-filesFrontend uses Vitest, backend uses pytest. Commands to run the tests:
cd backend && uv run pytest
cd frontend && npm testType checking runs in CI rather than in the commit hook, because mypy needs the project's installed dependencies and pre-commit's hook environments are isolated from them:
cd backend && uv run mypy srcInput validation is deliberately done twice:
- Zod on the front end for immediate user feedback and data cleaning,
- Pydantic on the back end as the real gate.
Never trust the raw input from the user.
The units shown in the dropdowns for calculations are declared twice (in Python backend and in TypeScript frontend) because waiting for server response for the dropdown is really bad UX and requires a separate endpoint. Two checks stop the copies from drifting: CI regenerates contracts/units.json from the Python enum and fails if the committed file is stale, and a Vitest test asserts the TypeScript table matches that file.
From backend/, run:
uv run python scripts/export_units.py
to write a JSON file to contracts/units.json, then from frontend/ npm run test.
- Ligation: https://www.neb.com/en/protocols/dna-ligation-with-t4-dna-ligase-m0202
- NEB Calculators: https://nebiocalculator.neb.com/