A full-stack web application for simulating Opentrons Python protocols without hardware. Upload a protocol file and get visual deck layouts, execution steps, and robot configuration - all in your browser.
Disclaimer: This project is not affiliated with, endorsed by, or sponsored by Opentrons Labworks, Inc. "Opentrons" is a trademark of Opentrons Labworks, Inc.
- Protocol Simulation: Execute Opentrons API v2 protocols in a simulated environment
- Robot Configuration: Extract pipettes, modules, and labware setup
- Deck Visualization: Interactive SVG visualization of 12-slot deck layout
- Execution Steps: Structured list of all protocol actions with filtering
- Protocol Input Panel - Drag & drop file upload with optional metadata
- Interactive Deck Visualization - Zoomable deck layout with color-coded labware
- Steps Timeline - Filterable step list with expandable details and CSV export
- Robot Config Inspector - Collapsible sections for pipettes, modules, labware
- Validation Panel - Protocol guidelines and example structure
- Export Dashboard - Download individual or all artifacts (JSON, SVG, Markdown)
- FastAPI - High-performance Python web framework
- Opentrons API - Official Opentrons simulation library
- Pillow & CairoSVG - Image generation and conversion
- React 18 - UI framework
- Vite - Fast build tool and dev server
- Tailwind CSS - Utility-first styling
- Lucide Icons - Beautiful icon library
- React Dropzone - File upload handling
- Python 3.8+
- Node.js 16+
- npm or yarn
- Clone the repository
git clone <your-repo-url>
cd ProtocolAnimator- Install Python dependencies
pip install -r requirements.txt- Install Node dependencies
npm install- Start the backend server (Terminal 1)
cd backend
uvicorn main:app --reload --port 8000- Start the frontend dev server (Terminal 2)
npm run dev- Open your browser
http://localhost:3000
Backend:
npm run serverFrontend:
npm run dev- Upload Protocol: Drag and drop or click to upload your
.pyprotocol file - Add Metadata (Optional): Click "Show Metadata" to add custom protocol information
- Simulate: Click "Simulate Protocol" to run the simulation
- Explore Results:
- View the deck layout with interactive zoom
- Browse execution steps with filtering
- Inspect robot configuration details
- Download artifacts (JSON, SVG, Markdown)
Simulate a protocol and return all artifacts
- Body:
multipart/form-dataprotocol_file: Python protocol file (.py)metadata: Optional JSON string
Download a specific artifact
- Path params:
robot_json,steps_json,deck_svg,report
Validate a protocol without full simulation
- Body:
multipart/form-dataprotocol_file: Python protocol file (.py)
ProtocolAnimator/
βββ backend/
β βββ main.py # FastAPI server
β βββ simulator.py # Core simulation logic
β βββ __init__.py
βββ src/
β βββ components/
β β βββ ProtocolInput.jsx
β β βββ DeckVisualization.jsx
β β βββ StepsTimeline.jsx
β β βββ RobotConfig.jsx
β β βββ ValidationPanel.jsx
β β βββ ExportDashboard.jsx
β βββ App.jsx
β βββ main.jsx
β βββ index.css
βββ index.html
βββ vite.config.js
βββ tailwind.config.js
βββ package.json
βββ requirements.txt
βββ README.md
Each simulation generates:
robot.json- Complete robot configurationsteps.json- Ordered execution stepsdeck.svg- Deck layout visualizationreport.md- Summary report with stats
from opentrons import protocol_api
metadata = {
'protocolName': 'Simple Transfer',
'author': 'Lab Tech',
'apiLevel': '2.14'
}
def run(protocol: protocol_api.ProtocolContext):
# Load labware
plate = protocol.load_labware('corning_96_wellplate_360ul_flat', 1)
tiprack = protocol.load_labware('opentrons_96_tiprack_300ul', 2)
# Load pipette
pipette = protocol.load_instrument('p300_single_gen2', 'left', tip_racks=[tiprack])
# Transfer
pipette.transfer(50, plate['A1'], plate['B1'])- Backend: Add endpoints in
backend/main.py - Frontend: Create components in
src/components/ - Update schemas in
backend/simulator.py
- Uses Tailwind CSS utility classes
- Custom scrollbar styles in
src/index.css - Color scheme: Blue (primary), Green (success), Purple (modules)
Issue: CORS errors
- Solution: Ensure backend is running on port 8000 and frontend on port 3000
Issue: Import errors for Opentrons
- Solution: Install opentrons package:
pip install opentrons
Issue: Module not found
- Solution: Run
npm installto install all dependencies
- 3D deck visualization with Three.js
- Protocol diff view for comparing versions
- Replay mode with animated step execution
- Protocol templates library
- Real-time validation with linting
- Support for Opentrons Flex robot
- Custom labware definition upload
MIT
Contributions welcome! Please open an issue or submit a pull request.