Skip to content

replikativ/beleg

Repository files navigation

Beleg

A lightweight contractor invoice management system built with Clojure. Manage customers, create offers, track tasks, and generate professional PDF invoices.

Beleg Screenshot

Features

Active

  • 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

Planned

  • Role-based access control (RBAC)
  • Revenue dashboards and projections
  • Payment tracking and client profiling
  • Email notifications

Tech Stack

  • Backend: Clojure with Ring/Compojure
  • Database: Datahike (durable Datalog database)
  • Frontend: HTMX with Hiccup templates
  • PDF Generation: LaTeX (pdflatex)

Prerequisites

  • Java JDK 11 or higher
  • Clojure CLI tools
  • LaTeX distribution with pdflatex (for PDF generation)

Installing LaTeX

Ubuntu/Debian:

sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-latex-extra texlive-lang-german

macOS:

brew install --cask mactex

Windows: Download and install MiKTeX

Quick Start

  1. Clone the repository

    git clone https://github.com/replikativ/beleg.git
    cd beleg
  2. Install dependencies

    clojure -P
  3. Start the application

    clojure -M:run
  4. Open in browser

    Navigate to http://localhost:8080

Configuration

Copy the example configuration file:

cp config/beleg.edn.example config/beleg.edn

Edit config/beleg.edn to set your company details, database path, and other settings. See config/README.md for detailed configuration options.

Environment Variables

  • BELEG_DB_PATH - Override the database storage path
  • PORT - Override the server port (default: 8080)

Development

Start a REPL

clojure -M:dev

Seed Demo Data

clojure -M:dev -e "(load-file \"dev/seed.clj\")"

Run Tests

clojure -M:test

PDF Templates

The 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.

Project Structure

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

Docker is the easiest way to run Beleg, especially since it includes LaTeX for PDF generation.

Quick Start with Docker

# Build and run with docker-compose
docker-compose up -d

# View logs
docker logs beleg-beleg-1

# Stop
docker-compose down

Manual Docker Build

# 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:latest

The application will be available at http://localhost:8080

Building

Build an Uberjar

clojure -X:uberjar

Run the Uberjar

java -jar beleg.jar

Support

If you are interested in commercial support, please reach out to datahike.io.

License

Copyright © 2023-2025 Christian Weilbach

Distributed under the MIT License. See LICENSE for details.

About

A lightweight contractor invoice management system built with Clojure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published