An offline-first computational biology and bioinformatics desktop web application for macromolecular structure visualization, geometric binding pocket detection, ligand preparation, receptor parameterization, AutoDock Vina docking, and standalone scientific report generation.
StructBind is designed to operate 100% locally on your computer without requiring an active internet connection for core scientific workflows:
- Local Loopback Security (
127.0.0.1): The FastAPI server strictly binds to loopback interface by default to prevent unauthorized external network access. - Local SQLite Database: Structures, ligands, binding pockets, docking jobs, and scientific reports are stored in local SQLite (
data/app.db). - Offline Scientific Engines:
- Gemmi (
v0.7.5): High-performance local macromolecular parser for PDB and mmCIF coordinate files, atom/residue extraction, and chain analysis. - RDKit (
v2026.03.6): Offline cheminformatics for parsing SMILES, SDF, MOL, computing physicochemical descriptors, and ETKDGv3 3D conformer embedding. - Meeko (
v0.8.0): Local preparation of small molecules into PDBQT format with Gasteiger partial charges. - Alpha-Sphere Geometric Cavity Detector: Mathematical binding pocket identification running entirely in local memory.
- AutoDock Vina (
Optional): Built-in environment auditor that automatically detectsvinaexecutable or Python bindings; never fabricates fake scores if unavailable.
- Gemmi (
- Progressive Web App (PWA) Shell:
- Custom Service Worker (
sw.js) precaches the application shell and static bundles. - Web App Manifest (
manifest.webmanifest) with standalone display mode and dedicated branding icons. - Offline fallback page (
offline.html) when network connectivity is disrupted. - In-app telemetry indicator displaying real-time database, engine, and network status.
- Custom Service Worker (
- Standalone Report Generator: Compiles self-contained reports in HTML (with
@media print1-click Save-as-PDF styling), Markdown, and JSON.
Double-click start_structbind.bat in the project root:
start_structbind.batThis automatically detects Python, validates the environment, boots the local FastAPI server, mounts the pre-compiled frontend, and opens http://127.0.0.1:8000 in your default browser.
# Launch server and automatically open browser
python run_offline.py
# Or specify custom port without opening browser
python run_offline.py --port 8000 --no-browserYou can compile StructBind into a single, standalone Windows .exe that bundles the Python runtime, FastAPI backend, scientific libraries, and pre-built React frontend:
- Double-click build_exe.bat (or run
pyinstaller --clean structbind.spec). - The standalone binary will be created at
dist\StructBind.exe. - Running
StructBind.exeboots the local offline server, mounts the frontend, persists local databases todata/app.db, and opens the user's browser.
- Open
http://127.0.0.1:8000in Google Chrome or Microsoft Edge. - Click the "Install StructBind App" button in the top navigation status bar, or click the browser install icon in the URL bar.
- StructBind will install as a standalone desktop window on your taskbar/desktop with its own window frame and icon.
| Feature | Offline Mode (Local Only) | Online Mode (Internet Active) |
|---|---|---|
| Protein Structure Viewing (Mol 3D)* | ✅ Full (Local PDB/mmCIF files & cached structures) | ✅ Full (RCSB PDB live download & caching) |
| Local Structure Library | ✅ 100% Offline (SQLite + Gemmi parsing) | ✅ Full |
| Binding Pocket Detection | ✅ Full (Built-in Alpha-Sphere geometric cavity engine) | ✅ Full |
| Ligand Management | ✅ 100% Offline (SMILES parsing, SDF/MOL import) | ✅ Full + PubChem live search |
| Ligand 3D Conformer Generation | ✅ Full (RDKit ETKDGv3 & MMFF94 force field) | ✅ Full |
| Receptor & Ligand PDBQT Prep | ✅ Full (Gemmi + Meeko + Gasteiger charges) | ✅ Full |
| Molecular Docking | ✅ Real calculation if AutoDock Vina installed locally | ✅ Real calculation if AutoDock Vina installed locally |
| Scientific Report Generation | ✅ Full (HTML printable to PDF, Markdown, JSON) | ✅ Full |
| UniProt & PubMed Search | ✅ Live remote search |
- Import experimental structure files (
.pdb,.cif,.mmcif,.ent) up to 15 MB. - Inspect total atoms, residues, resolution, chains, and experimental methods offline.
- 1-click launch into the interactive Mol* 3D viewer or Binding Pocket detector.
- Detects candidate binding cavities and drugability scores.
- Renders 3D cavity points and bounding boxes in Mol*.
- Displays participating amino acid residues with chain identifiers and sequence positions.
- Results are automatically archived in SQLite
PocketRecordfor offline docking grid calculation.
- Local Library: Browse and manage stored small molecules.
- SMILES & SDF Import: Validates chemical structures, detects heavy atoms, rotatable bonds, LogP, and H-bond donors/acceptors.
- 3D Conformer Embedding: Generates 3D coordinates via RDKit ETKDGv3 and performs MMFF94 energy minimization.
- PDBQT Generation: Adds polar hydrogens, assigns Gasteiger partial charges, and outputs Meeko PDBQT files ready for docking.
- Environment Audit: Honest inspection of AutoDock Vina availability (checks PATH and Python module).
- Search Grid Configuration: Interactive center coordinates
[X, Y, Z], box dimensions[Size X, Size Y, Size Z]in Angstroms, exhaustiveness, num modes, and energy range. - Job Management: Launch local docking calculations, review binding affinity scores (kcal/mol), and download pose files (
.pdbqt).
- OpenMM & GROMACS Integration: Dynamic force field preparation (AMBER14, CHARMM36, GAFF2) with explicit TIP3P solvent box and physiological ion neutralization.
- Minimization & Equilibration: Multi-stage NVT/NPT thermodynamic equilibration with temperature, pressure, and energy logging.
- Trajectory Analysis: RMSD, RMSF, Radius of Gyration (Rg), hydrogen bond kinetics, and Mol* trajectory playback.
- Educational Interpretation Panel: Interactive parameter guides, physics timelines, and structural stability summaries.
- Select sections to include: Protein Metadata, Pocket Geometry, Receptor Preparation, Ligand Preparation, Docking Affinities, MD Trajectories, and Software Versions.
- Standalone HTML export: Includes embedded responsive CSS and
@media printrules for clean, 1-click Save as PDF via browser print (Ctrl+P). - Markdown and JSON exports for computational reproducibility.
# Run complete test suite (74 tests)
py -3 -m pytest tests/ backend/tests/ -vcd frontend
npm run build- Loopback Enforcement: Local backend binds to
127.0.0.1to prevent remote execution on local networks. - Path Traversal Defense: All file paths are strictly validated through
validate_safe_path()against canonical application data directories (ALLOWED_BASE_DIRS). Relative path traversal sequences (../,..\) are rejected with HTTP 400. - Filename Sanitization: Uploaded filenames are sanitized through
sanitize_filename()to remove dangerous characters and path separators. - Upload Size Limits: Enforced 15 MB cap on macromolecular structure uploads.
StructBind is built with React, TypeScript, Vite, Tailwind CSS, FastAPI, SQLite, Gemmi, RDKit, Meeko, and Mol* Viewer.