155 lines
3.6 KiB
Markdown
155 lines
3.6 KiB
Markdown
# LedgerDock
|
|
|
|
LedgerDock is a self-hosted document management system (DMS) for ingesting, processing, organizing, and searching files.
|
|
|
|
## Core Capabilities
|
|
|
|
- Drag and drop upload from anywhere in the UI
|
|
- File and folder upload with path preservation
|
|
- Asynchronous extraction and OCR for PDF, images, DOCX, XLSX, TXT, and ZIP
|
|
- Metadata and full-text search
|
|
- Routing suggestions based on previous decisions
|
|
- Original file download and extracted markdown export
|
|
|
|
## Technology Stack
|
|
|
|
- Backend: FastAPI, SQLAlchemy, RQ worker (`backend/`)
|
|
- Frontend: React, Vite, TypeScript (`frontend/`)
|
|
- Infrastructure: PostgreSQL, Redis, Typesense (`docker-compose.yml`)
|
|
|
|
## Runtime Services
|
|
|
|
The default `docker compose` stack includes:
|
|
|
|
- `frontend` - React UI (`http://localhost:5173`)
|
|
- `api` - FastAPI backend (`http://localhost:8000`, docs at `/docs`)
|
|
- `worker` - background processing jobs
|
|
- `db` - PostgreSQL (`localhost:5432`)
|
|
- `redis` - queue backend (`localhost:6379`)
|
|
- `typesense` - search index (`localhost:8108`)
|
|
|
|
## Requirements
|
|
|
|
- Docker Engine
|
|
- Docker Compose plugin
|
|
- Internet access for first-time image build
|
|
|
|
## Quick Start
|
|
|
|
From repository root:
|
|
|
|
```bash
|
|
docker compose up --build -d
|
|
```
|
|
|
|
Open:
|
|
|
|
- Frontend: `http://localhost:5173`
|
|
- API docs: `http://localhost:8000/docs`
|
|
- Health: `http://localhost:8000/api/v1/health`
|
|
|
|
Stop the stack:
|
|
|
|
```bash
|
|
docker compose down
|
|
```
|
|
|
|
## Common Operations
|
|
|
|
Start or rebuild:
|
|
|
|
```bash
|
|
docker compose up --build -d
|
|
```
|
|
|
|
Stop:
|
|
|
|
```bash
|
|
docker compose down
|
|
```
|
|
|
|
Tail logs:
|
|
|
|
```bash
|
|
docker compose logs -f
|
|
```
|
|
|
|
Tail API and worker logs only:
|
|
|
|
```bash
|
|
docker compose logs -f api worker
|
|
```
|
|
|
|
Reset all runtime data (destructive):
|
|
|
|
```bash
|
|
docker compose down -v
|
|
```
|
|
|
|
## Frontend-Only Local Workflow
|
|
|
|
If backend services are already running, you can run frontend tooling locally:
|
|
|
|
```bash
|
|
cd frontend && npm run dev
|
|
cd frontend && npm run build
|
|
cd frontend && npm run preview
|
|
```
|
|
|
|
`npm run preview` serves the built app on port `4173`.
|
|
|
|
## Configuration
|
|
|
|
Main runtime variables are defined in `docker-compose.yml`:
|
|
|
|
- API and worker: `DATABASE_URL`, `REDIS_URL`, `STORAGE_ROOT`, `PUBLIC_BASE_URL`, `CORS_ORIGINS`, `TYPESENSE_*`
|
|
- Frontend: `VITE_API_BASE`
|
|
|
|
Application settings saved from the UI persist at:
|
|
|
|
- `<STORAGE_ROOT>/settings.json` (inside the storage volume)
|
|
|
|
Settings endpoints:
|
|
|
|
- `GET/PUT /api/v1/settings`
|
|
- `POST /api/v1/settings/reset`
|
|
- `POST /api/v1/settings/handwriting`
|
|
- `POST /api/v1/processing/logs/trim`
|
|
|
|
Note: the compose file currently includes host-specific URL values (for example `PUBLIC_BASE_URL` and `VITE_API_BASE`). Adjust these for your environment when needed.
|
|
|
|
## Data Persistence
|
|
|
|
Docker named volumes used by the stack:
|
|
|
|
- `db-data`
|
|
- `redis-data`
|
|
- `dcm-storage`
|
|
- `typesense-data`
|
|
|
|
## Validation Checklist
|
|
|
|
After setup or config changes, verify:
|
|
|
|
- `GET /api/v1/health` returns `{"status":"ok"}`
|
|
- Upload and processing complete successfully
|
|
- Search returns expected results
|
|
- Preview and download work for uploaded documents
|
|
- `docker compose logs -f api worker` has no failures
|
|
|
|
## Repository Layout
|
|
|
|
- `backend/` - FastAPI API, services, models, worker
|
|
- `frontend/` - React application
|
|
- `doc/` - technical documentation for architecture, API, data model, and operations
|
|
- `docker-compose.yml` - local runtime topology
|
|
|
|
## Documentation Index
|
|
|
|
- `doc/README.md` - technical documentation entrypoint
|
|
- `doc/architecture-overview.md` - service and runtime architecture
|
|
- `doc/api-contract.md` - endpoint and payload contract
|
|
- `doc/data-model-reference.md` - persistence model reference
|
|
- `doc/operations-and-configuration.md` - runtime operations and configuration
|
|
- `doc/frontend-design-foundation.md` - frontend design rules
|