Skip to content

feat: add api scaff#4

Merged
mattevans merged 3 commits intomasterfrom
feat/api-scaff
Oct 9, 2025
Merged

feat: add api scaff#4
mattevans merged 3 commits intomasterfrom
feat/api-scaff

Conversation

@mattevans
Copy link
Copy Markdown
Member

@mattevans mattevans commented Oct 9, 2025

Implements API Shell

  • Server entry point (cmd/server/main.go) with graceful shutdown on SIGINT/SIGTERM
  • Configuration system (internal/config/) supporting YAML files and environment variables
  • ClickHouse client (internal/database/) using official clickhouse-go/v2 driver with connection pooling
  • Middleware stack (internal/middleware/):
    • Request logging with duration tracking
    • CORS (public API, allows all origins)
    • Panic recovery
    • Prometheus metrics (request counts, duration histograms)
  • Server setup (internal/server/) using native http.ServeMux
  • Health endpoint (/health) and metrics endpoint (/metrics)
  • Example configuration (config.example.yaml)

OpenAPI Tooling Improvements

  • Renamed openapi-filter-flatten → openapi-preprocess for clarity
  • Added openapi-postprocess tool for final spec cleanup
  • Updated implementation generator to support new tooling workflow

Protobuf Fixes

  • Corrected proto type name capitalization for protoc compatibility
  • Updated generator to produce properly capitalized type references

…ful shutdown

chore: rename openapi-filter-flatten to openapi-preprocess and add postprocess tool
fix: correct proto type name capitalization for protoc compatibility
docs: update README with server runtime instructions and configuration

feat: add complete server infrastructure with config, database, and middleware

- Add configuration management with viper for server and ClickHouse
- Add ClickHouse client with native protocol support and TLS
- Add health check handler and CORS middleware
- Add logging, metrics, and panic recovery middleware
- Add server setup with OpenAPI spec and Swagger UI
@mattevans mattevans self-assigned this Oct 9, 2025
docs(README): update quick-start and command list to match new Makefile
Comment thread Makefile
style(clickhouse): shorten dev environment comment
feat(middleware): add gzip compression middleware with pool and size check
fix(recovery): return JSON error response instead of plain text
feat(server): register gzip middleware to compress HTTP responses
@mattevans mattevans merged commit b38a604 into master Oct 9, 2025
@mattevans mattevans deleted the feat/api-scaff branch October 9, 2025 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants