How rezwanul-haque/bytetable works
1. Overall shape
ByteTable is a desktop application built as a Tauri 2 shell with a Rust backend and a React + TypeScript frontend. The app runs locally only; all database access happens in the Rust side, while the webview is responsible for UI, state, and user interaction.
2. Primary process boundary
The most important architectural boundary is between renderer and core. In the renderer (src/), feature modules call typed API wrappers that invoke Rust commands. In the core (src-tauri/src/), Tauri command handlers perform the actual I/O, business rules, and engine-specific logic. This boundary is also security-sensitive: the renderer sees opaque connection ids, not raw secrets or driver credentials.
3. Renderer composition
The UI is organized by feature slices rather than by technical layer. src/features/* contains the app’s main screens: workspaces, SQL browsing, Redis browsing, DynamoDB browsing, MongoDB browsing, Cassandra browsing, settings/preferences, schema maps, import/export, generate-data, saved queries, console/terminal, updater, and connection management. src/shared/* holds cross-cutting UI primitives, themes, and shared API/types.
4. Workspace shell
The app’s main interaction model is multiple workspaces in one window. The workspace shell provides the left rail, sidebar, tab bar, status bar, command palette, and docked terminal panel. Each workspace maintains its own connection context and tab state, so the UI is not a single global browser; it is a multi-session desktop workspace.
5. SQL subsystem
The relational path covers SQLite, MySQL, and PostgreSQL. On the renderer side this includes the data grid, SQL editor, filters, structure view, inline cell editing, foreign-key peek, column insights, explain panel, export dialogs, schema map, and mutation flows. On the Rust side, engine adapters under src-tauri/src/engines/{sqlite,mysql,postgres} provide the actual database access and type mapping.
6. Non-relational engine subsystems
Each non-SQL engine has its own purpose-built surface rather than being forced into the SQL grid model:
- Redis: keyspace browser with db switching, SCAN-based listing, type-aware value editors, and dashboard.
- DynamoDB: table-centric document/single-table workflow with scan/query, PartiQL, item editing, import/export, and schema map.
- MongoDB: collection/document workflow with find, aggregation pipeline, JSON editor, explain, shell, structure, and schema map.
- Cassandra: query-first wide-column workflow with consistency settings, CQL builder, structure view, shell, and denormalized schema map.
These differences are reflected both in the renderer folder structure and in the Rust engine adapters/ports.
7. Rust core layering
The backend follows a vertical-slice + clean architecture style. Each feature under src-tauri/src/features/<slice> is split into domain/application/ports/infrastructure/commands where needed. The command layer is thin and acts as the Tauri boundary; application/domain code holds use-case logic; infrastructure contains adapters such as local storage, keychain access, and DB integrations.
8. Engine ports and adapters
The core uses shared port traits in src-tauri/src/shared to keep engine-specific implementations isolated. There are separate port families for SQL, key-value, document/Mongo, DynamoDB document, and wide-column/Cassandra models. Concrete driver integrations live in src-tauri/src/engines, including rusqlite, sqlx, redis, aws-sdk-dynamodb, mongodb, scylla, plus SSH tunneling support in ssh.rs.
9. Connection and secret management
Connection setup is its own subsystem with a clear privacy boundary. The renderer has a connection modal and connection state, but secrets are handled by the Rust side and stored in the OS keychain. The app also supports SSH tunneling, TLS, and engine-specific connection options; this is why the connection feature is separated from browsing/query features.
10. Cross-cutting utility features
Several features are shared across engines or screens:
- Preferences/Settings: theme, font, density, and behavior toggles persisted locally and reflected through CSS variables.
- Saved queries: global or workspace-scoped query storage.
- Schema maps and exports: visual diagrams plus PNG/SVG/CSV/JSON/SQL export paths.
- Generate / Import / Export / Mutate: data generation, schema/data transfer, and write operations with confirmations.
These are separate slices because they operate across multiple data models rather than belonging to one engine.
11. Terminal and shells
The docked terminal panel is a shared runtime surface, but it is engine-aware: SQL engines use psql/mysql/sqlite-style shells, Redis uses redis-cli, MongoDB uses mongosh, Cassandra uses cqlsh, and DynamoDB uses PartiQL. This terminal subsystem is distinct from the structured browse/editor flows and acts as a lower-level escape hatch.
12. Testing, fixtures, and delivery
The repository includes a Docker-backed test-fixtures/ environment for seeded databases across supported engines, plus Rust integration tests and frontend type/lint checks. Packaging is handled through Tauri release builds and platform-specific installers, with GitHub Actions workflows for CI, Pages, and releases. The docs folder contains feature-spec documents that map closely to the implemented slices and are useful for understanding intended boundaries.
Main entry points: main.rs Tauri main · WorkspaceShell.tsx Workspace shell · Btn.tsx Shared UI · mod.rs Shared ports
Components 34
Renderer
React + TypeScript UI in the webview
- App entry · Bootstraps the renderer app
src/main.tsx - App shell · Top-level app composition and routing
src/App.tsx - Workspace shell · Multi-workspace layout with rail, sidebar, tabs, status, and command palette
src/features/workspaces/components/WorkspaceShell.tsx - Connections · Connection modal and connection state boundary
src/features/connections/components/NewConnectionModal.tsx - SQL browse · Grid, editor, structure, filters, insights, and mutations for SQL engines
src/features/browse/components/DataGrid.tsx - Redis workspace · Keyspace browser with type-aware editing and dashboard
src/features/redis_browse/components/RedisWorkspace.tsx - Dynamo workspace · Table-centric scan/query, item editing, and schema map
src/features/dynamo_browse/components/DynamoWorkspace.tsx - Mongo workspace · Collection browsing, aggregation, document editing, shell, and explain views
src/features/mongo_browse/components/MongoWorkspace.tsx - Cassandra workspace · Query-first CQL workflow with structure and schema map
src/features/cassandra_browse/components/CassandraWorkspace.tsx - Terminal panel · Engine-aware interactive shell surface
src/features/console/TerminalPanel.tsx - Settings · Theme, font, density, and behavior preferences
src/features/settings/components/SettingsModal.tsx - Schema maps · Cross-engine schema visualization and export rendering
src/features/schema_map/components/SchemaMap.tsx - Import/Export · Import, export, schema creation, and bulk transfer flows
src/features/import/components/ImportModal.tsx - Generate data · Synthetic data generation workflow
src/features/generate/components/GenerateModal.tsx - Saved queries · Stored query state shared across workspaces
src/features/saved_queries/api.ts - Shared UI · Cross-cutting components, styles, types, and API helpers
src/shared/ui/Btn.tsx
Core
Rust Tauri backend, commands, ports, and engine adapters
- Tauri main · Rust application entry and Tauri setup
src-tauri/src/main.rs - Conn feature · Connection setup, secret handling, and persistence
src-tauri/src/features/connections/mod.rs - Browse feature · Shared relational browse and query use cases
src-tauri/src/features/browse/mod.rs - Keyvalue feature · Redis-style keyspace operations
src-tauri/src/features/keyvalue/mod.rs - Dynamo feature · DynamoDB document workflows and item operations
src-tauri/src/features/dynamo/mod.rs - Mongo feature · MongoDB document and pipeline workflows
src-tauri/src/features/mongo/mod.rs - Cassandra feature · CQL and wide-column workflows
src-tauri/src/features/cassandra/mod.rs - Shared ports · Engine-agnostic shared models and port traits
src-tauri/src/shared/mod.rs - Engine adapters · Concrete SQL, Redis, Mongo, DynamoDB, Cassandra, and SSH integrations
src-tauri/src/engines/mod.rs - Preferences · Persisted settings and local app behavior
src-tauri/src/features/preferences/mod.rs - Schema map · Schema mapping and diagram generation logic
src-tauri/src/features/schema_map/mod.rs - Generate · Synthetic data planning and generation
src-tauri/src/features/generate/mod.rs - Export · Schema and data export workflows
src-tauri/src/features/export/mod.rs - Saved queries · Query storage and retrieval
src-tauri/src/features/saved_queries/mod.rs - Structure · Introspection and structure operations
src-tauri/src/features/structure/mod.rs - SSH tunnel · Secure tunneling support for remote connections
src-tauri/src/engines/ssh.rs
Connections 48
- App entry → App shell: boots · Renderer entry mounts the app shell
- App shell → Workspace shell: hosts · Main app composition centers on the workspace shell
- App shell → Connections: opens · Connect flow is reachable from the app shell
- Workspace shell → SQL browse: switches · Workspace tabs route into relational browsing
- Workspace shell → Redis workspace: switches · Workspace tabs route into Redis browsing
- Workspace shell → Dynamo workspace: switches · Workspace tabs route into DynamoDB browsing
- Workspace shell → Mongo workspace: switches · Workspace tabs route into MongoDB browsing
- Workspace shell → Cassandra workspace: switches · Workspace tabs route into Cassandra browsing
- Workspace shell → Terminal panel: docks · Workspace shell embeds the terminal panel
- Workspace shell → Settings: configures · Workspace state exposes preferences and behavior settings
- Workspace shell → Schema maps: renders · Workspace features can open schema maps
- Workspace shell → Import/Export: drives · Workspace actions trigger import/export flows
- Workspace shell → Generate data: drives · Workspace actions trigger data generation flows
- Workspace shell → Saved queries: uses · Workspace state can persist and recall queries
- SQL browse → Shared UI: uses · SQL UI relies on shared primitives and helpers
- Redis workspace → Shared UI: uses · Redis UI relies on shared primitives and helpers
- Dynamo workspace → Shared UI: uses · Dynamo UI relies on shared primitives and helpers
- Mongo workspace → Shared UI: uses · Mongo UI relies on shared primitives and helpers
- Cassandra workspace → Shared UI: uses · Cassandra UI relies on shared primitives and helpers
- Connections → Tauri main: calls · Renderer invokes Rust commands for connection setup
- SQL browse → Tauri main: calls · Relational browse flows cross the Tauri command boundary
- Redis workspace → Tauri main: calls · Redis browse flows cross the Tauri command boundary
- Dynamo workspace → Tauri main: calls · Dynamo browse flows cross the Tauri command boundary
- Mongo workspace → Tauri main: calls · Mongo browse flows cross the Tauri command boundary
- Cassandra workspace → Tauri main: calls · Cassandra browse flows cross the Tauri command boundary
- Terminal panel → Tauri main: calls · Terminal sessions delegate execution to Rust backends
- Settings → Tauri main: calls · Preferences are persisted and applied through backend commands
- Schema maps → Tauri main: calls · Schema map generation and export are backed by Rust commands
- Import/Export → Tauri main: calls · Import/export and schema changes are executed in Rust
- Generate data → Tauri main: calls · Data generation is executed in the backend
- Saved queries → Tauri main: calls · Saved query storage is handled by backend commands
- Tauri main → Conn feature: routes · Tauri entry exposes the connection feature boundary
- Tauri main → Browse feature: routes · Tauri entry exposes the relational browse feature
- Tauri main → Keyvalue feature: routes · Tauri entry exposes the key-value feature
- Tauri main → Dynamo feature: routes · Tauri entry exposes the DynamoDB feature
- Tauri main → Mongo feature: routes · Tauri entry exposes the MongoDB feature
- Tauri main → Cassandra feature: routes · Tauri entry exposes the Cassandra feature
- Tauri main → Preferences: routes · Tauri entry exposes preferences commands
- Tauri main → Schema map: routes · Tauri entry exposes schema map commands
- Tauri main → Generate: routes · Tauri entry exposes data generation commands
- Tauri main → Export: routes · Tauri entry exposes export commands
- Tauri main → Saved queries: routes · Tauri entry exposes saved query commands
- Tauri main → Structure: routes · Tauri entry exposes structure/introspection commands
- Conn feature → Shared ports: uses · Connection logic depends on shared ports and models
- Browse feature → Shared ports: uses · Relational logic depends on shared engine abstractions
- Keyvalue feature → Shared ports: uses · Key-value logic depends on shared engine abstractions
- Dynamo feature → Shared ports: uses · DynamoDB logic depends on shared engine abstractions
- Mongo feature → Shared ports: uses · MongoDB logic depends on shared engine abstractions