🏗️ **Major Architecture Refactoring: Separate CLI + Server → Unified Binary** **Key Changes:** ✅ **Unified Binary**: Single 'insertr' binary with subcommands (enhance, serve) ✅ **Preserved Database Architecture**: Maintained sophisticated sqlc multi-DB setup ✅ **Smart Configuration**: Viper + YAML config with CLI flag precedence ✅ **Updated Build System**: Unified justfile, Air, and npm scripts **Command Structure:** - `insertr enhance [input-dir]` - Build-time content injection - `insertr serve` - HTTP API server (dev + production modes) - `insertr --config insertr.yaml` - YAML configuration support **Architecture Benefits:** - **Shared Database Layer**: Single source of truth for content models - **Flexible Workflows**: Local DB for dev, remote API for production - **Simple Deployment**: One binary for all use cases - **Better UX**: Consistent configuration across build and runtime **Preserved Features:** - Multi-database support (SQLite + PostgreSQL) - sqlc code generation and type safety - Version control system with rollback - Professional API endpoints - Content enhancement pipeline **Development Workflow:** - `just dev` - Full-stack development (API server + demo site) - `just serve` - API server only - `just enhance` - Build-time content injection - `air` - Hot reload unified binary **Migration:** Consolidated insertr-cli/ and insertr-server/ → unified root structure
25 lines
835 B
YAML
25 lines
835 B
YAML
# Insertr Configuration File
|
|
# This file provides default configuration for the unified insertr binary
|
|
|
|
# Database configuration
|
|
database:
|
|
path: "./insertr.db" # SQLite file path or PostgreSQL connection string
|
|
|
|
# API configuration (for remote content API)
|
|
api:
|
|
url: "" # Content API URL (leave empty to use local database)
|
|
key: "" # API authentication key
|
|
|
|
# Server configuration
|
|
server:
|
|
port: 8080 # HTTP server port
|
|
dev_mode: false # Enable development mode features
|
|
|
|
# Build configuration
|
|
build:
|
|
input: "./src" # Default input directory for enhancement
|
|
output: "./dist" # Default output directory for enhanced files
|
|
|
|
# Global settings
|
|
site_id: "demo" # Default site ID for content lookup
|
|
mock_content: false # Use mock content instead of real data |