How inbestigator/enc works
Main Components
• Core Library: Focus on the "libs/core" directory, where the main functionality is implemented.
• Source Files: Under "libs/core/src", you have dedicated modules for each cryptographic operation – for example, encrypt.ts, export.ts, generate.ts, and sign.ts.
• Entry Point: "libs/core/mod.ts" acts as a central exporter that aggregates the functionality provided in the src folder.
• Testing: The "libs/core/tests" directory contains tests (e.g., generate.test.ts) to validate functionality.
• Configuration and Build: The "libs/core/deno.json" sets up the Deno-specific configuration, and the ".github/workflows" folder with a publish.yaml indicates automated CI/CD processes upon publishing.
Out Component Relationships
• The Core Library is built on top of the WebCrypto API, so include an external “WebCrypto API” component. Show how the individual functions in src (encrypt, generate, sign, export) interact with the underlying WebCrypto API for secure cryptographic operations.
• Calls from the functions in src (e.g., encrypt.ts) to the WebCrypto API.
• Exports from mod.ts toward client applications that will incorporate Enc.
• Testing interacts directly with the src modules to verify outputs and behavior.
Architectural Patterns & Design Principles
• Modularity: Emphasize that the library is organized into independent modules for different cryptographic operations. This modularity facilitates ease of maintenance and testing.
• Abstraction: Highlight how Enc encapsulates complex operations behind simple function calls.
• CI/CD Integration: Include the automated build/publish pipeline managed via GitHub workflows.
• Technology Stack: Note that the project uses Deno as its runtime environment and leverages the built-in WebCrypto API.