{"id":48543923,"url":"https://github.com/nirbhays/infracents","last_synced_at":"2026-04-08T06:01:19.782Z","repository":{"id":349848685,"uuid":"1153053937","full_name":"nirbhays/infracents","owner":"nirbhays","description":"GitHub App: real-time Terraform cost estimates on every PR. Catch cloud cost surprises before they merge.","archived":false,"fork":false,"pushed_at":"2026-04-07T19:39:00.000Z","size":2196,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-07T21:26:42.184Z","etag":null,"topics":["aws","cloud-cost","cost-estimation","devops","finops","gcp","github-app","infrastructure","open-source","pull-request","python","terraform"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nirbhays.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-08T20:38:15.000Z","updated_at":"2026-04-07T19:39:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nirbhays/infracents","commit_stats":null,"previous_names":["nirbhays/infracents"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nirbhays/infracents","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirbhays%2Finfracents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirbhays%2Finfracents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirbhays%2Finfracents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirbhays%2Finfracents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nirbhays","download_url":"https://codeload.github.com/nirbhays/infracents/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirbhays%2Finfracents/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31542384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cloud-cost","cost-estimation","devops","finops","gcp","github-app","infrastructure","open-source","pull-request","python","terraform"],"created_at":"2026-04-08T06:01:18.071Z","updated_at":"2026-04-08T06:01:19.776Z","avatar_url":"https://github.com/nirbhays.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/logo.png\" alt=\"InfraCents Logo\" width=\"100\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eInfraCents\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eTerraform cost estimates on every pull request. Automatically.\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg\" alt=\"License: MIT\" /\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Python-3.11+-blue.svg\" alt=\"Python 3.11+\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Next.js-14-black.svg\" alt=\"Next.js 14\" /\u003e\n  \u003ca href=\"#contributing\"\u003e\u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs Welcome\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#demo\"\u003eDemo\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026bull;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026bull;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026bull;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#architecture\"\u003eArchitecture\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026bull;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#supported-resources\"\u003eResources\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026bull;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nInfraCents is an open-source GitHub App that posts real-time cloud cost estimates directly on your pull requests. It parses your Terraform changes, queries live pricing APIs from AWS and GCP, and tells your team exactly how much a PR will cost -- before it merges.\n\nNo CLI tools to install. No CI pipelines to configure. Install the app, open a PR, and get cost visibility in seconds.\n\n## Why InfraCents?\n\n| | Before InfraCents | After InfraCents |\n|---|---|---|\n| **Cost visibility** | Merge first, discover costs on the monthly bill | Know exactly what every PR will cost before it ships |\n| **Review process** | Reviewers guess at infrastructure cost impact | Every reviewer sees a clear cost breakdown inline |\n| **Budget control** | Overspend detected weeks after deployment | Cost regressions caught at code review time |\n| **Setup effort** | Install CLI tools, configure CI, manage API keys | One-click GitHub App install, zero config |\n\n---\n\n## Demo\n\nWhen a pull request modifies `.tf` files, InfraCents automatically posts a comment like this:\n\n```\n## InfraCents Cost Estimate\n\n### This PR will increase monthly costs by ~$142.50/mo (+12.3%)\n\n| Resource                          | Type         | Change   | Monthly Cost |\n|-----------------------------------|--------------|----------|-------------:|\n| aws_instance.api_server           | EC2          | + added  |      $62.00  |\n| aws_db_instance.primary           | RDS          | ~ modified |    +$45.50  |\n| aws_lb.public                     | ALB          | + added  |      $22.00  |\n| aws_s3_bucket.logs                | S3           | + added  |       $2.30  |\n| aws_elasticache_cluster.sessions  | ElastiCache  | + added  |      $12.50  |\n| aws_nat_gateway.main              | NAT Gateway  | - removed |     -$1.80  |\n\n**Summary**\n  New resources:      4 (+$98.80/mo)\n  Modified resources: 1 (+$45.50/mo)\n  Removed resources:  1 (-$1.80/mo)\n  Net change:         +$142.50/mo\n\n  AWS: +$142.50 | GCP: $0.00\n  Confidence: HIGH for 5/6 resources\n\n\u003e Powered by InfraCents | Docs | Dashboard\n```\n\nNo CLI. No Terraform plan uploads. It just works.\n\n---\n\n## Quick Start\n\n### Use InfraCents (hosted)\n\n1. **Install the GitHub App** on your repository (one-click setup)\n2. **Open a pull request** that adds or modifies `.tf` files\n3. **Get cost estimates** posted automatically as a PR comment\n\nThat's it. No API keys, no CI changes, no config files.\n\n### Run locally (self-hosted)\n\n```bash\n# 1. Clone and configure\ngit clone https://github.com/your-org/infracents.git\ncd infracents\ncp .env.example .env          # Edit with your GitHub App credentials\n\n# 2. Start everything with Docker\ncd backend\ndocker-compose up -d          # Starts PostgreSQL, Redis, and the API\n\n# 3. Run database migrations\npsql $DATABASE_URL -f ../database/migrations/001_initial.sql\n\n# 4. Start the backend\npip install -r requirements.txt\nuvicorn main:app --reload --port 8000\n\n# 5. Start the frontend (in a new terminal)\ncd frontend\nnpm install \u0026\u0026 npm run dev\n```\n\nThen follow the [Deployment Guide](docs/DEPLOYMENT.md) to register your GitHub App and configure webhooks.\n\n---\n\n## Features\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Automated PR Comments\nEvery PR with Terraform changes gets an automatic cost breakdown: per-resource costs, total monthly delta, percentage change, and provider split.\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Multi-Cloud Pricing Engine\nReal-time pricing from official AWS Price List and GCP Billing Catalog APIs. 25+ resource types across both clouds with hourly cache refresh via Redis.\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Web Dashboard\nTrack cost trends over time across all repositories. Organization-level overviews, per-repo history with charts, and PR-level drill-downs with CSV export.\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Security-First Design\nMinimal GitHub permissions (read-only repo + PR comments). Webhook signature verification via HMAC-SHA256. No secrets stored -- works with `.tf` files only.\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n---\n\n## Architecture\n\n```\n                        Pull Request (.tf changes)\n                                  |\n                                  v\n                    +----------------------------+\n                    |     GitHub Webhook          |\n                    |   (pull_request event)      |\n                    +-------------+--------------+\n                                  |\n                                  v\n                    +----------------------------+\n                    |    InfraCents API           |\n                    |    (FastAPI / Cloud Run)    |\n                    +---+--------+----------+----+\n                        |        |          |\n               +--------+   +---+---+   +--+--------+\n               v             v           v\n         +-----------+ +-----------+ +-----------+\n         | Terraform | | AWS Price | | GCP Price |\n         | Parser    | | List API  | | Catalog   |\n         +-----------+ +-----------+ +-----------+\n               |             |           |\n               +--------+----+----+------+\n                        |         |\n                        v         v\n              +----------------+  +----------------+\n              | Cost Engine    |  | Redis Cache    |\n              | (calc delta)   |  | (pricing data) |\n              +-------+--------+  +----------------+\n                      |\n            +---------+---------+\n            v                   v\n   +----------------+  +----------------+\n   | PR Comment     |  | Dashboard      |\n   | (GitHub API)   |  | (Next.js 14)   |\n   +----------------+  +-------+--------+\n                                |\n                                v\n                       +----------------+\n                       | PostgreSQL     |\n                       | (scan history) |\n                       +----------------+\n```\n\n**Tech stack:** Python 3.11 / FastAPI on Cloud Run, Next.js 14 on Vercel, PostgreSQL via Supabase, Redis via Upstash, Auth via Clerk, Payments via Stripe.\n\nFor the full deep-dive, see [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).\n\n---\n\n## Supported Resources\n\n### AWS (15 resource types)\n\n| Resource | Terraform Type | Confidence |\n|----------|---------------|:----------:|\n| EC2 Instance | `aws_instance` | High |\n| RDS Database | `aws_db_instance` | High |\n| S3 Bucket | `aws_s3_bucket` | Medium |\n| Lambda Function | `aws_lambda_function` | Medium |\n| Load Balancer (ALB/NLB) | `aws_lb` | High |\n| NAT Gateway | `aws_nat_gateway` | Medium |\n| ECS Fargate Service | `aws_ecs_service` | High |\n| ElastiCache Cluster | `aws_elasticache_cluster` | High |\n| DynamoDB Table | `aws_dynamodb_table` | Medium |\n| EBS Volume | `aws_ebs_volume` | High |\n| CloudFront Distribution | `aws_cloudfront_distribution` | Low |\n| Route 53 Hosted Zone | `aws_route53_zone` | High |\n| SQS Queue | `aws_sqs_queue` | Low |\n| SNS Topic | `aws_sns_topic` | Low |\n| Secrets Manager | `aws_secretsmanager_secret` | High |\n\n### GCP (10 resource types)\n\n| Resource | Terraform Type | Confidence |\n|----------|---------------|:----------:|\n| Compute Engine VM | `google_compute_instance` | High |\n| Cloud SQL Instance | `google_sql_database_instance` | High |\n| Cloud Storage Bucket | `google_storage_bucket` | Medium |\n| Cloud Function | `google_cloudfunctions_function` | Medium |\n| GKE Node Pool | `google_container_node_pool` | High |\n| Cloud NAT Gateway | `google_compute_router_nat` | Medium |\n| Pub/Sub Topic | `google_pubsub_topic` | Low |\n| Memorystore Redis | `google_redis_instance` | High |\n| Persistent Disk | `google_compute_disk` | High |\n| Static IP Address | `google_compute_address` | High |\n\n\u003e **Confidence levels:** *High* = exact API pricing match. *Medium* = pricing with usage estimates. *Low* = best-effort estimate based on typical usage patterns.\n\n---\n\n## Comparison with Alternatives\n\n| | **InfraCents** | **Infracost** | **env0** | **Spacelift** |\n|---|:---:|:---:|:---:|:---:|\n| **Open source** | Yes (MIT) | Yes (Apache 2.0) | No | No |\n| **Setup time** | \u003c 2 min | ~15 min | ~30 min | ~30 min |\n| **GitHub App (one-click)** | Yes | No (CI required) | Yes | Yes |\n| **No CLI required** | Yes | No | Yes | Yes |\n| **PR cost comments** | Yes | Yes | Yes | Yes |\n| **Web dashboard** | Yes | Paid tier | Yes | Yes |\n| **AWS support** | 15 resources | 100+ resources | Full | Full |\n| **GCP support** | 10 resources | 70+ resources | Full | Full |\n| **Azure support** | Roadmap | Yes | Yes | Yes |\n| **Self-hostable** | Yes | Yes | No | No |\n| **Free tier** | Generous | Community edition | Limited trial | Limited trial |\n| **Pricing** | Free / $29 / $99 | Free / $50+ | Custom | Custom |\n\n**When to choose InfraCents:** You want a lightweight, self-hostable solution with zero-config GitHub App setup and you primarily use AWS/GCP. If you need 100+ resource types or Azure support today, Infracost is the more mature choice.\n\n---\n\n## Project Structure\n\n```\ninfracents/\n  backend/                     Python/FastAPI backend\n    api/                       Route handlers\n    models/                    Pydantic data models\n    services/                  Business logic (parser, pricing, GitHub)\n    pricing_data/              Cloud pricing data \u0026 resource mappings\n    main.py                    Application entry point\n    Dockerfile                 Production container\n    docker-compose.yml         Local dev (Postgres + Redis)\n  frontend/                    Next.js 14 frontend\n    src/app/                   App Router pages\n    src/components/            React components\n    src/lib/                   Utility libraries\n  database/                    SQL schemas \u0026 migrations\n  infra/                       Terraform IaC for deployment\n  tests/                       Python test suite\n  docs/                        Documentation\n  .github/workflows/           CI/CD pipelines\n```\n\n---\n\n## Contributing\n\nContributions are welcome and appreciated. Whether it is a bug fix, new resource type support, documentation improvement, or feature idea -- we would love your help.\n\n**Getting started:**\n\n1. Fork the repository and create your branch from `main`\n2. Follow the [Development Guide](docs/DEVELOPMENT.md) for local setup\n3. Make your changes and add tests\n4. Submit a pull request\n\n**Good first contributions:**\n\n- Add support for a new AWS or GCP resource type (see `backend/pricing_data/resource_mappings.py`)\n- Improve cost estimate accuracy for existing resources\n- Add unit tests for the pricing engine\n- Improve documentation\n\nSee [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md) for the full contributor guide, code style, and PR process.\n\n---\n\n## Documentation\n\n| Document | Description |\n|----------|-------------|\n| [Architecture](docs/ARCHITECTURE.md) | System design and data flow |\n| [API Reference](docs/API.md) | Endpoint documentation |\n| [Deployment Guide](docs/DEPLOYMENT.md) | Production deployment walkthrough |\n| [Development Guide](docs/DEVELOPMENT.md) | Local setup and dev workflow |\n| [Pricing Engine](docs/PRICING-ENGINE.md) | How cost estimation works |\n| [Security](docs/SECURITY.md) | Security model and threat analysis |\n| [Contributing](docs/CONTRIBUTING.md) | Contributor guide |\n\n---\n\n## Connect \u0026 Follow\n\nIf you find this project useful, consider:\n\n- ⭐ **Starring** this repo to help others discover it\n- 🐛 **Opening issues** for bugs or feature requests\n- 🤝 **Contributing** — see [CONTRIBUTING.md](CONTRIBUTING.md)\n- 📝 [Read the blog post](https://medium.com/@nirbhaysingh1/i-built-a-bot-that-killed-147-000-in-wasted-cloud-spend-before-it-shipped-d25175df9e42)\n- 💼 **LinkedIn**: [Nirbhay Singh](https://www.linkedin.com/in/nirbhaysingh1/)\n- 🐙 **GitHub**: [@nirbhays](https://github.com/nirbhays)\n\nBuilt with ❤️ by [Nirbhay Singh](https://cloudtoai.in) — Cloud \u0026 AI Architect\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"docs/ARCHITECTURE.md\"\u003eArchitecture\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026bull;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"docs/API.md\"\u003eAPI Reference\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026bull;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"docs/DEPLOYMENT.md\"\u003eDeployment\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026bull;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"docs/CONTRIBUTING.md\"\u003eContributing\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eBuilt for DevOps teams tired of surprise cloud bills.\u003c/sub\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnirbhays%2Finfracents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnirbhays%2Finfracents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnirbhays%2Finfracents/lists"}