Skip to main content

Architecture

swAItch follows SOLID principles with a clean, modular design that makes it easy to extend and maintain.

Module Map

Data Flow

Design Principles

Open/Closed Principle

New IDE parsers are added by creating a new class that extends BaseParser. No existing code is modified.

Dependency Inversion

Tools depend entirely on the central swaitch.db, never directly on parsers. Parsers are orchestrated exclusively by sync.py.

Single Responsibility

File Watcher

The watcher runs as an async background task during server lifespan:
  1. Collects watch paths from all available parsers
  2. Uses watchfiles (Rust-based) for efficient monitoring
  3. On change → triggers sync.py in a background thread pool
  4. Next tool call picks up fresh data instantly from the local swaitch.db sqlite file
No polling, no stale data.