Skip to content

Commit 7ff6e08

Browse files
committed
Improve product storytelling in README
1 parent 38c3af9 commit 7ff6e08

1 file changed

Lines changed: 166 additions & 74 deletions

File tree

README.md

Lines changed: 166 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,159 @@
11
# GrantStack
22

3-
GrantStack is a serverless project-intake and grant-screening product for capex-heavy facility expansion projects. A user submits project basics through the landing page, the API accepts the request immediately, asynchronous workers generate a source-backed incentive-screening memo, and the user views the result through a private tokenized report link.
3+
AI grant intelligence for companies planning capex-heavy facility expansions.
44

5-
## Live Demo
5+
GrantStack turns a rough expansion plan into a cited first-pass incentive strategy: which grant, tax credit, workforce, infrastructure, and economic-development programs are worth pursuing, what risks could kill eligibility, and what the team should validate next.
66

7-
- Live site: https://grantstack.pages.dev
8-
- GitHub repository: https://github.com/manynames3/grantstack
7+
**Live demo:** https://grantstack.pages.dev
8+
**Repository:** https://github.com/manynames3/grantstack
9+
**Backend API:** https://rx967db2q9.execute-api.us-east-1.amazonaws.com/projects
10+
11+
## The Problem
12+
13+
Manufacturers, logistics operators, energy companies, and other capex-heavy businesses often make site and expansion decisions before they have a clear read on public funding.
14+
15+
The early process is messy:
16+
17+
- Project specs live in emails, spreadsheets, PDFs, and consultant notes.
18+
- Incentive programs vary by state, locality, job count, wages, capex, industry, and timeline.
19+
- Teams waste time chasing programs that are not a fit.
20+
- CFOs and operators need a defensible first-pass answer before paying for deeper advisory work.
21+
- Generic AI tools can summarize programs, but they do not create a structured, source-backed workflow with status, auditability, retries, and private report links.
22+
23+
GrantStack is built for that gap: fast enough for early diligence, structured enough for buyer conversations, and architected like a real serverless product instead of a one-off prompt wrapper.
24+
25+
## Who It Is For
26+
27+
Primary end users:
28+
29+
- Expansion teams evaluating new sites or facility upgrades.
30+
- CFO, finance, and strategy teams screening whether incentives are worth deeper pursuit.
31+
- Site-selection consultants and economic-development advisors preparing first-pass memos.
32+
- Operators who need to turn project basics into a better conversation with public agencies.
33+
34+
Best first customer niche:
35+
36+
- US manufacturing or advanced industrial companies considering a multi-million-dollar expansion with meaningful job creation and a site decision inside 3-6 months.
37+
38+
## What It Does
39+
40+
A user submits:
41+
42+
- Location
43+
- Capital investment
44+
- New jobs
45+
- Facility type
46+
- Optional buyer context such as company, wages, timeline, and competing locations
47+
48+
GrantStack returns a private report with:
49+
50+
- Eligibility score and confidence level
51+
- Recommended incentive program categories
52+
- Cited program recommendations with source URLs
53+
- Strengths tied to capex, jobs, location, and facility type
54+
- Risk flags and missing diligence items
55+
- Next actions for internal review or agency outreach
56+
- Validation disclaimer so the report is positioned as decision support, not legal or tax advice
57+
58+
## Live Workflow
59+
60+
The deployed demo is an end-to-end product flow:
61+
62+
1. User submits project specs on the Cloudflare Pages frontend.
63+
2. API Gateway accepts the request and returns `202 Accepted` immediately with a private report token.
64+
3. Ingestion Lambda validates the payload, writes the accepted record, and queues the job.
65+
4. SQS triggers an asynchronous processor worker.
66+
5. Processor Lambda screens the project against the active source catalog and optional LLM/vector provider path.
67+
6. DynamoDB stores the completed structured report.
68+
7. The report page polls the private tokenized endpoint and renders the result.
69+
70+
```mermaid
71+
flowchart LR
72+
User["Expansion Team"] --> Site["Cloudflare Pages Intake"]
73+
Site --> Api["API Gateway HTTP API"]
74+
Api --> Ingest["Ingestion Lambda"]
75+
Ingest --> Queue["SQS Queue"]
76+
Queue --> Processor["Processor Lambda"]
77+
Processor --> Catalog["S3 Source Catalog"]
78+
Processor -. prod-ready .-> Vector["Pinecone / Vector DB"]
79+
Processor -. prod-ready .-> LLM["OpenAI / Anthropic"]
80+
Processor --> DDB["DynamoDB On-Demand"]
81+
Site --> Report["Private Report Page"]
82+
Report --> Api
83+
```
84+
85+
## Why This Is Not Just A Prompt Demo
86+
87+
GrantStack is intentionally built as a production-style event-driven system:
88+
89+
- **Near-zero idle cost:** API Gateway HTTP API, Lambda, SQS, DynamoDB On-Demand, S3, and Cloudflare Pages.
90+
- **Async architecture:** ingestion returns immediately while heavier report generation runs through SQS.
91+
- **Failure isolation:** DLQ, retry semantics, partial batch failure handling, and replay runbook.
92+
- **Private report access:** generated report links use per-project access tokens.
93+
- **Source-backed output:** recommendations include source URLs and diligence questions.
94+
- **Refresh pipeline:** scheduled source refresh Lambda verifies official URLs and stores catalog metadata in S3.
95+
- **Environment split:** separate Terraform backend configs and tfvars examples for dev, staging, and prod.
96+
- **Observability:** X-Ray tracing, API access logs, CloudWatch dashboard, alarms, and log metric filters.
97+
- **Provider-ready AI path:** deterministic dev mode plus OpenAI/Anthropic, OpenAI embeddings, and Pinecone Serverless hooks for staging/prod.
98+
- **CI:** GitHub Actions validates Terraform and Python handlers on every push.
99+
100+
## Architecture Highlights
101+
102+
Backend:
103+
104+
- Amazon API Gateway HTTP API
105+
- AWS Lambda for ingestion, processing, reporting, and source refresh
106+
- Amazon SQS with DLQ
107+
- Amazon DynamoDB `PAY_PER_REQUEST`
108+
- Amazon S3 for active source catalog and Terraform remote state
109+
- EventBridge scheduled source refresh
110+
- CloudWatch Logs, alarms, dashboard, and X-Ray tracing
111+
- Terraform-managed least-privilege IAM
112+
113+
Frontend:
114+
115+
- Static Cloudflare Pages site
116+
- Product landing page, intake form, report page, privacy, and terms
117+
- No always-on application server
118+
119+
AI/retrieval modes:
120+
121+
- Dev: deterministic source-backed evidence engine for predictable cost.
122+
- Staging/prod: configurable LLM and vector path using Secrets Manager ARNs, OpenAI-compatible embeddings, Pinecone Serverless, OpenAI, Anthropic, or generic JSON providers.
123+
124+
## Current Product Readiness
125+
126+
GrantStack is ready for credible paid-pilot conversations, not enterprise procurement.
127+
128+
What is live:
129+
130+
- Public landing page
131+
- Project intake
132+
- API Gateway/Lambda/SQS/DynamoDB backend
133+
- Private tokenized report endpoint
134+
- Cited incentive-screening report generation
135+
- Source refresh job
136+
- CloudWatch/X-Ray operations baseline
137+
- Terraform IaC with remote backend support
138+
- CI workflow
139+
140+
Known limits:
141+
142+
- The deployed dev environment uses `mock_external_calls = true`, so reports use the deterministic source-backed engine rather than paid external LLM/vector calls.
143+
- The source catalog is intentionally narrow and should be expanded before positioning this as a national incentive platform.
144+
- Authentication, billing, saved customer workspaces, and email delivery are not implemented yet.
145+
- Reports are first-pass decision-support memos and still require human validation before being used for legal, tax, accounting, or public-agency commitments.
146+
147+
## What A Reviewer Should Notice
148+
149+
This repo is designed to show practical full-stack cloud engineering judgment:
150+
151+
- Serverless architecture that scales to zero instead of relying on idle workers.
152+
- Terraform modules that manage real AWS resources, IAM, observability, backend state, and environment separation.
153+
- Python Lambda handlers with validation, idempotent processing, timeout-safe external-call structure, and clear failure handling.
154+
- A working buyer-facing frontend connected to a live backend.
155+
- CI and runbooks that make the project maintainable after the first demo.
156+
- Honest product boundaries instead of pretending the prototype is already an enterprise SaaS.
9157

