Skip to content

choucaleb602-commits/parseflow

 
 

Repository files navigation

ParseFlow

ParseFlow is an AI-powered document automation app for uploading invoices, extracting structured data, and sending the results into workflows such as CSV downloads, Google Sheets, webhooks, and billing-aware usage limits.

The project is built with Next.js App Router, Supabase, Gemini, Stripe, and Google Sheets OAuth.

Features

  • Upload PDF and image invoices
  • Extract invoice fields with Gemini
  • Track document status from upload to parsed result
  • Export parsed invoice data to CSV
  • Export parsed invoice data to Google Sheets
  • Add webhook integrations for downstream automation
  • Stripe checkout, billing portal, and usage limits
  • Supabase-backed auth, storage, documents, organizations, and integrations

Tech Stack

  • Next.js 16 App Router
  • React 19
  • TypeScript
  • Supabase Auth, Database, and Storage
  • Google Gemini API
  • Stripe Checkout, Billing Portal, and Webhooks
  • Google Sheets API
  • Sonner toast notifications

Getting Started

Prerequisites

Install:

  • Node.js 20 or newer
  • npm
  • A Supabase project
  • A Google Gemini API key
  • A Stripe account
  • A Google Cloud project with Google Sheets API enabled

Installation

Clone the repository and install dependencies:

git clone https://github.com/YOUR_USERNAME/parseflow.git
cd parseflow
npm install

Create your local environment file:

cp .env.example .env.local

Fill in the required values:

NEXT_PUBLIC_APP_URL=http://localhost:3000

NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=

GOOGLE_GEMINI_API_KEY=

STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
STRIPE_PRO_PRICE_ID=

GOOGLE_SHEETS_CLIENT_ID=
GOOGLE_SHEETS_CLIENT_SECRET=

Run the development server:

npm run dev

Open http://localhost:3000.

Supabase Setup

The Supabase SQL files live in supabase. Apply the schema files in your Supabase SQL editor or through your preferred migration workflow.

At minimum, configure:

  • Auth
  • Database tables from the SQL files
  • Storage bucket for uploaded documents
  • Row-level security policies appropriate for your deployment

Never expose SUPABASE_SERVICE_ROLE_KEY in client-side code. It should only be used in server routes and backend helpers.

Stripe Setup

Create a Stripe product and recurring price for the Pro plan, then set:

STRIPE_PRO_PRICE_ID=

For local webhook testing, use the Stripe CLI:

stripe listen --forward-to localhost:3000/api/stripe/webhook

Copy the webhook signing secret into:

STRIPE_WEBHOOK_SECRET=

Google Sheets Setup

In Google Cloud Console:

  1. Enable the Google Sheets API.
  2. Create OAuth credentials.
  3. Add this redirect URI:
http://localhost:3000/api/integrations/sheets/callback

For production, also add your deployed callback URL.

Development

Useful commands:

npm run dev
npm run lint
npm run build

This project uses a newer Next.js version with breaking changes. Before changing Next.js-specific APIs, check the local docs in:

node_modules/next/dist/docs/

Contributing

Contributions are welcome. Good places to start include:

  • Documentation improvements
  • UI polish
  • Bug fixes
  • Tests
  • Supabase setup improvements
  • Stripe or Google Sheets integration improvements

Please read CONTRIBUTING.md before opening a pull request.

Security

Do not commit secrets, .env.local, private keys, service-role keys, webhook secrets, or OAuth credentials.

If you find a security issue, please do not open a public issue with exploit details. Contact the maintainers privately instead.

License

This project is licensed under the MIT License. See LICENSE.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 89.3%
  • PLpgSQL 10.4%
  • Other 0.3%