2026-03-18 18:26:24 +08:00
2026-03-18 18:26:24 +08:00
2026-03-18 18:26:24 +08:00
2026-03-18 18:26:24 +08:00
2026-03-18 18:26:24 +08:00
2026-03-18 18:26:24 +08:00
2026-03-18 18:26:24 +08:00
2026-03-18 18:26:24 +08:00
2026-03-18 18:26:24 +08:00
2026-03-18 18:26:24 +08:00

NGO Toolkit Lab

AI-powered grant writing tools for NGOs. 4 tools: Logframe Generator, Funder Rewriter, SMART Indicators, Theory of Change.

Setup

# Install dependencies
bun install

# Copy env and fill in values
cp .env.example .env

# Run database migration
bun run db:migrate

# Start dev server
bun dev

Environment Variables

See .env.example for all required variables:

  • DATABASE_URL — PostgreSQL connection string
  • OPENAI_API_KEY — OpenAI API key
  • AUTH0_* — Auth0 configuration for admin routes
  • LEMONSQUEEZY_* — Payment processing

Database

Schema is in lib/db/schema.sql. Run manually or use the migration script:

psql $DATABASE_URL < lib/db/schema.sql
# or
bun run db:migrate

Docker

docker compose up -d

Routes

Route Description
/ Hub — 4 tool cards
/logframe Logframe Generator
/funder-rewriter Funder Rewriter
/smart-indicators SMART Indicators
/theory-of-change Theory of Change
/admin Dashboard (Auth0 protected)
/admin/config Configuration editor
/admin/leads Leads table

API Routes

  • POST /api/[tool]/generate-draft — Generate initial draft
  • POST /api/[tool]/improve-section — Improve a section (paid)
  • POST /api/[tool]/validate — Quality assessment (paid)
  • POST /api/[tool]/finalize — Produce final version (paid)
  • POST /api/payment/create-checkout — Create LemonSqueezy checkout
  • POST /api/payment/webhook — LemonSqueezy webhook handler
  • GET/POST /api/admin/config — Admin config management
  • GET /api/admin/leads — Paginated leads
  • GET /api/admin/metrics — Dashboard metrics
  • POST /api/export/[format] — Export (docx/excel/pdf/copy)
S
Description
No description provided
Readme 4.2 MiB
Languages
TypeScript 98.6%
JavaScript 0.7%
Dockerfile 0.4%
CSS 0.3%