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
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证正在加载完整 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.查看完整 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