This file provides guidance to AI agents like Claude Code/Cursor/Copilot when working with code in this repository.
Bitkit Docker is a complete Docker-based development environment for Bitcoin and Lightning Network development. It provides:
- Bitcoin Core (regtest) - Local Bitcoin node
- LND (Lightning Network Daemon) - Lightning node
- Electrum Server - Electrum protocol server
- LNURL Server - Main web application for LNURL protocols
- VSS Server - Versioned Storage Service for wallet backup
bitkit-docker/
├── docker-compose.yml # Main Docker orchestration
├── bitcoin-cli # Helper script for Bitcoin CLI commands
├── CHANGELOG.md # Project changelog (MUST be maintained)
├── CLAUDE.md # This file - AI agent guidelines
├── lnurl-server/ # LNURL server application (Node.js/Express)
│ ├── server.js # Entry point
│ ├── routes/ # Express route handlers
│ │ ├── decoder.js # /decode endpoints (BOLT11, LNURL, BIP21)
│ │ ├── generator.js # /generate endpoints
│ │ └── admin.js # Admin API endpoints
│ ├── templates.js # HTML templates (Vercel-style design)
│ ├── services/ # Bitcoin and LND service integrations
│ ├── middleware/ # Express middleware
│ └── utils/ # Utility functions
├── lnd/ # LND configuration and data
├── vss-server/ # VSS server (git submodule)
└── sql/ # Database schemas
- Use CommonJS modules (
require/module.exports) - Use Express.js patterns for routes
- Use
asyncHandlerwrapper for async route handlers - Follow Vercel/Geist design system for UI components
- Use existing helper functions:
mainLayout,header,container,card,endpoint - CSS uses CSS custom properties (design tokens)
- Support both light and dark themes via
data-themeattribute - Inline all styles and scripts in templates
- Routes use descriptive paths:
/,/generate,/decode,/health - Return JSON for API endpoints with
{ success: true/false, ... } - Return HTML for UI pages
- Use proper HTTP status codes (400 for bad requests, 404 for not found)
- Log operations using the
Loggerutility
- Wrap async handlers with
asyncHandlerfrom middleware - Return descriptive error messages in JSON responses
- Log errors with context using
Logger.error()
CRITICAL RULE: When making any changes to this project, you MUST update CHANGELOG.md.
-
Add changes under the
[Unreleased]section -
Use the appropriate category:
Added- New featuresChanged- Changes to existing functionalityDeprecated- Features that will be removedRemoved- Removed featuresFixed- Bug fixesSecurity- Security improvements
-
Write entries in imperative mood ("Add feature" not "Added feature")
-
Include relevant file paths or endpoints when helpful
-
Group related changes together
## [Unreleased]
### Added
- New `/api/widget` endpoint for widget management
- Support for custom themes in the generator page
### Fixed
- Invoice decoding error when amount is null- Create route file in
lnurl-server/routes/ - Register in
lnurl-server/server.js - Add UI template function in
lnurl-server/templates.jsif needed - Update CHANGELOG.md
- Edit relevant function in
lnurl-server/templates.js - Follow existing CSS patterns (use CSS custom properties)
- Test in both light and dark modes
- Update CHANGELOG.md
- Plan the backend routes and frontend UI
- Implement backend first (routes, services)
- Add frontend (templates)
- Update README.md if user-facing
- Update CHANGELOG.md
This is a development/testing environment. Test manually using:
curlcommands for API endpoints- Browser for UI pages at
http://localhost:3000 - Bitkit app for end-to-end testing (see README.md)
/decode- BOLT11, LNURL, and BIP21 decoding/generate- LNURL generation/health- Health check/.well-known/lnurlp/:username- Lightning Address
| File | Purpose |
|---|---|
lnurl-server/routes/decoder.js |
Decode API (BOLT11, LNURL, BIP21) |
lnurl-server/templates.js |
All HTML templates and UI |
lnurl-server/server.js |
Express app entry point |
docker-compose.yml |
Service orchestration |
CHANGELOG.md |
Change history (MUST maintain) |