L.Edge.R¶
L.Edge.R is a modern, multi-tenant accounting system built with Clean Architecture, Cloudflare Workers, and React.
Architecture¶
Follows Clean Architecture principles — business logic remains independent of frameworks, UI, and databases. Dependencies point inward: outer layers import inner ones, never the reverse.
| Layer | Contents |
|---|---|
domain/ |
Pure business logic: Entities, Value Objects. Zero external imports. |
application/ |
Orchestration: Use Cases, Ports (interfaces). Imports from domain/ only. |
infrastructure/ |
Implementation details: DB Repositories, Hono Routes, Adapters. All I/O lives here. |
Tech Stack¶
| Concern | Technology |
|---|---|
| Backend runtime | Cloudflare Workers |
| Backend framework | Hono |
| Database | SQLite (D1 / local) |
| Frontend | React (TypeScript) + Vite |
| Language | TypeScript (strict) |
Repository Structure¶
.
├── backend/
│ ├── src/
│ │ ├── application/ # Use Cases & Ports
│ │ ├── domain/ # Entities & Value Objects (Money, Quantity)
│ │ ├── infrastructure/ # DB Repositories, Hono Routes, Container
│ │ └── index.ts # Entry point
│ ├── migrations/ # SQL Schema
│ └── docs/ # OpenAPI/Swagger Spec
├── frontend/
│ ├── src/
│ │ ├── api/ # API Client
│ │ ├── components/ # UI Library
│ │ └── pages/ # Dashboard, Invoices, Clients
├── anubis/ # Identity / Auth module (see Auth docs)
└── openspec/ # Specification-driven development artifacts
API Resources¶
The API is fully documented using OpenAPI 3.0 (backend/docs/openapi.yaml).
| Resource | Description |
|---|---|
/companies |
Company settings & management |
/contacts |
Clients and Suppliers |
/invoices |
Invoicing lifecycle (Lines, Status, Totals) |
/accounts |
Chart of Accounts (CoA) |
/payments |
Transaction processing & Invoice allocation |
/journal |
Double-entry accounting records |
Local Setup¶
Prerequisites¶
- Node.js v20+
- Wrangler CLI:
npm install -g wrangler
Install¶
npm install
cd backend && npm install
cd ../frontend && npm install
Backend¶
cd backend
npm run migrate:sqlite
npm run dev:local
Frontend¶
cd frontend
npm run dev
Testing¶
cd backend
npm test
License¶
MIT