A Node.js-based invoice processing system developed by Wondel.ai.
This project provides automated invoice processing capabilities, helping businesses streamline their invoice management workflow. It follows the "inbox" concept where new invoices are placed in a designated inbox folder and automatically processed, organized, and moved to their appropriate destination folders.
- Invoice processing automation
- PDF document handling
- Batch processing support via shell script
- Inbox-based workflow for easy invoice management
npm install
The following environment variables must be set before running the application:
ANTHROPIC_API_KEY
- Your Anthropic API key for Claude AISOURCE_DIR
- Directory containing the PDF invoices to process (your "Inbox" folder)BASE_TARGET_DIR
- Base directory where processed invoices will be organized
You can set these variables in your shell:
export ANTHROPIC_API_KEY='your-api-key'
export SOURCE_DIR='/path/to/inbox/directory'
export BASE_TARGET_DIR='/path/to/target/directory'
The application uses an "inbox" system for processing invoices:
- Place new invoice PDFs in the
SOURCE_DIR
(Inbox folder) - Run the processing script
- Invoices are automatically:
- Analyzed for relevant information
- Renamed with a standardized format
- Moved to appropriate date-based folders in
BASE_TARGET_DIR
- Original files are removed from the inbox
This workflow allows you to:
- Quickly dump new invoices into a single folder
- Process them in batch
- Keep your inbox clean and organized
- Maintain a structured archive of processed invoices
You can process invoices using either the Node.js script directly or the provided shell script:
# Using Node.js directly
node invoice-processor.js
# Using the shell script
./process-invoices.sh
- The system scans the
SOURCE_DIR
(Inbox) for PDF files - For each PDF, it:
- Extracts invoice data using Claude AI
- Creates a target directory based on invoice date (YYYY-MM format)
- Renames the file using the pattern:
CompanyName Date InvoiceNumber.pdf
- Moves the file from inbox to the appropriate directory
Processed invoices are organized in the following structure:
BASE_TARGET_DIR/
├── Inbox/ # Your SOURCE_DIR - where you put new invoices
│ └── ... new invoices ...
├── 2024-01/ # Processed invoices organized by month
│ ├── Company1 2024-01-15 INV001.pdf
│ └── Company2 2024-01-20 INV002.pdf
├── 2024-02/
│ └── Company3 2024-02-01 INV003.pdf
└── ...
invoice-processor.js
- Main processing logicprocess-invoices.sh
- Shell script for batch processinganthropic-pdf-example.ts
- PDF processing example
The project uses various Node.js packages. See package.json
for the complete list of dependencies.
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License - see the LICENSE file for details.
For commercial licensing inquiries, please contact: Michal Jaskolski @ Wondel.ai
Michal Jaskolski @ Wondel.ai