Skip to content

sciencecorp/galago-core

Repository files navigation

Galago

License Node Version GitHub Issues

Galago is a comprehensive laboratory automation platform that orchestrates and manages laboratory equipment through a unified interface. It provides protocol execution, device management, and real-time monitoring for automated laboratory workflows.

Architecture

Galago consists of several distinct modules:

  • Controller: A Next.js + tRPC web application that provides the user interface, manages device orchestration, protocol execution, and scheduling
  • Tool Drivers: Separate repository containing gRPC-based drivers for laboratory equipment

Features

  • 🔬 Multi-device orchestration - Coordinate multiple laboratory instruments simultaneously
  • 📋 Protocol management - Create, edit, and execute complex laboratory protocols
  • 📊 Real-time monitoring - Live status updates and logging of all device operations
  • 🗄️ Inventory tracking - Manage labware, samples, and consumables
  • 📈 Run analytics - Detailed execution reports
  • 🔧 Extensible architecture - Easy integration of new laboratory equipment

Getting Started

Prerequisites

  • Node.js 22.11
  • Docker and Docker Compose (recommended for development)
  • Redis (for queue management)

Fork the Repository (Recommended)

If you plan to contribute or customize Galago, start by forking the repository:

  1. Fork on GitHub: Click the "Fork" button at the top right of the repository page, or use this direct link:

    Fork Galago →

  2. Clone your fork (replace your-username with your GitHub username):

   git clone https://github.com/your-username/galago-core.git
   cd galago-core
  1. Add upstream remote (to keep your fork updated):
   git remote add upstream https://github.com/your-org/galago-core.git
  1. Launch development environment
docker-compose -f docker-compose.dev.yml up --build
  1. Access the application
    • Web Interface: http://localhost:3010

Other useful development commands

  1. Install grpcio dependencies on a local environment (for proto files, testing, linting, etc)
bin/make deps
  1. Initialize and update submodules (pulls the latest proto definitions from galago-tools):
git submodule update --init --recursive

Note: Run git submodule update --remote vendor/galago-tools anytime you need to pull the latest proto updates.

  1. Generate proto files
bin/make proto

Production Deployment

For production deployment:

# Launch production stack
docker-compose up -d

Other docker commands

#Stop containters
docker-compose -f docker-compose.dev.yml down

#remove existing images
docker-compose -f docker-compose.dev.yml down --rmi all

#Remove orphans
docker compose -f docker-compose.dev.yml down --rmi all --remove-orphans

#rebuild a specific service
docker-compose up -d --force-recreate --no-deps --build service_name

#e.g
docker-compose -f docker-compose.dev.yml up --build db

#add npm deps to dev environment
docker exec -it galago-web-dev npm install <package name>

SQlite commands

#See all tables
sqlite3 data/app.db ".tables"

#See schema for a specific table
sqlite3 data/app.db ".schema workcells"

#See all table schemas
sqlite3 data/app.db ".schema"

#Interactive mode.
sqlite3 data/app.db

  #Query a table
  SELECT * FROM logs LIMIT 5;

Drizzle

We are starting to move all CRUD operations to Drizzle ORM. After updating the schemas files, run npx drizzle-kit generate to generate the migration files.

Using conda

Build the base environmnent

conda create -n galago
conda activate galago #mac
source activate galago #windows

Build dependencies

bin/make deps
bin/make proto

Contributing

We welcome contributions to Galago! Please follow these guidelines:

Development Workflow

  1. Fork the repository and create a feature branch
  2. Set up development environment using Docker Compose
  3. Make your changes following the existing code style
  4. Test your changes thoroughly
  5. Submit a pull request with a clear description

Code Style

  • TypeScript/JavaScript: Follow existing patterns, use Prettier for formatting
  • Commit messages: Use conventional commit format

Adding New Tools

To integrate a new laboratory instrument:

  1. Implement the gRPC interface in the galago-tools repository
  2. Add the tool type to interfaces/controller.proto
  3. Update the controller to recognize the new tool type
  4. Add appropriate UI components for tool-specific operations

Security

  • Never commit sensitive information (API keys, passwords, etc.)
  • Use environment variables for configuration
  • Keep dependencies updated regularly
  • Report security issues privately to the maintainers

Secrets encryption (GALAGO_SECRETS_KEY)

Galago stores Secrets (Slack webhook/bot token, SMTP password) encrypted at rest in SQLite. To enable this, you must set the environment variable GALAGO_SECRETS_KEY for the controller server process.

  • Required format: a 32-byte key provided as either:
    • hex: 64 hex characters (recommended), e.g. output of openssl rand -hex 32
    • base64: standard base64 encoding of 32 bytes

Generate a key:

# Recommended (hex)
export GALAGO_SECRETS_KEY="$(openssl rand -hex 32)"

# Alternative (hex, via node)
export GALAGO_SECRETS_KEY="$(node -e \"console.log(require('crypto').randomBytes(32).toString('hex'))\")"

Set it for Docker Compose (dev/prod):

services:
  galago-web-dev:
    environment:
      - GALAGO_SECRETS_KEY=your_64_char_hex_key

After setting it, open Settings → Secrets and save a secret. If the key is missing/invalid, the UI will show “Secrets encryption is not configured”.

Troubleshooting

Common Issues

Container fails to start:

# Check logs
docker-compose logs galago-web-dev
docker-compose logs galago-db-dev

# Rebuild containers
docker-compose -f docker-compose.dev.yml down --rmi all
docker-compose -f docker-compose.dev.yml up --build

Port conflicts:

Architecture Details

Data Flow

  1. User Interface (Next.js) → tRPC calls → Database Service
  2. User Interface -> tRPC calls → gRPC calls → Tool Drivers

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Support

  • Documentation: See the Galago Documentation
  • Issues: Report bugs and feature requests via GitHub Issues
  • Discussions: Use GitHub Discussions for questions and community support

About

Web interface for the lab automation stack

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 6

Languages