Architecture
Understanding Istek's architecture helps with troubleshooting and contribution.
Overview
Technology Stack
Frontend
| Technology | Purpose |
|---|---|
| Nuxt 3 | Vue meta-framework |
| Vue 3 | UI framework |
| TypeScript | Type safety |
| Tailwind CSS | Styling |
| CodeMirror 6 | Code editor |
| Pinia | State management |
Backend
| Technology | Purpose |
|---|---|
| Tauri 2 | Desktop framework |
| Rust | Backend language |
| SQLite | Data persistence |
| reqwest | HTTP client |
| tonic | gRPC client |
| rumqttc | MQTT client |
| tokio | Async runtime |
Directory Structure
istek/
├── src-tauri/ # Rust backend
│ ├── src/
│ │ ├── lib.rs # Main entry, command registration
│ │ ├── http.rs # HTTP client
│ │ ├── websocket.rs # WebSocket client
│ │ ├── graphql.rs # GraphQL client
│ │ ├── grpc_client.rs # gRPC client
│ │ ├── mqtt.rs # MQTT client
│ │ ├── database.rs # SQLite operations
│ │ ├── playground/ # Playground servers
│ │ └── ...
│ └── Cargo.toml
├── components/ # Vue components
│ ├── panels/ # Protocol-specific panels
│ ├── ui/ # Reusable UI components
│ └── ...
├── composables/ # Vue composables
│ ├── useAppStore.ts # Main application state
│ └── useVariableStore.ts
├── types/ # TypeScript types
└── docs/ # Documentation (Docusaurus)
Data Flow
Request Execution
Data Persistence
State Management
App Store (useAppStore)
Manages:
- Tabs (open requests)
- Active tab
- Collections
- History
- Sidebar state
Variable Store (useVariableStore)
Manages:
- Global variables
- Environments
- Active environment
- Variable interpolation
Protocol Implementation
Each protocol follows a similar pattern:
// src-tauri/src/protocol.rs
#[tauri::command]
pub async fn send_protocol_request(
// Request parameters
) -> Result<Response, String> {
// 1. Build request
// 2. Send request
// 3. Parse response
// 4. Return result
}
// components/panels/ProtocolPanel.vue
const sendRequest = async () => {
store.setActiveLoading(true)
try {
const response = await invoke('send_protocol_request', { ... })
store.setActiveResponse(response)
} finally {
store.setActiveLoading(false)
}
}
Database Schema
Collections
CREATE TABLE collections (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
data TEXT NOT NULL, -- JSON
created_at INTEGER
)
History
CREATE TABLE history (
id TEXT PRIMARY KEY,
request TEXT NOT NULL, -- JSON
response TEXT, -- JSON
timestamp INTEGER
)
Variables
CREATE TABLE global_variables (
id TEXT PRIMARY KEY,
key TEXT NOT NULL,
value TEXT,
description TEXT,
is_secret INTEGER,
enabled INTEGER
)
Environments
CREATE TABLE environments (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
color TEXT,
variables TEXT, -- JSON
created_at INTEGER
)
Security
Local Storage
All data is stored locally in SQLite. No cloud sync.
Secret Handling
- Secrets are marked with
isSecretflag - Displayed as masked values in UI
- Stored in the same database (consider OS keychain for future)
Network
- All requests go directly from user's machine
- No proxy servers
- HTTPS certificates are validated
Performance
Async Operations
All network operations are async (Tokio runtime):
#[tauri::command]
pub async fn send_http_request(...) -> Result<...> {
// Non-blocking I/O
}
Memory
- Rust backend has low memory footprint
- Response bodies are streamed for large responses
- History is limited to 100 items
Contributing
See the GitHub repository for:
- Contribution guidelines
- Development setup
- Issue templates