10158
## Live Surfaces
11159

@@ -14,19 +162,6 @@ GrantStack is a serverless project-intake and grant-screening product for capex-
14162
- Submit endpoint: `POST https://rx967db2q9.execute-api.us-east-1.amazonaws.com/projects`
15163
- Private report endpoint: `GET /projects/{project_id}?token={access_token}`
16164

17-
## Current Readiness
18-
19-
This is now ready for credible paid-pilot conversations. The core workflow is live:
20-
21-
1. Static Cloudflare Pages landing page collects project specs.
22-
2. API Gateway accepts project submissions.
23-
3. Ingestion Lambda validates payloads, creates a project record, issues an access token, and queues work.
24-
4. SQS triggers the processor Lambda asynchronously.
25-
5. Processor Lambda screens the project against the active S3-backed incentive source catalog and writes the completed structured report to DynamoDB On-Demand.
26-
6. The report page polls the private report endpoint and renders the result with citations, diligence questions, and print/export controls.
27-
28-
Important limitation: the deployed dev backend is configured with `mock_external_calls = true`, which means it uses the source-backed evidence engine instead of paid external vector/LLM calls. Staging and production examples are included for OpenAI/Anthropic-compatible LLM calls, OpenAI embeddings, and Pinecone Serverless retrieval; activating them requires Secrets Manager ARNs and a live vector index.
29-
30165
## Repository Layout
31166

