Ventaja
Management and booking system for tennis and padel clubs.
- Python 3.12
- Django 5.2
- PostgreSQL 17
- HTMX
- Celery
- Redis
- Alpine.js
- Tailwind 4
- Docker
- pytest
- Playwright
Try it yourself
Sign in with either account. The passwords are public on purpose.
- Club owner
- UsernamemartaPassworddemo1234
- Club admin
- UsernameadminPassworddemo1234
- Front desk
- UsernamerecepcionPassworddemo1234
- Coach
- UsernameprofePassworddemo1234
Two sample clubs with two months of bookings, payments and expenses. Charge, cancel, close the till short: it reloads itself every night.
The problem it solves
The booking systems clubs use are built for five-a-side football: one court per hour, one person paying. A tennis and padel club doesn't work like that. It has coaches renting courts at special rates, students with monthly fees and make-up classes, year-long fixed slots that free up one Tuesday and never get resold, and payouts at the end of the month. When the system can't handle it, the club goes back to the paper notebook. The notebook is the real competitor.
What it does
A booking grid with quick entry and drag & drop, fixed slots, versioned prices, rule-based deposits, partial payments with receipts, a cash drawer with reconciliation, expenses, monthly results and occupancy. On top of that, the academy: coaches on three contract types, students, groups, monthly fees, attendance and payouts. A waiting list that, when a court frees up, has the WhatsApp message ready for whoever wanted it, and WhatsApp support where a language model drafts replies a person approves. It's multi-club and sold in modules.
Architecture
It runs on the same VPS as my other applications, as three environments from the same image, each with its own database: the commercial demo clubs see, the public demo below, and one for internal testing. Scheduled jobs — materializing fixed slots, expiring deposits — run in a separate worker.
Edge
Caddy
Buffers the whole upload before passing it on: a receipt sent over the club's wifi no longer ties up a worker.
Application
gunicorn + Django
One image for web, worker and beat. Tailwind is compiled at build time and no Node is left in the final image.
Celery worker + beat
Idempotent jobs: if they're re-queued, nothing gets duplicated.
Data
PostgreSQL 17
With btree_gist for the overlap constraint. Daily backup on the commercial instance.
Redis 7
Broker only, deliberately without persistence: it holds nothing worth backing up.
- Payment receipts aren't served as static files: they're downloaded through a view that requires a session and filters by club. A UUID filename is not access control.
- The public demo shares no database or files with the commercial one, isn't backed up, and reloads itself every night.
- Modules a club hasn't bought return 404, not 403: a 403 would confirm the screen exists.
The hard part
Making the money add up, every time
A booking isn't paid in one go: it's settled with several payments — a deposit by transfer, the rest in cash — and a single payment can cover several bookings. So a booking has no 'paid' field: every payment is allocated, and balances are recomputed in the same transaction as the charge, with the row locked so two receptionists can't charge the same booking at once. A bank transfer marks the booking as paid but doesn't touch the cash count, because that money isn't in the drawer; if it were counted, the end-of-day close would never balance. And no button that touches money can fire twice: the request carries an idempotency key derived from state, so a double click or a retry on a bad connection doesn't charge again.
Technical decisions
A Postgres exclusion constraintinstead ofchecking in Python that the court is free
Because Two front desks booking the same slot at the same moment both pass a Python check, and the court ends up double-booked. With the constraint on court and time range, overlap is impossible in the database, not merely unlikely in the code.
Every club in one shared databaseinstead ofone instance per customer
Because A new club is a row, not a deployment: if onboarding a customer meant logging into the server, something would be badly designed. The cost is that isolation depends on the code, so every view returning club data has a test checking that another club gets a 404.
Warn, don't blockinstead ofblocking debtors or off-hours bookings by default
Because A front desk stuck on a Saturday at 8 pm is the fastest way to send a club back to the notebook. The restrictions exist and are tested, but they start as warnings and record who chose to proceed. A club that wants them strict turns them on.
What I learned
That documentation starts lying the moment it stops being executed. The user manual is a file that runs against the app and warns when it's no longer true. Same with deployment: if the styles aren't compiled, the app ships without a single one and nothing fails, so the Dockerfile has a guard that stops the build instead of trusting someone to notice.
What's next
The club's public portal: online booking for players and payment through Mercado Pago.
In short
- Over a thousand pytest tests, including club isolation on every view
- A user manual that runs against the app
- Sold in modules: academy, finance, support
- Public demo with owner, admin, front-desk and coach accounts