Inspiration

If you’ve ever walked through the NYU Dibner Library during midterm season, you’ve witnessed the "Ghost Booking" epidemic. The library's online portal will show that every single study room is fully booked, yet when you walk down the hall, half of the rooms are completely empty. Students reserve slots "just in case" and never show up, while students who actually need a quiet space are forced to sit on the floor. We realized that a purely digital calendar isn't enough. Study spaces need physical enforcement. We built Dibner Live to bridge the gap between digital reservations and physical reality. If a room is empty, it should be instantly available!

What it does

Dibner Live is a real-time, hardware-enforced Library Lifecycle Management system consisting of two main components:

  • The Student Web App: A mobile-first Progressive Web App (PWA) where students can view live room statuses. If a room is vacant, they can hit "⚡ DIBS" to instantly claim it or book an advance slot. Upon booking, the system generates a secure 4-digit PIN.
  • The Door Terminal: Designed to run on a Raspberry Pi mounted outside the study room, this high-contrast interface waits for the student's PIN. If the student doesn't physically check in before their window expires, the reservation is ruthlessly deleted.
  • Presence Enforcement: Once checked in, simulated physical presence sensors monitor the room. If a student leaves for an extended period, the door terminal pulses a "Sensor Lost" warning. If they do not return, the system automatically forfeits the session and opens the room to the public.

How we built it

We prioritized speed, concurrency, and real-time synchronization:

  • Backend: We used Python with FastAPI for its asynchronous capabilities. The system relies on a rigorous, auto-evolving state machine (Available -> Reserved -> Occupied -> Sensor Timeout -> Forfeited) that evaluates time constraints on every request.
  • Database: To handle high-frequency bookings without locking the database, we utilized SQLite configured in WAL (Write-Ahead Logging) mode and standardized all timestamps to UTC.
  • Real-Time Sync: We implemented WebSockets to broadcast state changes. When someone claims a room, the status updates to "Busy" on every other student's phone across campus in sub-second latency, without requiring a page refresh.
  • Frontend: We built a lightweight, zero-dependency frontend using pure HTML, JavaScript, and Tailwind CSS, optimized as a mobile-adaptive PWA.
  • Networking: We securely exposed our local environment to the public internet using Cloudflare Tunnels, allowing secure WSS (WebSocket Secure) connections without complex router configurations.

Challenges we ran into

  • The "Dibs" vs. Advanced Booking Collision: Our most critical challenge was a temporal overlap bug in our database logic. We discovered that when a student used the instant "⚡ DIBS" feature to claim an available room, the system was accidentally overwriting or canceling other students' advanced bookings scheduled for later in the day. Because the room's global state changed to "Reserved," our early state machine logic wasn't properly distinguishing between the instant session's timeframe and future scheduled slots. We fixed this by completely rewriting the SQL validation in our /reserve endpoint to enforce strict temporal boundaries, ensuring an instant booking's end_time mathematically cannot overlap with any existing start_time in the reservation ledger.

Accomplishments that we're proud of

  • Zero-Refresh Synchronization: Achieving seamless, millisecond-latency UI updates across multiple connected devices using our custom WebSocket broadcasting loop.
  • The State Machine: Building a highly robust, self-cleaning state evolution function that doesn't rely on messy cron jobs, but instead evaluates and cleans up expired reservations dynamically.
  • Production-Ready UX: Designing a clean, NYU-branded mobile interface and a high-contrast, physical door terminal UI that actually looks and feels like a commercial product.

What we learned

  • We gained a deep understanding of asynchronous Python (asyncio) and how to properly manage a pool of active WebSocket connections.
  • We learned the hard way that when dealing with distributed systems and databases, you must always store time in UTC.
  • We discovered how to leverage HTML meta tags and viewport settings to make a standard webpage behave exactly like a native iOS/Android app.

What's next for Dibner Live

  • Actual Hardware Deployment: Replacing our frontend sensor toggles with actual PIR (Passive Infrared) motion sensors and electromagnetic door locks wired to GPIO pins on a Raspberry Pi.
  • SSO Integration: Implementing NYU Shibboleth/OAuth to authenticate real student NetIDs rather than relying on an honor-system text input.
  • Admin Analytics: Building a dashboard for library administrators to track peak utilization hours and identify chronic "ghost booking" offenders.

Bonus

  • We implemented an FPGA interface to act as a video controller to simulate end-user product that does not require an SBC setup. It demonstrates potential in further customization and full-stack hardware autonomy.

Built With

Share this project:

Updates