How zemariavg/notist-client works
Project type and purpose
• This is a command‐line client tool for securely creating, reading, editing, listing, backing up, and managing encrypted notes.
• It bundles a small “cryptolib” encryption library, a set of action handlers, utility modules, and local filesystem storage of notes and keys.
Main components
a. CLI Frontend (app.py)
• Parses user commands and dispatches to the appropriate action in the actions/ folder.
b. Actions Layer (actions/)
• One module per operation (create, read, edit, list, backup, integrity check, add collaborator, retrieve).
• Each action calls into the cryptolib or utils to perform its task.
c. Cryptography Library (cryptolib/)
• Core encryption/decryption routines (protect.py, unprotect.py, check.py, notist.py).
• Utility subpackage for file I/O, key management, parsing (utils/cryptoutils.py, utils/file.py, utils/noteparser.py).
• Built‐in tests under cryptolib/test/.
d. General Utilities (utils/noteutils.py)
• Higher‐level helpers for note formatting, metadata injection, etc., used by actions.
e. Local Storage
• Notes stored as JSON on the filesystem.
• User keypairs under keys/ directory.
• Configuration (config.py) governs default file paths and parameters.
Key relationships and data flows
• User invokes python3 app.py <action> [args].
• CLI parses input → loads config → instantiates the chosen action.
• Action retrieves or writes note files via utils or direct file I/O.
• For encryption/decryption, action calls cryptolib.protect or cryptolib.unprotect, which in turn uses key files from keys/ and low‐level routines in cryptolib/utils.
• Output (encrypted JSON, plaintext notes, integrity reports) is printed to stdout or saved back to disk.
Architectural patterns and design principles
• Modular layering: CLI → Action modules → Crypto library + Utils → Filesystem.
• Single‐Responsibility: each action module manages one command.
• Separation of concerns: cryptographic logic lives in cryptolib, UI and command parsing live in app.py, file‐format logic in utils.
• Extensibility: Adding a new action just means dropping a new script in actions/ that conforms to the existing interface.