Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

EasyExtract

Last updated: 2026-03-18 20:19:29 MDT

Turn PDFs and document images into structured data using a Cloudflare Worker.

What You Need

  • A Cloudflare account
  • Node.js 18+
  • This repo cloned locally

First Deploy (Cloudflare Beginner Path)

  1. Install dependencies
npm install
  1. Log in to Cloudflare
npx wrangler login
  1. Create your D1 database (one time)
npx wrangler d1 create easyextract-db
  1. Update wrangler.toml
  • Set database_id to the ID returned by the create command.
  • Keep binding = "DB".
  1. Create required secrets (one time)
npx wrangler secret put OPENAI_API_KEY
npx wrangler secret put GCP_SA_KEY
npx wrangler secret put GCP_PROJECT_ID
  1. Deploy safely
npm run deploy:safe

That command runs typecheck, verifies required secrets, deploys, and checks /api/health.

Local Development

  1. Add local vars in .dev.vars
OPENAI_API_KEY=...
GCP_SA_KEY={...json...}
GCP_PROJECT_ID=...
  1. Start local server
npm run dev

Daily Commands

npm run dev          # local app
npm run typecheck    # TypeScript check
npm run deploy:safe  # production deploy with health validation

One-Time Migration (Existing Databases)

If your database was created before bucket template defaults were removed, run this once first:

npm run db:migrate:remove-bucket-template
npm run db:migrate

This preserves existing bucket rows and removes the legacy bucket-level template_id column.

Troubleshooting

  • Missing required secret: run npx wrangler secret put <NAME>
  • no such table: ensure your D1 DB is created and database_id is correct in wrangler.toml
  • Deploy health failure: open /api/health and confirm all services are true

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages