This document provides a comprehensive overview of Solo's architecture, including frontend components, backend modules, and data flow patterns.
Solo is a cross-platform API client built with Tauri 2, React, and TypeScript. The application follows a clear separation between frontend (React/TypeScript) and backend (Rust/Tauri), communicating through Tauri's IPC bridge.
Key Features:
- HTTP, GraphQL, and gRPC request execution
- Collection-based request organization
- Folder-scoped variables with
{{variableName}}syntax - Multiple authentication methods (Basic, Bearer)
- Light/dark theme support
- Proto file parsing and gRPC reflection
- Auto-save functionality
The frontend uses React Context API for global state management. All contexts are located in src/context/.
Manages collections (folders) and requests with localStorage persistence.
Responsibilities:
- CRUD operations for folders and requests
- Auto-save request changes
- Request file management (create, delete, rename, duplicate)
- Folder management (create, delete, rename)
- Current request tracking
Key State:
folders: Object mapping folder names to arrays of request IDsopenFolders: Object tracking which folders are expanded in the UIcurrentFolder: Active folder namecurrentRequestId: Currently selected request IDshowModal: Modal visibility state
Key Functions:
createFolder(folderName): Creates a new foldercreateNewRequest(folder, type): Creates a new request in a folder (HTTP/GraphQL/gRPC)saveRequest(): Persists request to localStoragehandleFileClick(fileName): Loads a request into the editorrenameFolder(oldName, newName): Renames a folder and migrates dataduplicateRequest(folder, fileName): Duplicates an existing request
Storage Pattern:
- Key:
{folderName} - Value:
Array<StoredFile>
Manages the current request state and execution.
Responsibilities:
- Request configuration (method, URL, payload, auth)
- Request execution via Tauri commands
- Response handling and display
- Support for HTTP, GraphQL, and gRPC request types
- JSON formatting and validation
- Performance metrics (response time, status code)
Key State:
method: HTTP method (GET, POST, PUT, DELETE, PATCH)url: Request URLpayload: Request body (JSON string)requestType: "http" | "graphql" | "grpc"useBasicAuth,username,password: Basic auth configbearerToken: Bearer token authqueryParams: URL query parametersgraphqlQuery,graphqlVariables: GraphQL-specific fieldsgrpcService,grpcMethod,grpcMessage,grpcCallType: gRPC-specific fieldsresponse,error,loading: Response stateresponseTime,statusCode: Performance metrics
Key Functions:
handleRequest(processedUrl?): Executes the request via appropriate Tauri commandresetFields(): Resets all request fields to defaultsformatJson(): Formats payload JSONformatGraphqlVariables(): Formats GraphQL variables JSONhandleCopyResponse(): Copies response to clipboard
Request Execution Flow:
- Variable substitution (via VariablesContext)
- Request validation
- Tauri command invocation based on request type and auth
- Response/error handling
- Performance metric calculation
Manages folder-scoped variables for dynamic URL and payload substitution.
Responsibilities:
- Variable management (add, remove, update)
- Variable substitution in URLs and payloads
- Folder-scoped variable persistence
- Current folder tracking
Key State:
variables: Array ofVariableobjects ({key, value, enabled})currentFolder: Active folder name
Key Functions:
loadVariablesForFolder(folderName): Loads variables for a specific folderreplaceVariablesInUrl(url): Replaces{{variableName}}with actual valuesaddVariable(): Adds a new variable rowremoveVariable(index): Removes a variableupdateVariable(index, field, value): Updates a variable fieldclearVariables(): Clears all variables and current folder
Storage Pattern:
- localStorage Key:
solo-variables-{folderName} - localStorage Value:
Array<Variable> - sessionStorage Key:
current-request-folder - sessionStorage Value:
{folderName}
Variable Syntax:
- Pattern:
{{variableName}} - Example:
https://api.example.com/{{environment}}/users - Replacement: Regex-based, supports whitespace inside braces
Manages light/dark theme switching with system preference detection.
Responsibilities:
- Theme state management
- System preference detection
- Theme persistence
Key State:
theme: "light" | "dark"
Key Functions:
toggleTheme(): Switches between light and dark modes
Storage Pattern:
- Key:
theme - Value:
"light"|"dark"
Major UI components are located in src/components/.
Core Components:
RequestForm.tsx: Main request editor with tabsResponseView.tsx: Response display with JSON viewerSidebar.tsx: Folder and request tree viewTabComponent.tsx: Tab navigation (Body, Auth, Params, GraphQL, gRPC, Variables, etc.)SmartUrlInput.tsx: URL input with variable autocompleteGraphQLEditor.tsx: GraphQL query and variables editorGrpcEditor.tsx: gRPC service/method selector and message editorVariablesTab.tsx: Variable management UISchemaViewer.tsx: GraphQL schema viewer (introspection)GrpcSchemaViewer.tsx: gRPC proto schema viewerThemeToggle.tsx: Theme switcher buttonTitleBar.tsx: Application title bar with window controls
Authentication Components:
SelectAuth.tsx: Auth type selectorUsernameAndPassword.tsx: Basic auth inputsBearerToken.tsx: Bearer token input
Utility Components:
JsonViewer.tsx: JSON syntax highlighting and formattingCopyIcon.tsx: Copy to clipboard buttonCheckbox.tsx: Reusable checkbox componentFolder.tsx: Folder item with context menu
Custom React hooks are located in src/hooks/.
Available Hooks:
useToast(): Toast notification systemuseKeyboardShortcuts(): Keyboard shortcut handleruseVariableSubstitution(): Variable substitution logicuseBracketAutocompletion(): Auto-closes{{with}}useCurlGenerator(): Generates cURL commands from requestsuseIntrospection(): GraphQL introspection query executionuseLatestRelease(): Checks for application updates
The backend is organized into modular Rust crates under src-tauri/src/.
Files:
mod.rs: HTTP and GraphQL Tauri commandstests.rs: HTTP module tests
Key Types:
ApiResponse: Standard response format{success, data, error}
Commands:
plain_request: Basic HTTP requestbasic_auth_request: HTTP request with Basic authbearer_auth_request: HTTP request with Bearer tokengraphql_request: GraphQL query executiongraphql_basic_auth_request: GraphQL with Basic authgraphql_bearer_auth_request: GraphQL with Bearer tokengraphql_introspection: GraphQL schema introspectiongraphql_introspection_with_auth: Introspection with authentication
Files:
mod.rs: GraphQL client implementationqueries.rs: GraphQL introspection query
Key Types:
GraphQLRequest: Query + variables wrapperGraphQLClient: HTTP-based GraphQL client
Functionality:
- GraphQL request execution
- Introspection query support
- Authentication integration
Files:
mod.rs: gRPC types and utilitiescommands.rs: Tauri commands for gRPCclient.rs: gRPC client implementationreflection.rs: gRPC server reflection clientproto_parser.rs: Proto file parserstreaming.rs: Streaming RPC handlerstest_utils.rs: Testing utilities
Key Types:
GrpcRequest: Service, method, message, metadataGrpcResponse: Success, data, error, statusProtoSchema: Services and messages schemaGrpcCallType: Unary, ServerStreaming, ClientStreaming, Bidirectional
Commands:
grpc_unary_request: Unary RPC callgrpc_server_streaming_request: Server streaming RPCgrpc_discover_services: Discover services via reflectiongrpc_parse_proto_file: Parse proto file contentgrpc_get_service_info: Get service detailsgrpc_get_method_info: Get method detailsgrpc_test_connection: Test gRPC server connectivity
Key Types:
AuthType: Enum for None, Basic, Bearer authentication- Methods:
apply_to_request()adds auth headers to requests
Key Types:
HttpClient: Wrapper aroundreqwest::Client
Functionality:
- Request building and execution
- Response parsing
- Error handling
Key Types:
AppError: Application error typesAppResult<T>: Result type alias
All commands are registered in src-tauri/src/main.rs:
.invoke_handler(tauri::generate_handler![
http::plain_request,
http::basic_auth_request,
http::bearer_auth_request,
http::graphql_request,
http::graphql_basic_auth_request,
http::graphql_introspection,
http::graphql_introspection_with_auth,
grpc::commands::grpc_unary_request,
grpc::commands::grpc_server_streaming_request,
grpc::commands::grpc_discover_services,
grpc::commands::grpc_parse_proto_file,
grpc::commands::grpc_get_service_info,
grpc::commands::grpc_get_method_info,
grpc::commands::grpc_test_connection,
])Command Convention:
- All commands use
#[tauri::command]attribute - Return type:
Result<T, String> - Error handling: Errors converted to
Stringor wrapped inApiResponse
1. User Input (UI)
ββ> RequestContext state update
2. Variable Substitution
ββ> VariablesContext.replaceVariablesInUrl()
ββ> Replaces {{var}} with actual values
3. Request Validation
ββ> JSON parsing (if applicable)
ββ> URL validation
4. Tauri Command Invocation
ββ> RequestContext.handleRequest()
ββ> invoke(commandName, params)
5. Rust Backend Processing
ββ> HTTP/GraphQL/gRPC client execution
ββ> Authentication application
ββ> External API call
6. Response Handling
ββ> Parse response
ββ> Calculate response time
ββ> Extract status code
7. UI Update
ββ> RequestContext state update
ββ> ResponseView renders result
1. User creates/modifies request
ββ> RequestContext state update
2. Auto-save trigger (useEffect)
ββ> FileContext.saveCurrentRequest()
3. localStorage write
ββ> Key: folderName
ββ> Value: Array<StoredFile>
4. State sync
ββ> FileContext.folders update
1. User types URL with {{variable}}
ββ> RequestContext.url update
2. Request execution triggered
ββ> VariablesContext.replaceVariablesInUrl(url)
3. Variable lookup
ββ> Filter enabled variables
ββ> Regex match and replace
4. Processed URL passed to backend
ββ> Tauri command receives final URL
Solo uses browser localStorage and sessionStorage for data persistence. See STORAGE_SCHEMA.md for detailed schema documentation.
Key Patterns:
- Folders/Collections: Direct folder name as key
- Variables: Prefixed with
solo-variables- - Theme: Simple key
theme - Current Folder: sessionStorage key
current-request-folder
Storage Filtering:
- When loading folders, skip keys starting with
solo-variables- - When loading variables, use
solo-variables-{folderName}pattern
- React 18: UI framework
- TypeScript: Type safety
- Vite: Build tool and dev server
- Tailwind CSS 4: Styling
- Lucide React: Icon library
- @tauri-apps/api: Tauri bindings
- Rust: Systems programming language
- Tauri 2: Desktop application framework
- reqwest: HTTP client library
- tonic: gRPC framework
- serde: Serialization/deserialization
- tokio: Async runtime
- Frontend: Vitest 3.2.4, React Testing Library, jsdom
- Backend: cargo test, tokio-test, httpmock
- Bun: Package manager and test runner
- Vite: Frontend bundler
- Tauri CLI: Application packaging
- Platform-specific bundlers: DMG (macOS), AppImage (Linux), MSI (Windows)
- Add type to
RequestTypeunion insrc/context/RequestContext.tsx - Add corresponding tab to
Tabunion - Implement Rust command in appropriate module under
src-tauri/src/ - Add command invocation in
RequestContext.handleRequest() - Update
FileContextto handle new request type increateNewRequest()andsaveRequest() - Register command in
src-tauri/src/main.rs
- React Components: PascalCase (e.g.,
RequestForm.tsx) - Hooks: camelCase with
useprefix (e.g.,useToast.tsx) - Context: PascalCase with
Contextsuffix (e.g.,FileContext.tsx) - Rust Modules: snake_case (e.g.,
proto_parser.rs) - Tauri Commands: snake_case (e.g.,
plain_request)
Frontend:
- Use
try/catchfor async operations - Display errors via
useToast()hook - Set
errorstate in RequestContext
Backend:
- Use
Result<T, AppError>for internal functions - Convert to
Result<ApiResponse, String>for Tauri commands - Wrap errors in
ApiResponsefor consistent frontend handling