Module Organization
ByteKit is organized into two primary module categories:Core Modules
Foundation components for HTTP communication, state management, and async operations
Helper Modules
Utility functions for common tasks like string manipulation, validation, and data transformations
Core Modules
Core modules provide the foundational functionality for building robust applications:HTTP & API Communication
- ApiClient - Isomorphic HTTP client with interceptors, retry logic, and circuit breakers
- RetryPolicy - Configurable retry strategies with exponential backoff
- ResponseValidator - Schema-based response validation
- RequestCache - Intelligent request caching with TTL support
- RateLimiter - Request rate limiting and throttling
- RequestDeduplicator - Prevent duplicate concurrent requests
- BatchRequest - Batch multiple API calls efficiently
State Management
- QueryClient - React Query-like state management for API data
- QueryState - State tracking and lifecycle management
Observability
- Logger - Structured logging with multiple severity levels
- Profiler - Performance profiling and metrics
- ErrorBoundary - Error handling and recovery
- debug - Debugging utilities
Helper Modules
Helper modules provide utilities for common development tasks:Data Manipulation
- ArrayUtils - Array operations and transformations
- ObjectUtils - Object manipulation and deep operations
- StringUtils - String formatting and parsing
- NumberUtils - Number formatting and calculations
- DateUtils - Date parsing and formatting
- TimeUtils - Time-based operations
Validation & Parsing
- Validator - Data validation utilities
- FormUtils - Form data handling
- UrlBuilder - URL construction and manipulation
- HttpStatusHelper - HTTP status code utilities
Storage & Caching
- StorageUtils - LocalStorage/SessionStorage abstraction
- CacheManager - In-memory caching with TTL
- CompressionUtils - Data compression utilities
- CryptoUtils - Cryptographic operations
Real-time Communication
- WebSocketHelper - WebSocket client utilities
- StreamingHelper - Server-sent events and streaming
- PollingHelper - Polling strategies
- EventEmitter - Event-driven programming
UI & Data Presentation
- PaginationHelper - Pagination logic
- ColorUtils - Color manipulation
- DiffUtils - Object/array diffing
- FileUploadHelper - File upload handling
- Signal - Reactive signals for state
- useSignal - React hook for signals
Environment & Configuration
- EnvManager - Environment variable management
Modular Export Structure
ByteKit provides granular exports throughpackage.json to enable optimal tree-shaking:
How Modules Work Together
ByteKit modules are designed to work independently or in composition:Example 1: ApiClient + Logger + RetryPolicy
- Logger for request/response logging
- RetryPolicy for automatic retries with exponential backoff
- CircuitBreaker to prevent cascading failures
Example 2: QueryClient + ApiClient + CacheManager
Example 3: Independent Helper Usage
Internal Module Dependencies
ByteKit uses internal path aliases for module resolution:src/utils/core/ApiClient.ts
Architecture Benefits
Tree-Shakeable
Tree-Shakeable
Import only what you need. Unused modules are automatically removed from your bundle.
Composable
Composable
Modules work independently or together. Mix and match based on your needs.
Isomorphic
Isomorphic
All modules work in both Node.js and browser environments.
Type-Safe
Type-Safe
Full TypeScript support with comprehensive type definitions.
Zero Dependencies (Runtime)
Zero Dependencies (Runtime)
Core functionality uses native Web APIs like
fetch, URL, and AbortController.