How erikkalkoken/janice works
Main Components
• Entry Point: The application’s starting point is main.go, which sets up and initiates the program.
• User Interface (UI) Module: Located under internal/ui, this module comprises various files (about, menu, searchbar, treenode, etc.) responsible for managing the UI elements, theme (dark/light), user interactions, and overall layout.
• JSON Processing Module: Under internal/jsondocument, you have components like jsondocument.go, helper.go, and treesizer.go. These handle JSON parsing, document manipulation, formatting, and possibly efficiency improvements for large JSON structures.
• GitHub Integration (Optional/Supporting): The internal/github directory contains code that likely interfaces with GitHub – maybe for version checks, release information, or other integrations.
• Tools: The tools directory includes scripts and programs (like generate_json and multiply_json) that either assist in testing, generating JSON files, or automating the build and packaging processes.
• Build & Deployment: Files like FyneApp.toml, Makefile, .github workflows, and AppImage packaging scripts (in tools/build_appimage.sh) cover build automation, CI/CD, and deployment.
Relationships and Interactions
• The main.go launches the application, initializing the Fyne framework.
• The UI module (internal/ui) interacts with the JSON Processing module (internal/jsondocument) to load, parse, display, and search through JSON files.
• User actions in the UI (like selecting a file, performing a search, or expanding a tree node) trigger corresponding function calls in the JSON processing components.
• The GitHub internal module might be accessed for update checks or external service calls.
• The tool scripts support auxiliary functions like generating JSON data for testing or building distributable packages (AppImage for Linux, etc.).
• Testing files (not shown in production but available in subdirectories) indicate that unit and integration tests ensure each component behaves as expected.
Architectural Patterns and Design Principles
• Separation of Concerns: The project is neatly divided into modules (UI, JSON processing, GitHub integration, and tools), each responsible for a distinct aspect of the application.
• Modular Design: The clear organization (using the “internal” directory) indicates that the app’s key functionalities are encapsulated in separate packages. This helps maintain clarity and ease of testing.
• Event-Driven UI Architecture: Given that the application relies on Fyne for a responsive desktop GUI, the UI components likely follow an event-driven design.
• Single Executable “Fat” Application: The design embraces Go’s philosophy of producing a standalone binary that includes all necessary dependencies.
Relevant Technologies
• Fyne: The primary UI toolkit referenced by FyneApp.toml and the README.
• Go: The programming language used, with dependencies managed via go.mod and go.sum.
• CI/CD: GitHub actions defined under .github/workflows/ci-cd.yml, ensuring quality and integration.
• Build tooling: Tools such as Makefile and scripts for generating or multiplying JSON files to support functionality and testing.