This issue provides a high-level overview of the architecture for the dodl project, outlining the main components, their responsibilities, and how they interact with each other.
This is not exhaustive or final - but major deviations to this should be considered carefully and documented where practical.
Components
cmd Package
Contains command definitions using Cobra.
Entry point for the application.
core Package
Contains the Core Controller and shared application context.
Orchestrates interactions between components.
workspace Package
Manages workspace detection and initialization.
config Package
Handles configuration loading and management using Viper.
template Package
Manages template loading and rendering.
filesystem Package
Handles file and directory operations.
models Package
Defines shared data structures (e.g., CommandContext, AppContext, TemplateData).
utils Package (optional)
Provides utility functions and common helpers.
Component Interactions (Example)
Core Controller acts as the central orchestrator, coordinating between all components.
Command Parser (cmd package) parses user input and delegates to the Core Controller.
Workspace Manager identifies the workspace root and manages the workspace directory.
Configuration Manager loads configurations, given the workspace root.
Template Engine processes templates using data and configurations.
File System Manager performs filesystem operations.
Models package provides shared data structures across components.
Utils package offers common utility functions used by multiple components.
Execution Flow Example
Command Execution: User runs a command using the CLI.
Command Parsing: cmd package parses the command and creates a CommandContext.
Core Controller Initialisation: Initialises AppContext and coordinates components.
Workspace Detection: workspace package identifies the workspace root.
Architecture
This issue provides a high-level overview of the architecture for the
dodl
project, outlining the main components, their responsibilities, and how they interact with each other.This is not exhaustive or final - but major deviations to this should be considered carefully and documented where practical.
Components
cmd Package
core Package
workspace Package
config Package
template Package
filesystem Package
models Package
utils Package (optional)
Component Interactions (Example)
Execution Flow Example