REST API for analyzing codebase API usage, estimating cost, detecting inefficiencies, and generating optimization suggestions.
Developers often ship API-heavy features without visibility into:
- Monthly API spend risk
- Redundant or cacheable request patterns
- Rate-limit and N+1 hotspots
EcoAPI turns parsed API call data into actionable diagnostics:
- Cost analytics
- Endpoint-level risk/status
- Optimization suggestions with estimated savings
- Graph data for dependency visualization
- Sustainability stats — electricity (kWh), water (L), and CO2 (g) footprint estimated from API call volume, with AI vs non-AI breakdown
- Cloudflare Workers — serverless runtime
- Hono — web framework
- Cloudflare D1 — SQLite database
- TypeScript — strict mode
- React 18 + React Router v7
- TanStack Query v5, Tailwind CSS v4, D3.js, Radix UI
- TypeScript extension backend
- React webview UI
- AI chat — OpenAI (default) or Cloudflare AI (optional)
api/ # Cloudflare Workers API
src/
index.ts # Workers entry point (Hono app)
env.ts # Shared Env/Variables/AppContext types
config/
pricing.ts # Provider pricing & keyword detection
sustainability.ts # Energy/water/CO2 constants per provider
middleware/
cors.ts
content-type.ts
logging.ts
request-id.ts
error-handler.ts
rate-limit.ts # KV-based scan rate limiting
models/
types.ts # TypeScript domain types
routes/
health.ts # GET /health
projects.ts # Projects, scans, endpoints, suggestions, graph, cost, sustainability
providers.ts # GET /providers
chat.ts # POST /chat (Cloudflare AI / Llama 3.1 8B)
services/
analysis-service.ts # Core analysis engine (pure, sync)
project-service.ts # All CRUD via D1 (async)
provider-service.ts # Provider config lookups
validation-service.ts # Input validation
utils/
app-error.ts
pagination.ts
sort.ts
migrations/
0001_schema.sql # D1 table definitions
0002_seed.sql # Demo project seed data
wrangler.toml
package.json
tsconfig.json
dashboard/ # React SPA (Cloudflare Pages / local extension server)
src/
App.tsx # Root component with routing
theme-context.tsx # Theme state provider
themes.ts # Theme definitions
components/
Select.tsx
animated-tree.tsx
particles.tsx
layout/
Layout.tsx
lib/
api.ts # REST client (VITE_API_URL or same-origin for local mode)
queries.ts # TanStack Query hooks
types.ts # TypeScript types matching API responses
pages/
Dashboard.tsx # Overview/summary
Endpoints.tsx # Endpoint analysis with filtering
Graph.tsx # D3 network graph (cluster by provider/file/cost)
Suggestions.tsx # Optimization recommendations
styles/
index.css
tailwind.css
theme.css
fonts.css
vite.config.ts
package.json
extension/ # VSCode extension
src/
extension.ts # Extension entry point
api-client.ts # HTTP client for backend
local-server.ts # Embedded HTTP server serving dashboard + local API
webview-provider.ts # Sidebar webview provider
messages.ts # Message types for extension ↔ webview IPC
analysis/
types.ts # Analysis type definitions
chat/
prompts.ts # AI prompt templates
scanner/
patterns.ts # API call detection regex patterns
workspace-scanner.ts # Workspace file scanner
webview/ # React sidebar UI
src/
App.tsx
types.ts
vscode.ts # VSCode API bridge
components/
LandingPage.tsx
ScanningPage.tsx
ResultsPage.tsx
ChatPage.tsx
Markdown.tsx
LeafIcon.tsx
styles/
index.css
dashboard-dist/ # Built dashboard (generated by npm run build:dashboard)
eco-api-analyzer-0.1.0.vsix
scripts/
install-dashboard.sh # Install dashboard npm dependencies
start-extension.sh # Full extension dev setup (install + build + open VSCode)
The API is live at https://api.ecoapi.dev — no setup required.
Full API documentation is available at https://ecoapi.dev.
Runs ECO analysis directly inside your editor — no remote API server needed. Scans your workspace for API call patterns, shows cost/risk diagnostics in the sidebar, and opens the full dashboard locally. AI chat is optional — uses OpenAI by default, or Cloudflare AI (Llama 3.1 8B) if preferred.
bash scripts/start-extension.shThen press F5 in VSCode to launch the Extension Development Host, and click the ECO leaf icon in the Activity Bar.
- Command Palette (
Ctrl+Shift+P) → "Extensions: Install from VSIX..." - Select
extension/eco-api-analyzer-0.1.0.vsix - Reload VSCode, then click the ECO icon in the Activity Bar.
Copyright © 2026 Andres Lopez, Aslan Wang, Donggyu Yoon. All rights reserved.
