Busabase
Busabase is an open-source (MIT) database and workspace for AI agents — data, docs, skills, and apps in one place. Run it locally, self-host it inside your network, or use Busabase Cloud, and turn age
AI-powered document intelligence platform that extracts structured information from invoices using OCR and Large Language Models.
DataPython · TypeScriptGitHub @Priyanshu-Rana7OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Loading the full README. The saved excerpt is shown below.
DocuMind AI is a modular document-intelligence MVP for extracting structured data from invoices. It combines OCR, an LLM provider, validation, persistence, and a React review interface.Read the full README ↗DocuMind AI is a modular document-intelligence MVP for extracting structured data from invoices. It combines OCR, an LLM provider, validation, persistence, and a React review interface.
The current production workflow supports:
Future document types can be added through the BaseDocumentProcessor interface without changing the shared upload, OCR, persistence, or API orchestration.
React + TypeScript frontend
|
REST API
|
FastAPI
|
InvoiceService
/ | \
Storage OCR Document processor
| | |
Local EasyOCR LLM provider
storage |
Repository + SQLAlchemy
|
SQLite or PostgreSQL
The backend uses dependency injection and provider abstractions for storage, OCR, LLM, and document processors. Alembic is the schema migration authority.
EasyOCR may download model files the first time it starts. The local launcher expects a backend virtual environment at backend/venv.
.env fileDocker is optional for local development, but it runs the production-style PostgreSQL, FastAPI, and Nginx stack.
Copy the example environment file:
Copy-Item .env.example .env
For local development, configure at least:
LLM_PROVIDER=openrouter
OPENROUTER_API_KEY=your-openrouter-key
OPENROUTER_MODEL=google/gemini-2.5-flash
POPPLER_PATH=C:\path\to\poppler\Library\bin
Use explicit mock mode only for deterministic local tests:
LLM_PROVIDER=mock
OCR_PROVIDER=mock
When LLM_PROVIDER=openrouter is selected without an API key, the backend returns a configuration error. It does not silently fabricate invoice data.
Never commit .env, API keys, database passwords, or other secrets.
From the project root:
.\start-documind.bat
The launcher:
http://localhost:8000.http://localhost:5173.To run the services manually:
Set-Location backend
.\venv\Scripts\python.exe -m alembic upgrade head
.\venv\Scripts\python.exe -m uvicorn app.main:app --reload
In another terminal:
Set-Location frontend
npm install
npm run dev
Useful local URLs:
http://localhost:5173http://localhost:8000/api/v1/healthhttp://localhost:8000/docsCreate .env, then validate and start the stack:
docker compose config
docker compose up --build
The application is served at http://localhost by Nginx. Compose starts:
/api reverse proxy from Nginx to FastAPIUseful commands:
docker compose ps
docker compose logs backend
docker compose logs frontend
docker compose down
Do not use docker compose down -v unless you intentionally want to delete the database and uploaded-file volumes.
The recommended low-traffic showcase setup is:
Vercel -> React frontend
Render -> FastAPI Docker web service
Neon/Supabase -> PostgreSQL
OpenRouter -> LLM extraction
The repository includes render.yaml as a starting point for a Render Docker service. In Render, set:
DATABASE_URL to the managed PostgreSQL connection string.OPENROUTER_API_KEY to the backend-only OpenRouter key.CORS_ORIGINS to a JSON array containing the Vercel deployment origin.OCR_PROVIDER=tesseract is recommended for the free Render showcase instance.OCR_PROVIDER=easyocr remains available for local environments with sufficient memory.WEB_CONCURRENCY=1 for the free instance.For Vercel:
frontend.npm run build with output directory dist.VITE_API_BASE_URL to the Render backend origin followed by /api/v1, for example https://documind-api.onrender.com/api/v1.Do not expose OPENROUTER_API_KEY or database credentials in Vercel variables or VITE_* variables.
Render's default filesystem is ephemeral. The Render showcase configuration uses a private Supabase Storage bucket so uploaded source files persist across restarts and redeploys. Local storage remains available for development.
For Render, configure these backend-only variables:
STORAGE_PROVIDER=supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=<server-only-secret>
SUPABASE_STORAGE_BUCKET=invoices
Keep the bucket private and never expose SUPABASE_SERVICE_ROLE_KEY to Vercel or the browser.
Free Render instances can sleep and EasyOCR can take time to initialize. The first request after inactivity may be slow.
The backend includes lightweight single-instance protections:
MAX_UPLOAD_SIZE_MB.These limits are intended for a low-volume showcase. They are not a distributed rate limiter and should be replaced with provider-level rate limiting before public or multi-instance use.
POST /api/v1/invoices/upload
Uploads and stores an invoice without extraction.
POST /api/v1/invoices/process
Uploads, runs OCR, extracts structured data, validates arithmetic, and returns the invoice.
POST /api/v1/invoices/{invoice_id}/extract
POST /api/v1/invoices/{invoice_id}/retry
PUT /api/v1/invoices/{invoice_id}/extracted-data
The payload uses the ExtractedInvoiceData schema. The backend recomputes validation warnings and preserves the original AI confidence score.
GET /api/v1/invoices?skip=0&limit=20&status=EXTRACTED&search=samsung
Search covers filename, OCR text, and serialized extracted metadata before pagination.
GET /api/v1/invoices/{invoice_id}/export?format=csv
GET /api/v1/invoices/{invoice_id}/export?format=xlsx
Only successfully extracted invoices can be exported.
DELETE /api/v1/invoices/{invoice_id}
Permanently removes the invoice record and its stored source file.
Run the backend suite:
Set-Location backend
.\venv\Scripts\python.exe -m pytest -q
Run frontend tests:
Set-Location frontend
npm test
Build the frontend:
npm run build
The backend tests use isolated SQLite fixtures and explicit mock providers, so they do not require an API key or network access. Regression fixtures cover sanitized Samsung and Acme invoice samples.
API errors use a consistent envelope:
{
"error_code": "LLM_TIMEOUT",
"message": "The AI provider request timed out.",
"extra": {},
"request_id": "..."
}
Every request receives or preserves an X-Request-ID response header. The same identifier is included in structured logs and error responses.
Transient OCR and LLM extraction failures retry with bounded exponential backoff. Provider configuration errors are surfaced immediately and are not retried.
backend/
app/
api/ FastAPI routes and dependencies
core/ settings, logging, prompts, exceptions
db/ SQLAlchemy session and metadata
models/ database models
repositories/ persistence operations
schemas/ request and response schemas
services/
processors/ document processor interfaces and implementations
ocr/ OCR providers
llm/ LLM providers
storage/ storage providers
validators/ upload and extraction validation
alembic/ database migrations
tests/ API, service, provider, repository, and regression tests
frontend/
src/
api/ typed API client
components/ reusable UI components
context/ theme and toast providers
hooks/ React Query hooks
pages/ upload, viewer, history, settings, and landing pages
types/ shared frontend types
tests/ Vitest API-client tests