How oleoneto/dm works
Main Components
a) Core Components:
• CLI Interface
• API Server
• Migration Engine
• Storage Layer
• Configuration Manager
b) External Components:
• Database Systems (PostgreSQL)
• File System (Migration Files)
Component Relationships
User Interactions -> Interface Layer
• ↓
Business Logic Layer
• ↓
Data Layer -> Database/File System
Specific Implementation Details
• Rectangles: Core components
• Folders: File system components
• Hexagons: External interfaces
• Diamonds: Decision points in migration flow
• Blue: Interface components
• Green: Processing components
• Yellow: Storage components
• Gray: External systems
Key Flows to Highlight
a) Migration Flow:
CLI/API Request -> Configuration Loading -> Migration Engine ->
Database Adapter -> Migration Execution -> State Update
b) Validation Flow:
Migration File -> Validator -> Schema Verification ->
Duplicate Detection -> Validation Result
Important Architectural Elements
Specific components based on the file structure:
• Controllers (/api/controllers)
• Middleware (/api/middleware)
• Command handlers (/cli/cmd)
• Migration engine (/migrations)
• Store adapters (/stores)
Additional Details
Annotations for:
• Default ports (3809)
• Supported database types (PostgreSQL)
• File formats (YAML)
• Configuration options
• CORS settings
• API versions
Technical Specifications
Technical aspects:
• Go-based implementation
• RESTful API architecture
• Swagger documentation integration
• Environment variable configuration
• Docker support
Remember to emphasize the separation between the command-line interface and the API server, while showing how they share the same underlying migration engine and database interactions.
This system design should clearly illustrate how the tool manages both the migration files and their execution state, showing the flow from file generation through validation and execution to state tracking in the database.