Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ierinconc/billar-pro-backend/llms.txt

Use this file to discover all available pages before exploring further.

Billar Pro Backend provides everything you need to run a billiard hall’s back-office: open and close tables with automatic time tracking, register product consumption during a session, and pull daily, weekly, or monthly revenue reports. The entire API is secured with JWT bearer tokens and backed by PostgreSQL.

Quickstart

Get the API running locally in under five minutes with Docker and Maven.

Configuration

Configure database connection, server port, CORS origins, and security settings.

Core Concepts

Understand the table lifecycle, sessions, and how billing is calculated automatically.

API Reference

Full endpoint reference for authentication, tables, sessions, products, consumption, and reports.

How it works

Billar Pro models a billiard hall’s daily workflow in three layers:
1

Authenticate

Obtain a JWT token by posting credentials to POST /api/auth/login. Include the token as a Bearer header on every subsequent request.
2

Manage tables

Open a session on a table with PUT /api/mesas/{id}/ocupar. The API records the start time automatically. Register any product sales against that table using POST /api/consumos.
3

Close and bill

Call PUT /api/mesas/{id}/cerrar to end the session. The API calculates elapsed hours, multiplies by the table’s hourly rate, adds all pending consumptions, and returns a CierreMesaDTO with the full breakdown.
4

Report revenue

Use the /api/reportes endpoints to retrieve daily, weekly, and monthly revenue summaries, broken down by table, by day, and by top-selling products.

Key features

Table lifecycle

Tables move between LIBRE and OCUPADA states. Start time is captured on open; billing is computed automatically on close.

Session billing

Each closed session records hours played, hourly rate, product subtotals, and a total. History is preserved for reporting.

Product catalog

Manage a catalog of products with categories, prices, and availability flags. Unavailable products cannot be added to a session.

Revenue reports

Daily, weekly, and monthly reports with breakdowns by table and product, plus average ticket analytics.

JWT security

Stateless JWT authentication with BCrypt password hashing. All endpoints except login require a valid bearer token.

Docker-ready

A single docker-compose.yml spins up a PostgreSQL 16 database for local development.

Build docs developers (and LLMs) love