ReservaYa
LiveSports venue booking platform with a hybrid SQL/NoSQL backend
Role: Full-stack developer
Solo · Since Aug 2026 · Public repo
A court-booking platform (soccer, basketball, tennis) built to demonstrate a deliberate hybrid database architecture: PostgreSQL for data that needs strict integrity, MongoDB for flexible, high-write data, with real overlap-safe booking and a tested REST API, not just a CRUD demo.
Problem
Booking systems need strict integrity for schedules and reservations (two people can never book the same court at the same hour), but they also generate flexible, high-volume data like reviews and per-event notifications that don't fit a rigid relational schema.
Solution
PostgreSQL (via Sequelize) models users, venues, weekly schedules, and reservations, with row-level locking inside a transaction so two overlapping bookings can never both succeed. MongoDB (via Mongoose) stores reviews and per-event notifications, whose shape genuinely varies by event type.
Architecture highlights
- Booking creation runs inside a Postgres transaction with row-level locks that re-check for time-range overlap right before committing, closing the read/write race window instead of relying on a unique constraint alone
- Availability endpoint derives free/booked hour slots per day directly from the venue's weekly Schedule rows minus its active reservations, with no separate cache to keep in sync
- A MongoDB aggregation pipeline computes each venue's average rating and review count on read, merged in-app with the Postgres venue record
- Domain events (reservation created/confirmed/cancelled, review received) write structured notifications into MongoDB, each with a free-form metadata field that differs by event type
- 76 backend tests (Vitest + Supertest) against a real Postgres/MongoDB test database, weighted toward negative paths: 401/403/404/409/400 on every route, not just the happy path
- 24 frontend tests (Vitest + React Testing Library) covering auth-context edge cases (invalid token, failed login) and role-gated route redirects