# DanceLessonsCoach A Go project demonstrating idiomatic package structure, CLI implementation, and JSON API with Chi router. ## Features - Greet function with default behavior - Command-line interface - JSON API with versioned endpoints - Chi router integration - Zerolog for high-performance logging - Viper for configuration management - Graceful shutdown with context - Readiness endpoint for Kubernetes/service mesh integration - OpenTelemetry integration with Jaeger support - Unit tests - Go 1.26.1 compatible ## Installation ```bash # Clone the repository git clone https://github.com/yourusername/DanceLessonsCoach.git cd DanceLessonsCoach # Build and run go run ./cmd/greet ``` ## Configuration Basic configuration options: ```bash # Start with default configuration ./scripts/start-server.sh start # Custom port export DLC_SERVER_PORT=9090 ./scripts/start-server.sh start # JSON logging export DLC_LOGGING_JSON=true ./scripts/start-server.sh start ``` **See [AGENTS.md](AGENTS.md#configuration-management) for comprehensive configuration guide including:** - File-based configuration - Environment variables - Configuration priority rules - OpenTelemetry setup - Advanced scenarios ## Usage ### CLI ```bash # Default greeting go run ./cmd/greet # Output: Hello world! # Custom greeting go run ./cmd/greet John # Output: Hello John! ``` ### Web Server **Using the server control script (recommended):** ```bash # Start the server ./scripts/start-server.sh start # Test API endpoints ./scripts/start-server.sh test # Stop the server ./scripts/start-server.sh stop ``` **Manual server management:** ```bash # Start the server go run ./cmd/server # Test API endpoints curl http://localhost:8080/api/health # Output: {"status":"healthy"} curl http://localhost:8080/api/ready # Output: {"ready":true} curl http://localhost:8080/api/v1/greet # Output: {"message":"Hello world!"} curl http://localhost:8080/api/v1/greet/John # Output: {"message":"Hello John!"} ``` ## Testing ```bash # Run all tests go test ./... # Run specific package tests go test ./pkg/greet/ ``` ## Project Structure ``` DanceLessonsCoach/ ├── adr/ # Architecture Decision Records ├── cmd/ # Entry points (greet CLI, server) ├── pkg/ # Core packages (config, greet, server, telemetry) ├── config.yaml # Configuration file ├── scripts/ # Management scripts └── go.mod # Go module definition ``` **See [AGENTS.md](AGENTS.md#project-structure) for detailed structure and component explanations.** ``` ## Architecture This project uses Architecture Decision Records (ADRs) to document key technical choices. See [adr/](adr/) for complete documentation including decisions on Go 1.26.1, Chi router, Zerolog, OpenTelemetry, interface-based design, graceful shutdown, configuration management, and testing strategies. **Adding new decisions?** See [adr/README.md](adr/README.md) for guidelines. ## License MIT