A lightweight contractor invoice management system built with Clojure. Manage customers, create offers, track tasks, and generate professional PDF invoices.
- Customer Management - Track clients with contact details, addresses, and billing information
- Task & Task Group Management - Define billable tasks with effort estimates and pricing
- Offer Creation - Create and manage service offers for customers
- Invoice Generation - Create invoices from task groups with automatic calculations
- PDF Export - Generate professional PDF invoices and offers using LaTeX templates
- Multi-language Support - German and English invoice formatting based on customer locale
- Web Interface - Clean, modern HTMX-based UI with server-side rendering
- Role-based access control (RBAC)
- Revenue dashboards and projections
- Payment tracking and client profiling
- Email notifications
- Backend: Clojure with Ring/Compojure
- Database: Datahike (durable Datalog database)
- Frontend: HTMX with Hiccup templates
- PDF Generation: LaTeX (pdflatex)
- Java JDK 11 or higher
- Clojure CLI tools
- LaTeX distribution with pdflatex (for PDF generation)
Ubuntu/Debian:
sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-latex-extra texlive-lang-germanmacOS:
brew install --cask mactexWindows: Download and install MiKTeX
-
Clone the repository
git clone https://github.com/replikativ/beleg.git cd beleg -
Install dependencies
clojure -P
-
Start the application
clojure -M:run
-
Open in browser
Navigate to http://localhost:8080
Copy the example configuration file:
cp config/beleg.edn.example config/beleg.ednEdit config/beleg.edn to set your company details, database path, and other settings. See config/README.md for detailed configuration options.
BELEG_DB_PATH- Override the database storage pathPORT- Override the server port (default: 8080)
clojure -M:devclojure -M:dev -e "(load-file \"dev/seed.clj\")"clojure -M:testThe invoice template is located at resources/invoice-template.tex. You can customize it for your branding.
To add a company logo, place logo.png in the resources/ directory and uncomment the logo sections in the template.
beleg/
├── src/io/replikativ/beleg/
│ ├── core.clj # System initialization
│ ├── server.clj # Web routes and handlers
│ ├── services.clj # Business logic
│ ├── schema.clj # Datahike schema definitions
│ └── render.clj # PDF rendering
├── test/ # Test suite
├── config/ # Configuration files
├── dev/ # Development utilities
├── resources/ # Templates and static assets
└── databases/ # Datahike database storage
Docker is the easiest way to run Beleg, especially since it includes LaTeX for PDF generation.
# Build and run with docker-compose
docker-compose up -d
# View logs
docker logs beleg-beleg-1
# Stop
docker-compose down# Build the image
docker build -t beleg:latest .
# Run the container
docker run -d -p 8080:8080 \
-v beleg-data:/app/databases \
-e BELEG_DB_PATH=/app/databases \
beleg:latestThe application will be available at http://localhost:8080
clojure -X:uberjarjava -jar beleg.jarIf you are interested in commercial support, please reach out to datahike.io.
Copyright © 2023-2025 Christian Weilbach
Distributed under the MIT License. See LICENSE for details.