32167
- `grantstack-backend/ARCHITECTURE.md` - architecture blueprint and operational notes.
@@ -40,7 +175,7 @@ Important limitation: the deployed dev backend is configured with `mock_external
40175

41176
Prerequisites:
42177

43-
- AWS credentials with permissions to manage API Gateway, Lambda, SQS, DynamoDB, IAM, and CloudWatch.
178+
- AWS credentials with permissions to manage API Gateway, Lambda, SQS, DynamoDB, IAM, CloudWatch, S3, and EventBridge.
44179
- Terraform installed.
45180
- Python 3 available locally.
46181

@@ -73,57 +208,14 @@ cp env/prod.tfvars.example env/prod.tfvars
73208
terraform plan -var-file=env/prod.tfvars
74209
```
75210

76-
Validate:
77-
78-
```sh
79-
python3 -m py_compile ../lambda/ingest_handler.py ../lambda/processor_handler.py ../lambda/report_handler.py ../lambda/source_refresh_handler.py
80-
python3 -m unittest discover -s ../tests
81-
terraform fmt -check
82-
terraform validate
83-
../scripts/smoke_test.py --timeout 180 --interval 5
84-
```
85-
86-
## Operations
87-
88-
The backend now includes a formal CloudWatch/X-Ray baseline:
89-
90-
- Active X-Ray tracing for ingestion, processor, report, and source-refresh Lambdas.
91-
- Structured HTTP API access logs in `/aws/apigateway/grantstack-dev-http-api`.
92-
- CloudWatch dashboard output `cloudwatch_dashboard_name`, currently `grantstack-dev-operations`.
93-
- Lambda error alarms, queue-age alarms, DLQ alarm, processor failure log metric, and source-refresh error alarm.
94-
95-
The source catalog is stored in S3 and refreshed on an EventBridge schedule:
96-
97-
- S3 bucket output `source_catalog_bucket`.
98-
- Catalog key output `source_catalog_key`.
99-
- Refresh Lambda output `source_refresh_function_name`.
100-
- Default schedule: `rate(7 days)`.
101-
102-
The local JSON catalog remains the authoritative seed for curated program details; the refresh job verifies official source URLs, records status and content hashes, and writes the active catalog to S3 for the processor.
103-
104-
## AI Provider Modes
105-
106-
Dev keeps costs predictable with `mock_external_calls = true`. In that mode, reports are deterministic, cited, and source-backed.
107-
108-
For staging/prod, set `mock_external_calls = false` and provide:
109-
110-
- `llm_provider`: `openai`, `anthropic`, or `generic_json`.
111-
- `llm_api_endpoint`, `llm_api_key_secret_arn`, and `llm_model`.
112-
- `embedding_provider = "openai"`, `embedding_api_key_secret_arn`, and `embedding_model`.
113-
- `vector_db_provider = "pinecone"` with `vector_db_endpoint` and `vector_db_api_key_secret_arn`.
114-
115-
Terraform grants the processor Lambda `secretsmanager:GetSecretValue` only for the configured secret ARNs.
116-
117-
## Frontend Deploy
118-
119-
Prerequisites:
120-
121-
- Cloudflare Wrangler authenticated for the target account.
122-
123-
Deploy:
211+
## Validate
124212

125213
```sh
126-
npx wrangler pages deploy grantstack-landing --project-name=grantstack --branch=main --commit-dirty=true
214+
python3 -m py_compile grantstack-backend/lambda/ingest_handler.py grantstack-backend/lambda/processor_handler.py grantstack-backend/lambda/report_handler.py grantstack-backend/lambda/source_refresh_handler.py
215+
python3 -m unittest discover -s grantstack-backend/tests
216+
terraform -chdir=grantstack-backend/terraform fmt -check -recursive
217+
terraform -chdir=grantstack-backend/terraform validate
218+
grantstack-backend/scripts/smoke_test.py --timeout 180 --interval 5
127219
```
128220

129221
## API Contract
@@ -161,18 +253,18 @@ The `access_token` is required to read the private report. A missing token retur
161253
The infrastructure is designed for near-zero idle cost:
162254

163255
- API Gateway HTTP API charges only by request.
164-
- API Gateway stage throttling is enabled to reduce accidental or abusive request bursts.
256+
- API Gateway stage throttling reduces accidental or abusive request bursts.
165257
- Lambda charges only during execution.
166258
- SQS charges by request.
167259
- DynamoDB uses `PAY_PER_REQUEST`.
168260
- DynamoDB TTL is enabled on `expires_at` so pilot data can age out automatically.
169261
- CloudWatch Logs, dashboards, alarms, X-Ray traces, S3 catalog storage, and remote Terraform state may create small charges as usage grows.
170262
- Cloudflare Pages static hosting has no always-on application server.
171263

172-
## Next Paid-Product Blockers
264+
## Next Product Steps
173265

174-
- Expand the incentive catalog beyond the initial GA, NC, and federal source set.
175-
- Add customer identity, saved reports, and payment gating for repeat usage.
176-
- Add email delivery for completed report links.
177-
- Add analytics for activation and conversion.
178-
- Add a human-review workflow or disclaimer if reports are sold as decision-support memos.
266+
- Expand the source catalog across more states and federal programs.
267+
- Add customer auth, saved reports, and payment gating.
268+
- Add email delivery when a report completes.
269+
- Add activation/conversion analytics.
270+
- Add a human-review queue for paid advisory workflows.

0 commit comments

Comments
 (0)