How mauriciozegarra/arbol-b-web works
• Frontend/UI Layer:
• index.html – the primary HTML page
• styles.css – styling for the UI
• logica.js – JavaScript code managing the interaction between the UI and the WebAssembly module
• WebAssembly Module:
• arbol.js and arbol.wasm – the compiled output of the C++ source; these expose functions (_create_tree, _Insert, _delete_tree, _to_dot, _Print) for tree manipulation.
• C++ Core Logic:
• Files in src (BTree.h, Node.h, tree.cpp, main.cpp) – these files implement the actual tree data structure and its operations.
• Build & Deployment Tools:
• README instructions indicating the use of Emscripten (emcc) to compile C++ code to WASM and the usage of emrun to set up a local server.
Relationships and interactions between the components
• The UI layer (HTML/JS/CSS) acts as the front door for user interaction. It sends requests (e.g., to create, insert, delete tree elements) triggered by user actions.
• Optionally, include a local development server node (using emrun) that serves the HTML/JS/CSS and WASM content to the browser.
Architectural patterns and design principles
• Separation of concerns: The UI layer is clearly separated from the business logic, which is implemented in C++ and compiled into WebAssembly.
• Layered architecture: Presentation layer (front end) interacts via JavaScript API with a computation layer (WASM module) that wraps the core logic.
Relevant technologies and tools
• WebAssembly (arbol.wasm)
• Emscripten (for compilation using emcc)
• HTML/CSS/JavaScript for the front end (index.html, styles.css, logica.js)
• C++ for the core tree logic
Final assembly
• At the center, illustrate the WASM module that encapsulates the core logic.
• At the top (or side), indicate the UI layer with its HTML, CSS, and JavaScript that interacts with the user.