I Vibe‑Coded a Booking API—Then Made It Production‑Grade (Part 1)
dev.to·4d·
Discuss: DEV
💸Affordable LLMs
Preview
Report Post

Booking operations are ubiquitous — we book flats, rooms, cars, appointments, and much more. Yet delivering a performant booking API can be deceptively tricky.

My first attempt was naive: I asked an AI agent (Claude Opus 4.5) to design the data model and implementation end‑to‑end, with the only constraint being Python and FastAPI. The result looked plausible at first glance, but the code hid several serious flaws. Here’s one of them:

# Get all properties in the city
properties_in_city = db.query(Property).filter(
Property.city.ilike(f"%{city}%")
).all()

# Filter out properties with overlapping bookings
available_properties = []
for property in properties_in_city:
overlapping_bookings = db.query(Booking).filter(
and_(
Booking.property_id == property.id,
Booking.start_date < e...

Similar Posts

Loading similar posts...