How paulaselim/switch-nexus works
Main Components
• Frontend: This is located in the “frontend” directory and built using Vue.js. Key files include the App.vue, components (e.g., SwitchListItem, VLANDetails), views, and service files like MySwitchService.js. Also note the vite.config.js and the associated Wails JavaScript directories.
• Backend (Core Application): Written in Go, with the entry point in main.go and configuration in wails.json. The Go code is organized into several folders:
• Internal or core folders that represent the layers of the onion architecture:
– Config (internal/config/env.go) for managing configuration, loaded perhaps via an environment file.
– Interfaces (internal/interfaces, plus wails_interfaces directory) which expose functions to the frontend.
– Utilities (internal/utilities) including SSH (internal/utilities/ssh/ssh.go) and ping modules for network operations.
• Additional components that might be hidden in the README’s suggested “services” or “middleware” (even if not one-to-one with directory names) but are represented conceptually.
• Build and Distribution: The “build” directory contains platform-specific build instructions and resources for macOS (darwin) and Windows (e.g., installer scripts, manifest files).
Relationships and Interactions
• User interactions through the Vue.js frontend (login, switch management, command execution) calling backend functions.
• The backend services and interfaces layer (exposed via internal/interfaces) responding to these calls.
• The backend modules should illustrate layered interaction, where higher-level service components call upon lower layers such as configuration, middleware (for logging and error handling), and utilities (for SSH connections and ping operations).
• The build components also play a role in packaging the final application for cross-platform deployment. Represent these as external deployment pipelines or toolchains that wrap the core application.
Architectural Concepts and Design Patterns
• Onion Architecture: Represent the concentric layers where:
• The outer layers (interfaces, in this case the Wails and Vue.js interactions) interact with the core business logic.
• The core inner layers (configuration, utilities, and services) encapsulate the business rules and infrastructure interactions.
• Dependency directional flows—e.g., from the configuration layer upward to services, then outward through interfaces to the frontend.
Technologies, Frameworks, and Libraries
• Backend:
• Go (primary language).
• The Wails framework—highlight its role in bridging the Go backend with the Vue.js frontend.
• Utilities: SSH libraries and custom ping modules.
• Frontend:
• Vue.js
• Node.js/npm for dependency management and build processes.
• Deployment:
• Build scripts and installers for Darwin (macOS) and Windows using the provided NSIS scripts and manifest files.
• Version control and CI/CD hints can be incorporated (e.g., the .github folder with dependabot).