2026-03-10 08:17:45 -04:00
# Echo OCR
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
OCR-powered response card scanner and management tool for Echo Life Church.
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
Scans front/back of paper response cards (PDF or images), extracts structured data using a local Ollama vision model, stores results in PostgreSQL, and serves them through a modern filterable table UI.
## Stack
- **Next.js 15** (App Router) + **Tailwind CSS v4** + **shadcn/ui**
- **TanStack Table** for data tables with filtering, sorting, pagination
- **Prisma** + **PostgreSQL** for data storage
- **Ollama** (local LLM) for OCR via vision models (LLaVA 7B recommended)
- **MinIO** (S3-compatible) for PDF/image storage
- **Docker** for deployment via Coolify
## Local Development
### Prerequisites
- Node.js 18+
- Docker + Docker Compose (for PostgreSQL + MinIO)
- Ollama running locally with a vision model (`ollama pull llava:7b`)
- GraphicsMagick (`brew install graphicsmagick`) for PDF-to-image conversion
### Setup
2026-03-09 16:31:21 -04:00
```bash
2026-03-10 08:17:45 -04:00
# Install dependencies
npm install
# Start local PostgreSQL + MinIO
docker compose up -d postgres minio
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
# Create MinIO bucket (visit http://localhost:9001, login minioadmin/minioadmin)
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
# Push database schema
npm run db:push
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
# Start dev server
npm run dev
```
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
Open [http://localhost:3000 ](http://localhost:3000 ).
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
### Environment Variables
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
Copy `.env.example` to `.env` and configure:
```bash
cp .env.example .env
```
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
## Deployment (Coolify)
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
See the deployment section in the project plan for step-by-step Coolify setup instructions including PostgreSQL, MinIO bucket creation, Ollama configuration, and Traefik routing.
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
## API Endpoints
2026-03-09 16:31:21 -04:00
2026-03-10 08:17:45 -04:00
| Method | Path | Description |
|--------|------|-------------|
| GET | `/api/cards` | List cards (filters, pagination, search) |
| POST | `/api/cards` | Create a card |
| GET | `/api/cards/[id]` | Get card with presigned image URLs |
| PUT | `/api/cards/[id]` | Update card fields |
| DELETE | `/api/cards/[id]` | Delete card and images |
| POST | `/api/cards/[id]/export` | Mark card as exported |
| POST | `/api/upload` | Upload PDF/images for OCR |
| GET | `/api/jobs` | List processing jobs |
| GET | `/api/stats` | Card count statistics |
| GET/PUT | `/api/settings` | App settings |
| POST | `/api/watch` | Start/stop folder monitoring |
| GET | `/api/images/[...path]` | Proxy images from MinIO |