1
0
Fork 0
forked from aiolabs/libra
libra/description.md
Padreug b2b2c109a4 Clean up awkward "the Libra" phrasing left over from rename
Replaces entity-sense references to "the Libra" with "the
organization"/"the collective" where Libra was being used as a
stand-in for the original "Castle" entity, and drops the redundant
"(like cooperatives)" parenthetical in DOCUMENTATION.md. Also swaps
the 🏰 emoji in the import helper for ⚖️.

Closes #12

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 08:37:30 +02:00

2.4 KiB

Libra

A comprehensive double-entry accounting system for collective projects, designed specifically for LNbits.

Features

  • Double-Entry Bookkeeping: Full accounting system with debits and credits
  • Chart of Accounts: Pre-configured accounts for Assets, Liabilities, Equity, Revenue, and Expenses
  • User Expense Tracking: Members can record out-of-pocket expenses as either:
    • Liabilities: Libra owes them money (reimbursable)
    • Equity: Their contribution to the collective
  • Accounts Receivable: Track what users owe the organization (e.g., accommodation fees)
  • Revenue Tracking: Record revenue received by the collective
  • User Balance Dashboard: Each user sees their balance with the organization
  • Lightning Integration: Generate invoices for outstanding balances
  • Transaction History: View all accounting entries and transactions

Use Cases

1. User Pays Expense Out of Pocket

When a member buys supplies for the collective:

  • They can choose to be reimbursed (Liability)
  • Or contribute it as equity (Equity)

2. Accounts Receivable

When someone stays with the collective and owes money:

  • Admin creates an AR entry (e.g., "5 nights @ 10€/night = 50€")
  • User sees they owe 50€ in their dashboard
  • They can generate an invoice to pay it off

3. Revenue Recording

When the organization receives revenue:

  • Record revenue with the payment method (Cash, Lightning, Bank)
  • Properly categorized in the accounting system

Technical Details

  • Built on PostgreSQL/SQLite with full transaction support
  • RESTful API for all operations
  • Validates that journal entries balance before saving
  • Automatic user-specific account creation
  • Indexed for performance on large datasets

API Endpoints

User Endpoints (Invoice Key)

  • GET /api/v1/balance - Get your balance
  • POST /api/v1/entries/expense - Add an expense
  • GET /api/v1/entries/user - Get your transactions
  • POST /api/v1/pay-balance - Record a payment

Admin Endpoints (Admin Key)

  • POST /api/v1/entries/receivable - Create accounts receivable
  • POST /api/v1/entries/revenue - Record revenue
  • POST /api/v1/pay-user - Pay a user
  • POST /api/v1/accounts - Create new accounts
  • GET /api/v1/entries - View all entries

Getting Started

  1. Enable the Libra extension in LNbits
  2. Visit the Libra page to see your dashboard
  3. Start tracking expenses and balances!

The extension automatically creates a default chart of accounts on first run.