How mrllama123/dyno-viewer works
Project Type & Purpose
• This is a terminal-based full-stack (client-only) application focused on interacting with AWS DynamoDB.
• Its primary goal is to provide a lightweight, keyboard-driven UI for viewing and querying DynamoDB tables.
• Key points from the README include key dependencies (AWS CLI for authentication, Textual for UI, poetry for package management) and development notes for local setup and testing.
Analyzing the File Structure
• Top-level directories & files:
– The main source is in the “dyno_viewer” directory where the core code resides.
– “dyno_viewer/__main__.py” likely acts as the entry point.
– “dyno_viewer/app.py” and “dyno_viewer/app_types.py” manage the overall application logic and data structures.
• AWS Integration:
– The “dyno_viewer/aws” folder contains modules such as “ddb.py” (likely handling DynamoDB interactions) and “session.py” (managing AWS sessions).
• UI Components:
– The “dyno_viewer/components” directory is divided into subdirectories:
• “css” for styling rules (using .tcss files).
• “help” containing documentation/help content.
• “query” with modules for filtering and sorting queries.
• “screens” where different UI screens (error, help, various selection screens) are implemented.
– “dyno_viewer/components/table.py” suggests that table rendering is modularized.
• Utilities & Tests:
– “dyno_viewer/util” for general utility functions.
– A dedicated “tests” folder provides both unit and manual (interactive) tests, reflecting an emphasis on ensuring stable UI and AWS integrations.
Core Components & Their Relationships
• Entry Point: “__main__.py” starts the application and invokes “app.py”.
• Application Core: “app.py” likely orchestrates initialization and routing between UI components and AWS service calls.
• AWS Layer: Encapsulated in “dyno_viewer/aws”, these modules manage AWS sessions and data fetching from DynamoDB.
• UI Layer:
– “components/screens” – Modules here represent different terminal UI screens (help, error, region selection, table selection, etc.) that interact with the user.
– “components/query” – Contains logic to manipulate/filter queries, sorting keys, and formulating the requests.
– “components/css” – Contains styling definitions which influence the UI look and feel.
• Utilities: “dyno_viewer/util” offers supplementary functions to support both AWS interactions and UI operations.
Important Architectural Patterns & Design Principles
• Separation of Concerns: The code distinctly separates AWS interactions, UI components, and utility functions.
• Modular Architecture: Components are organized by their function (screens, queries, AWS operations, CSS styling), enabling ease of testing and maintenance.
• Testability: A dedicated “tests” directory shows commitment to unit and integration tests, ensuring each module can be verified independently.