How yunis-du/flash-cat works
Project’s Main Components
• Client Applications:
• GUI Application (“app”): Contains a graphical interface, tabs for sending, receiving, and settings. The “gui” directory inside “app/src” defines the aesthetics (styles, themes, progress bars) and functional tabs.
• CLI Application (“cli”): Offers command-line interactions for sending, receiving, and displaying progress. Its modules (send.rs, recv.rs, progress.rs) wrap the core file transfer functionalities.
• Core Functionality (“core”): Provides the main logic for performing sender and receiver operations (e.g., in core/src/sender.rs and core/src/receiver.rs).
• Shared/Common Libraries (“common”): Houses utilities for encryption, logging, networking, file system interactions, and protocol definitions (contained in proto/relay.proto). This is the foundation reused by both the GUI, CLI, and relay.
• Relay Server (“relay”): Implements a relay service that facilitates file transfers over a network (see relay/src directory with grpc.rs, relay.rs, session.rs, etc).
Relationships and Interactions
• The Client Applications (both GUI and CLI) interact with the Core functionality to access sending/receiving routines.
• Both core and application layers depend on the Common library for cryptography, networking utilities, logging, and consistent protocol definitions.
• If a user opts to use their own relay server (as described in the README), the Client Applications connect to the Relay Server. The Relay module manages network sessions and ensures data is properly routed between sender and receiver.
• Data flows generally from the client interface to the core backend and then to the relay server (if deployed), with encryption/decryption taking place via routines in the Common module.
Architectural Patterns and Design Principles
• Modularity & Separation of Concerns:
• The project uses multiple crates (app, cli, core, common, relay) to isolate different responsibilities.
• The GUI is separated into specialized modules (styles, tabs) which decouple presentation from business logic.
• Reusability:
• Shared functionalities (e.g., encryption algorithms, network utilities) appear in “common” to avoid duplication across clients.
• Cross-platform Design:
• The existence of separate install scripts and different user interfaces (CLI and GUI) hints at a design careful to support various operating systems.
a. Layout of Main Components:
• Blocks for “GUI Client (app)” and “CLI Client (cli)” to represent user interfaces.
• A block for “Core Engine” to capture the sending/receiving logic (from the “core” crate).
• A “Relay Server” block depicting the server-side component that users can deploy.
• Optionally, include an “Installer/Deployment” block to represent the installation scripts and package manager support.
b. Relationships and Data Flow:
• That when in relay mode, data flows from the sender (client) to the relay server and then to the receiver (client), ensuring secure transmission.
c. Technology and Frameworks:
• Mention that the GUI is interacting with several submodules (tabs, widgets, styles) to provide a rich user experience.
• That the common module supports gRPC standards in the “relay” component.
d. Visual Presentation Guidelines:
• Use clear, easy-to-read labels for each block/component.
• Rectangles for applications (GUI, CLI, Relay).
• Ovals or rounded rectangles for shared libraries (Core, Common).