Skip to content

Api generator#81

Merged
sahilsk11 merged 4 commits intomasterfrom
api-generator
Jan 20, 2026
Merged

Api generator#81
sahilsk11 merged 4 commits intomasterfrom
api-generator

Conversation

@sahilsk11
Copy link
Owner

@sahilsk11 sahilsk11 commented Jan 20, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a new API endpoint to send saved strategy summary emails.
    • Introduced an automated API code generation tool to streamline API development.
  • Chores

    • Added infrastructure-as-code configuration for API deployment via Terraform.
    • Updated the build system with API code generation capabilities.
    • Updated project configuration to exclude Terraform files.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR introduces an automated API code generation system that reads endpoint definitions from a YAML configuration file and generates Go API models, resolver stubs, updated routing configurations, and Terraform infrastructure-as-code for AWS API Gateway deployment.

Changes

Cohort / File(s) Summary
Build & Configuration
.gitignore, Makefile, tools/requirements.txt
Updated .gitignore to exclude Terraform state files and local environment directories. Added generate-api Makefile target to execute the code generation script. Added PyYAML dependencies for YAML parsing.
API Endpoint Configuration & Generation
api/endpoints.yaml, tools/generate_api.py
Introduced declarative YAML endpoint configuration defining POST /sendSavedStrategySummaryEmails with AWS Lambda proxy integration. Implemented comprehensive Python code generator (541 lines) that parses endpoints.yaml, generates Go models/resolvers, updates routing, and creates Terraform infrastructure. Includes type mapping, naming utilities, and multiple generation pipelines.
Generated API Models & Resolvers
api/models/generated.go, api/send_saved_strategy_summary_emails.resolver.go
Created generated Go model file with SendSavedStrategySummaryEmailsResponse struct. Replaced api/send_saved_strategy_summaries.resolver.go with new resolver handler implementing request context setup, profile attachment, logger insertion, and error handling with HTTP 500/200 responses.
Infrastructure-as-Code
terraform/api_gateway.tf, terraform/terraform.tfvars.example
Added complete Terraform configuration provisioning API Gateway REST API resource, POST method, Lambda integration with proxy mode, deployment, and stage resources. Included AWS provider setup, Lambda permission granting, and API endpoint URL output. Added example variables file for configuration.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 A rabbit's ode to generation
With YAML seeds and Python's art,
Infrastructure grows from a config start,
Terraform towers, Go code springs to life,
Automation banishes the coding strife! ✨

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sahilsk11 sahilsk11 merged commit b1e53ad into master Jan 20, 2026
1 check passed
@sahilsk11 sahilsk11 deleted the api-generator branch January 20, 2026 07:12
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.

1 participant