BACK
Venue Operations · Transactions · Vue 3 / Tornado

BF Badminton

A full-stack venue platform connecting online reservations, walk-in court use, member top-ups, store pickup and financial reconciliation, with dedicated workspaces for customers, front-desk staff, administrators and maintenance staff.

RoleFull-stack Developer
FocusVenue Workflows & Transaction Integrity
StackTornado / Vue 3 / Redis
BF Badminton two-hour court selection, 10 percent member discount and simulated Alipay option
Continuous selection and member pricing: 18:00–20:00 costs 200 yuan before a 10 percent Gold discount, or 180 yuan due. This capture shows a quote and payment choice, not a submitted order.

Beyond Booking: Support the Daily Work of a Venue

BF Badminton starts with a shared court schedule for online and walk-in service, connecting member accounts, payment orders, stock, pickup credentials, events and community features. Customers book and purchase; front-desk staff handle walk-ins, top-ups and collection; administrators manage operations and permissions; maintenance staff have read-only access to maintenance schedules.

The frontend uses Vue 3, TypeScript, Pinia, and Element Plus. The backend uses Tornado's asynchronous request model with an aiomysql pool and asynchronous Redis client for network and database I/O.

Python Tornado
Vue 3
TypeScript
Pinia
MySQL / InnoDB
Redis
JWT
Nginx

Screenshots captured on 2026-09-29 show the local isolated demo, with the original Chinese interface; most historical transactions date to September 24. Payment is an in-project simulation, not the official Alipay sandbox or a real transfer. Production HTTPS deployment, WeChat public-account linking and physical scanning devices require separate acceptance. Select an image to open its original.

Protect Court Use and Payments with Transactions, Row Locks and Idempotency

New bookings now use MySQL transactions as the authoritative boundary. FOR UPDATE locks the relevant court rows before checking active bookings, maintenance blocks and confirmed prices; reservations, payment orders and audit records commit together. Online booking, walk-ins, extensions and rescheduling share conflict rules. Redis still handles verification codes, tokens and existing temporary locks, but is no longer the primary safeguard against duplicate occupancy in new bookings.

01 / ASYNC I/O
Asynchronous Entry
Tornado coroutines with asynchronous MySQL and Redis clients reduce thread blocking during I/O waits.
02 / COURT ROW LOCK
Shared Court Row Locks
Online, walk-in, rescheduling and maintenance transactions lock court rows before checking time ranges and active occupancy.
03 / IDEMPOTENCY
Idempotency & Constraints
Request keys, parameter hashes and stored results let identical retries reuse outcomes and reject changed parameters, protecting credits and redemption.
04 / EXPIRATION
Expiration & Recovery
Expired pending orders release court, stock or wallet holds. Critical state and ledger changes commit together or roll back.

The repository records a run through real Tornado HTTP routes with JWT and role checks: macOS arm64, Python 3.14.3, MySQL 5.7.28 and a pool limit of 10. Each scenario used one initial request followed by 200 requests with a concurrency cap of 20.

Local concurrency sample (2026-09-24)
ScenarioP50 (ms)P95 (ms)Failures / samples
Store checkout quote15.3917.930 / 200
Simulated store collection61.0074.460 / 200
Global ledger query305.47349.480 / 200
Read the original measurements (JSON)
These figures come from a local isolated-database run on 2026-09-24. They do not establish production QPS, thousand-user concurrency or public-network multi-instance capacity, and were not rerun for this screenshot update.

From Continuous-Slot Recommendations to Quotes and Rescheduling

Customers can select consecutive slots or supply an earliest start, duration and court preference to find fully available windows. Prefix sums identify contiguous openings; candidates are ranked by start-time deviation, preference, price and fragmented gaps. Up to three suggestions include reasons. A recommendation does not hold a slot: availability is checked again when booking.

Before confirmation, the quote shows list price, member discount, amount due and available balance, with stored value or project-internal simulated Alipay. Changed prices or benefits require reconfirmation; valid pending orders retain their agreed price snapshot. Cancellation, expiration and rescheduling handle resource release and price differences separately. Refunds return to the original payment channel, so simulated Alipay refunds do not credit the member wallet.

A Membership Account Beyond Discount Labels

The member center manages tier, expiry, balance, points and account history. Front-desk staff or administrators can process simulated top-ups, preserving the reason, operator and related business record. Pending holds are shown separately from available balance, allowing customers to reconcile top-ups, spending, refunds and manual adjustments rather than seeing only a balance.

Event registration, the player community, announcements, and notifications extend the platform across transactions, organization, and community engagement instead of limiting it to a booking tool.

Payment Is Not the End: Make Collection Traceable

Checkout rechecks price, stock and available balance and supports stored value and simulated Alipay. Pending orders reserve stock; successful payment creates a pickup QR code and readable code. Front-desk staff or administrators look up the order before confirming whole-order collection. Each order can be redeemed only once. A refund request freezes collection, and a completed refund invalidates the credential.

BF store cart showing price revalidation and stored-value or simulated Alipay checkout
Cart checkout: balance, total and two payment channels, with price revalidation before ordering. No order was submitted; the background test product and its missing-image placeholder remain unchanged.
BF front-desk lookup of a collected order with operator, collection time and completed status
Collection result: this demo order was collected on September 24, with its operator and timestamp retained. This is not a reusable pickup credential or evidence of physical-scanner acceptance.

Shared Business Records, Clearly Separated Roles

Front-desk staff open courts for unregistered walk-in customers at the full-slot list price. Arriving at 14:10 for 14:00–15:00 still incurs the full slot charge and ends at 15:00. Adjacent extensions, payments and operators remain traceable. Front-desk staff cannot publish events or announcements; maintenance staff only view reasons and scheduled windows, with reopening controlled by administrators.

BF front-desk workspace with three court schedules and walk-in booking entry points
Front-desk schedule: availability and walk-in entry points for three courts, alongside extensions, top-ups and collection workflows.

Explain Each Receipt, Not Just a Revenue Total

The global ledger distinguishes channel receipts, top-ups, wallet spending and refunds, so a 100-yuan top-up followed by 100 yuan of wallet spending does not become 200 yuan of channel receipts. An ended booking is not proof of attendance: attendance rate and recording coverage are reported separately, and manual adjustments are kept out of operating receipts.

BF administrator ledger separating simulated channel receipts, wallet spending, refunds and manual adjustments
Global ledger: channel receipts and refunds are reconciled separately from wallet spending. Manual credits include demo opening balances and must not be read as operating revenue.
01
Concurrency-Safe Booking
Court row locks, transaction checks, idempotency and expiration protect business state.
02
Member Ledger
Top-ups, spending, refunds and manual adjustments retain their original business record and operator.
03
One-Time Pickup Redemption
Payment creates a credential for whole-order collection; refunds freeze pickup and repeated redemption is blocked.
04
Events and Community
Supports event registration, player content, announcements, and in-app notifications.
05
Operational Analytics
Separate booking rate, attendance rate and recording coverage instead of treating unknown attendance as absence.
06
Configurable Rules
Business hours, slot intervals, daily limits, and timeout policies are adjustable.