Skip to content

Latest commit

 

History

History
74 lines (63 loc) · 2.64 KB

File metadata and controls

74 lines (63 loc) · 2.64 KB

Lightning Liquidity Intelligence (LLI)

Overview

Multi-tenant SaaS platform that connects to Lightning Network nodes (LND) via a local agent and analyzes channel liquidity, routing performance, and rebalance opportunities.

Current State

Fully functional MVP with:

  • Multi-tenant authentication (JWT)
  • Node registration with agent tokens
  • Agent ingestion API for Lightning node data
  • Liquidity scoring engine
  • Rebalance planner
  • Dashboard with overview, channels, opportunities
  • Alerts engine
  • React frontend with all pages

Tech Stack

  • Backend: Java 19 (GraalVM), Spring Boot 3.2.2, JPA/Hibernate
  • Frontend: React (Vite), react-router-dom
  • Database: PostgreSQL (Replit built-in)
  • Auth: JWT with BCrypt password hashing
  • API Docs: SpringDoc OpenAPI (Swagger UI at /swagger-ui.html)

Project Architecture

backend/
  src/main/java/com/lli/
    config/       - SecurityConfig, DataSeeder, GlobalExceptionHandler
    controller/   - REST controllers (Auth, Node, Ingest, Dashboard, Rebalance, Alert)
    dto/          - Request/Response data transfer objects (records)
    model/        - JPA entities (Account, User, Membership, Node, Channel, snapshots, etc.)
    repository/   - Spring Data JPA repositories
    scheduler/    - Scoring scheduler (hourly)
    security/     - JWT utilities, auth filter, UserPrincipal
    service/      - Business logic (Auth, Node, Ingest, Dashboard, Scoring, Alert, Rebalance)
  src/main/resources/
    application.properties

frontend/
  src/
    api.js        - API client with JWT auth
    App.jsx       - Main app with routing
    App.css       - Dark theme styles
    pages/        - Login, Nodes, NodeDashboard, Channels, Opportunities, RebalancePlans, Alerts

Database Tables

accounts, users, memberships, nodes, node_snapshots, channels, channel_snapshots, rebalance_plans, rebalance_plan_items, alerts, audit_logs

How to Run

  1. Backend: cd backend && mvn spring-boot:run
  2. Frontend: cd frontend && npm run dev
  3. Backend runs on port 8080, frontend on port 5000 (proxies API to backend)

Demo Credentials

  • Email: demo@lli.com
  • Password: demo123
  • Demo agent token: demo-agent-token

Key API Endpoints

  • POST /api/auth/register, /api/auth/login
  • GET/POST /api/nodes
  • POST /api/nodes/{id}/generate-token
  • POST /api/ingest/v1/node/{nodeId} (agent token via X-Agent-Token header)
  • GET /api/nodes/{id}/overview, /channels, /opportunities, /alerts
  • POST/GET /api/nodes/{id}/rebalance-plans

User Preferences

  • Dark theme with purple/blue accent colors
  • Clean, modern dashboard design
  • No heavy UI frameworks needed

Recent Changes

  • 2026-02-21: Initial build - full MVP implementation