How csantiagu/ledgerlite works
LedgerLite is a self-hosted bookkeeping app for small UK businesses. Owners and accountants use the browser app to manage invoices, bills, bank imports and reconciliation, then review reports and export VAT-quarter or year-end records. The Worker API handles requests and persists bookkeeping data in D1, with R2 for documents and backups. The graph preserves major documented features, but several routes and services are unsampled; their detailed links are omitted where the excerpts do not establish them.
Main entry points: index.ts Request router · invoices.ts Invoices · api.ts API client · reports.ts Reports and exports
Components 23
Browser app
- Bookkeeping UI
frontend/src/app - Bank review UI
frontend/src/app/transactions/ReviewTab.tsx - Invoice UI
frontend/src/app/invoices/view/page.tsx - API client
frontend/src/lib/api.ts
Worker API
- Request router
worker/src/index.ts - Sign-in and setup
worker/src/routes/auth.ts
Bookkeeping workflows
- Invoices
worker/src/routes/invoices.ts - Supplier bills
worker/src/routes/bills.ts - Statement imports
worker/src/routes/bankImports.ts - Bank transactions
worker/src/routes/transactions.ts - Reconciliation
worker/src/routes/transactionMatches.ts - Posting payments
worker/src/services/bankReview.ts - Reports and exports
worker/src/routes/reports.ts - Accountant exports
worker/src/services/accountantExport.ts - Year-end packs
worker/src/services/yearEndExport.ts
Security and storage
- Session security
worker/src/middleware/auth.ts - Role permissions
worker/src/middleware/rbac.ts - Audit history
worker/src/middleware/audit.ts - Document handling
worker/src/services/files.ts - Backups
worker/src/services/backup.ts - D1 database
- R2 storage
Other components
- Owner / accountant
Connections 25
- Owner / accountant → Bookkeeping UI: uses
README.md - Bookkeeping UI → API client: requests data
- Bank review UI → API client: submits matches
frontend/src/app/transactions/ReviewTab.tsx - Invoice UI → API client: manages invoice
- API client → Request router: calls API
README.md - Request router → Sign-in and setup: routes requests
worker/src/index.ts - Request router → Invoices: routes requests
worker/src/index.ts - Request router → Supplier bills: routes requests
worker/src/index.ts - Request router → Statement imports: routes requests
worker/src/index.ts - Request router → Bank transactions: routes requests
worker/src/index.ts - Request router → Reconciliation: routes requests
worker/src/index.ts - Request router → Reports and exports: routes requests
worker/src/index.ts - Request router → Session security: checks configuration
worker/src/index.ts - Sign-in and setup → Session security: issues sessions
worker/src/routes/auth.ts - Invoices → Audit history: records changes
worker/src/routes/invoices.ts - Invoices → Document handling: checks uploads
worker/src/routes/invoices.ts - Invoices → R2 storage: stores PDFs
worker/src/routes/invoices.ts - Reconciliation → Posting payments: posts matches
- Statement imports → Bank transactions: imports lines
- Request router → D1 database: reads and writes
README.md - Request router → R2 storage: stores files
README.md - Reports and exports → Accountant exports: exports records
- Reports and exports → Year-end packs: builds year-end pack
- Backups → D1 database: backs up database
README.md - Backups → R2 storage: backs up files
README.md