AI-powered business diagnosis tool. Vercel-deployable.
- Server-side rate limiting: 3 diagnoses per IP per 24 hours via Vercel KV (Redis). Cannot be bypassed by clearing browser data.
- Hormozi-style AI advisor: Tactical, number-driven business diagnoses. Bottleneck → Revenue Impact → 3-Step Fix.
- Airtable logging: Every diagnosis + newsletter signup logged automatically.
- CORS locked: API only accepts requests from your domain.
- Responsive: Desktop, tablet, mobile.
advisory-engine/
├── api/
│ ├── diagnose.js # Anthropic diagnosis + Vercel KV rate limit + Airtable log
│ └── subscribe.js # Newsletter signup → Airtable
├── public/
│ └── index.html # Landing page + terminal UI
├── package.json
├── vercel.json
└── README.md
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY |
Yes | Your Anthropic API key (sk-ant-...) |
AIRTABLE_API_KEY |
Yes | Airtable personal access token |
AIRTABLE_BASE_ID |
Yes | Airtable base ID (starts with "app...") |
KV_REST_API_URL |
Yes | Auto-set when you link a Vercel KV store |
KV_REST_API_TOKEN |
Yes | Auto-set when you link a Vercel KV store |
This is what prevents people from spamming the diagnosis and burning your Anthropic credits.
- Go to your Vercel project dashboard
- Click Storage tab → Create → KV (Redis)
- Name it anything (e.g. "advisory-engine-kv")
- Click Connect — this auto-adds
KV_REST_API_URLandKV_REST_API_TOKENto your env vars - Redeploy
That's it. The code handles the rest: 3 questions per IP per 24 hours.
Your Airtable base needs two tables:
Table: Advisory Questions
| Column | Type |
|---|---|
| Question | Long text |
| Diagnosis | Long text |
| Question Number | Number |
| Created At | Single line text |
Table: Newsletter
| Column | Type |
|---|---|
| email address |
In vercel.json, replace YOUR-DOMAIN with your actual Vercel domain:
"Access-Control-Allow-Origin": "https://yourdomain.vercel.app"If you add a custom domain later, update this to match.
Get yours at https://console.anthropic.com → API Keys
# Push to GitHub, then import in Vercel
# Or use CLI:
cd advisory-engine
vercel --prod