Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
A cross-platform system information application built with Tauri v2, React, TypeScript, and C++. The architecture demonstrates FFI (Foreign Function Interface) integration across multiple layers:
libloadingThe C++ library provides low-level system operations (computer name, memory info, process ID, factorial calculation) that are exposed through Rust to the React frontend.
# Start dev server (works without C++ library - will show errors but UI functions) npm run tauri dev # Build frontend only npm run build
# Build the C++ library (required for full functionality) cd cpp_cross_platform mkdir build cd build cmake .. cmake --build . --config Release # The library will be built to: # - Windows: cpp_cross_platform/build/bin/Release/systemapi.dll # - macOS: cpp_cross_platform/build/lib/libsystemapi.dylib # - Linux: cpp_cross_platform/build/lib/libsystemapi.so
# Build the Tauri application npm run tauri build
C++ Layer (
cpp_cross_platform/):
include/systemapi.h - defines FFI-compatible C ABI functionssrc/systemapi.cpp - platform-specific implementationsGetComputerNameString, GetTotalPhysicalMemory, GetCurrentProcessID, CalculateFactorialRust Layer (
src-tauri/src/lib.rs):
libloading crate to dynamically load the C++ shared libraryload_cpp_library() function)CppLibrary struct with Mutex<Option<Library>>React Layer (
src/):
@tauri-apps/api/coreinvoke<string>("get_computer_name")The Rust code searches for the C++ library in this order:
resources/ folder next to exe../Resources/ (app bundle structure)../cpp_cross_platform/build/...The
.github/workflows/release.yml workflow:
src-tauri/lib/ before Tauri buildv*)All Tauri commands in
src-tauri/src/lib.rs follow this pattern:
State<CppLibrary> as parameterSymbol<FunctionTypeFn> to get function pointerResult<T, String> for error handlingextern "C" to prevent name manglingSYSTEMAPI_API).dll/.dylib/.so)WINDOWS_EXPORT_ALL_SYMBOLS enabledsrc/ - React frontendsrc-tauri/ - Tauri Rust backend
src/lib.rs - Main application logic and FFI integrationsrc/main.rs - Entry point (minimal, calls lib.rs)build.rs - Tauri build scriptcpp_cross_platform/ - C++ system library
include/ - Header filessrc/ - ImplementationCMakeLists.txt - CMake build configuration.github/workflows/ - CI/CD automationAfter building the C++ library, verify integration:
npm run tauri dev