## Overview DAP SDK (Decentralized Application Platform Software Development Kit) provides foundational libraries for building high-performance, scalable applications with advanced networking, cryptographic, and data management capabilities. This comprehensive module documentation covers the complete DAP SDK ecosystem, organized into logical layers that support everything from basic system operations to complex distributed applications. ## Module Architecture ### Foundation Layer: Essential Infrastructure (3 Modules) Core system components that provide fundamental functionality for all other modules: #### **[[Module DAP Core|Module DAP Core]]** - System Foundation System initialization, memory management, configuration, logging framework, and cross-platform utilities that form the foundation of the entire DAP SDK ecosystem. **Core Capabilities:** - Cross-platform compatibility and abstraction layer - Advanced memory management with debugging and leak detection - Comprehensive logging and debugging infrastructure with configurable levels - Essential data structures (lists, hash tables, strings) with thread-safe operations - Configuration management and parsing systems #### **[[Module DAP Crypto|Module DAP Crypto]]** - Cryptographic Operations Comprehensive cryptographic operations and security infrastructure implementing both classical and post-quantum algorithms for future-proof security. **Security Features:** - Post-quantum cryptographic algorithms (NewHope, Picnic, SPHINCS+) - Classical encryption algorithms (AES, RSA, ECDSA, Curve25519) - Digital signatures and comprehensive key pair management - Cryptographic hash functions (SHA-256, SHA-3, BLAKE3, FastHash) - Secure random number generation and entropy management #### **[[Module DAP Test|Module DAP Test]]** - Testing Framework Comprehensive testing framework and utilities for DAP SDK development, implementing unit testing, integration testing, performance benchmarking, and automated test execution capabilities. **Testing Capabilities:** - Unit testing framework with assertion libraries and test case management - Integration testing capabilities for multi-component validation - Performance benchmarking and profiling tools with detailed metrics - Automated test discovery and execution framework with comprehensive reporting ### Communication Layer: Network & I/O Infrastructure (2 Modules) High-performance networking, asynchronous I/O, and communication infrastructure: #### **[[Module DAP IO|Module DAP IO]]** - Event-Driven I/O Comprehensive input/output operations and event-driven communication infrastructure, organized into 8 specialized submodules based on `dap-sdk/io/` source structure: **I/O Submodules:** - **DAP Context** - Core I/O context management and operation coordination - **DAP Events Socket** - Event-driven socket operations with high-performance networking - **DAP Worker** - Worker thread pool management and parallel processing - **DAP Events** - Event system infrastructure and callback management - **DAP Server** - Server infrastructure and connection handling - **DAP Timer FD** - Timer operations and scheduling with precise timing - **DAP Proc Thread** - Process thread coordination and management - **DAP Net** - Network operations abstraction and utilities #### **[[Module DAP Net|Module DAP Net]]** - Network Layer Comprehensive networking infrastructure organized into specialized submodules, each with its own detailed documentation based on `dap-sdk/net/` folder structure: ##### **Network Submodules:** - **[[Module DAP Net - Client|Module DAP Net - Client]]** Client-side networking functionality with connection management, protocol handling, authentication, and service discovery for seamless DAP ecosystem integration. - **[[Module DAP Net - Server|Module DAP Net - Server]]** Server-side infrastructure with multi-threaded architecture, connection management, SSL/TLS support, and performance monitoring for robust server applications. - **[[Module DAP Net - Stream|Module DAP Net - Stream]]** High-level streaming communication infrastructure with reliable data streams, session management, channel multiplexing, and event-driven processing. - **[[Module DAP Net - Link Manager|Module DAP Net - Link Manager]]** Link management and connection coordination with performance optimization, failure detection, load balancing, and connection lifecycle management. ### Service Layer: Application Infrastructure (3 Modules) High-level service modules providing advanced functionality for distributed applications: #### **[[Module DAP Global DB|Module DAP Global DB]]** - Database Operations Comprehensive distributed database infrastructure implementing high-performance data storage, replication, synchronization, and consensus mechanisms for distributed applications. **Database Features:** - Multi-backend database support (SQLite, PostgreSQL, MongoDB) - Distributed database operations with automatic sharding and replication - ACID-compliant transaction processing with optimistic concurrency control - Advanced indexing and query optimization for high-performance data retrieval - Data synchronization protocols and consensus mechanisms for distributed systems #### **[[Module DAP Plugin|Module DAP Plugin]]** - Plugin System Comprehensive dynamic plugin management and extensibility functionality enabling applications to load, manage, and execute plugins at runtime with advanced features and security. **Plugin Capabilities:** - Dynamic plugin loading, lifecycle management, and dependency resolution - Inter-plugin communication, message passing systems, and event coordination - Plugin sandboxing, security measures, and resource isolation for safe execution - Configuration management and plugin orchestration for complex systems #### **[[Module DAP Client|Module DAP Client]]** - Client Connectivity *Note: Legacy module reference maintained for compatibility* Client-side functionality for connecting to and interacting with DAP-enabled servers and services. For current development, see **[[Module DAP Net - Client|Module DAP Net - Client]]** which provides the updated implementation. --- ## Module Integration Architecture ### Dependency Hierarchy ``` Application Layer (Your Applications) ↓ ┌────────────────────────────────────────────────────────────┐ │ Service Layer │ │ ┌─────────────────┐ ┌─────────────────┐ ┌──────────────┐ │ │ │ Global DB │ │ Plugin │ │ Client │ │ │ │ (Storage) │ │ (Extensions) │ │ (Networking) │ │ │ └─────────────────┘ └─────────────────┘ └──────────────┘ │ └────────────────────────────────────────────────────────────┘ ↓ ┌────────────────────────────────────────────────────────────┐ │ Communication Layer │ │ ┌─────────────────┐ ┌─────────────────────────────────────┐ │ │ │ DAP I/O │ │ DAP Net │ │ │ │ (8 submodules) │ │ Client│Server│Stream│Link Manager │ │ │ └─────────────────┘ └─────────────────────────────────────┘ │ └────────────────────────────────────────────────────────────┘ ↓ ┌────────────────────────────────────────────────────────────┐ │ Foundation Layer │ │ ┌─────────────────┐ ┌─────────────────┐ ┌──────────────┐ │ │ │ DAP Core │ │ DAP Crypto │ │ DAP Test │ │ │ │ (System Core) │ │ (Security) │ │ (Validation) │ │ │ └─────────────────┘ └─────────────────┘ └──────────────┘ │ └────────────────────────────────────────────────────────────┘ ↓ System Libraries (OS-specific) ``` ### Integration Patterns **Initialization Order:** 1. **Foundation Layer** - Core, Crypto, Test (no dependencies) 2. **Communication Layer** - I/O and Net modules (depend on Foundation) 3. **Service Layer** - Database, Plugin, Client (depend on Communication) 4. **Application Layer** - Your applications (use all layers) **Cross-Module Dependencies:** - **All modules** require **[[Module DAP Core|Module DAP Core]]** for basic functionality - **Network modules** build on **[[Module DAP IO|Module DAP IO]]** for event-driven operations - **Service modules** integrate **[[Module DAP Net|Module DAP Net]]** submodules for communication - **[[Module DAP Crypto|Module DAP Crypto]]** provides security operations across all layers - **[[Module DAP Test|Module DAP Test]]** enables testing and validation throughout the system ## Getting Started ### Quick Start Guide #### For New Developers 1. **[[Module DAP Core|Module DAP Core]]** - Start here to understand system initialization and basic operations 2. **[[Module DAP Crypto|Module DAP Crypto]]** - Learn security and cryptographic functions 3. **[[Module DAP IO|Module DAP IO]]** - Understand asynchronous I/O and event-driven patterns 4. **[[../ETC/First Application|First Application Tutorial]]** - Build your first DAP SDK application #### For Advanced Users - **[[Module DAP Net|Module DAP Net]]** - Advanced networking with client, server, stream, and link management - **[[Module DAP Global DB|Module DAP Global DB]]** - Distributed database operations and data management - **[[Module DAP Plugin|Module DAP Plugin]]** - Extend functionality with dynamic plugin loading #### For System Integration - **[[../ETC/Architecture Overview|Architecture Overview]]** - Comprehensive system architecture and design patterns - **[[../ETC/Development Guide|Development Guide]]** - Best practices and development methodology - **[[../ETC/Troubleshooting|Troubleshooting]]** - Problem resolution and debugging techniques ### Documentation Navigation **Essential Resources:** - **[[../ETC/Installation Guide|Installation Guide]]** - Complete setup instructions for all platforms - **[[../ETC/Building from Source|Building from Source]]** - Build DAP SDK from source code - **[[../ETC/Core Components|Core Components]]** - Essential system components and data structures - **[[../ETC/Glossary|Glossary]]** - Complete alphabetical function reference **Cross-Platform Support:** DAP SDK provides unified APIs across Linux, macOS, and Windows, with optimized implementations for each platform's native capabilities including epoll (Linux), kqueue (macOS/BSD), and IOCP (Windows). --- *Complete module documentation for DAP SDK development and integration.*