How keinsell/neuronek works
Main Components Identification
a. Core Application Layers:
• CLI Interface Layer
• TUI (Terminal User Interface) Layer
• Core Business Logic Layer
• Database Layer
b. Major Modules:
• Ingestion Management
• Substance Management
• Analysis System
• Journal System
Component Relationships
User Interface Layer
• CLI Interface (src/cli/)
• Command Handlers (analyze.rs, ingestion.rs, substance.rs, stats.rs)
• TUI Interface (src/tui/)
• Views (ingestion, welcome, loading)
• Widgets (dosage, etc.)
Core Layer (src/core/)
• Configuration (config.rs)
• Error Handling (error_handling.rs)
• Logging (logging.rs)
Domain Layer
• Ingestion Module (src/ingestion/)
• Commands
• Queries
• Models
• Substance Module (src/substance/)
• Repository
• Route of Administration
• Analyzer Module (src/analyzer/)
• Services
• Models
Data Layer (src/database/)
• Entities
• Ingestion
• Substance
• Route of Administration
• Migrations
Important Architectural Patterns to Highlight
• Repository Pattern (seen in substance/repository.rs)
• Command Query Responsibility Segregation (CQRS) (visible in ingestion/command.rs and query.rs)
• Layer separation (UI, Core, Domain, Data)
Key Interactions
• CLI/TUI → Core Layer → Domain Layer → Data Layer flow
• Analyzer interactions with Ingestion and Substance data
• Database migrations and schema management
• Configuration and logging system integration
Additional Elements
• External dependencies (from Cargo.toml)
• Configuration sources (.envrc, config files)
• Build and deployment workflow connections
• Testing infrastructure