RentAny - Built with Motia
RentAny connects owners with renters for hourly or daily rentals.
0. The Hackathon Challenge ⏱️

Hackathons are pressure cookers. You have limited time, infinite ideas, and a high risk of producing "spaghetti code" that works once and breaks forever.
We (me and my team) entered this hackathon with a bold idea but a constrained timeline. We didn't just want to build a prototype; we wanted to build a scalable architecture that could actually handle complex real-world logic without collapsing under its own weight.
Our goal? RentAny.

1. What is "RentAny"? 🤝
RentAny is a hyper-local peer-to-peer rental marketplace. Think "Airbnb for everything else."
Need a professional camera for a day?
Need a power drill for an hour?
Have a camping tent gathering dust?
RentAny connects owners with renters for hourly or daily rentals.
The Complexity
Beneath the simple UI lies a web of complex state:
Inventory Management: Preventing double bookings across overlapping time slots.
Booking State Machine: Pending -> Confirmed -> Paid -> Completed (or Cancelled/Refunded).
Notifications: Real-time updates for both parties.
Payments: Secure intent creation, capturing, and refunds.
Building this from scratch in a short period of time usually means massive 500-line controller functions and implicit state scattered everywhere.
2. Motia: The Backend Hero 🦸♂️

We used Motia, an event-driven framework that treats your backend logic as Steps, Events, and Workflows.

Here is why Motia was the MVP of our stack:
A. Events as First-Class Citizens 📢
Instead of tight coupling (e.g., BookingService calling NotificationService directly), we emitted events.
Old Way:
// In BookingControllerawait emailService.sendConfirmation(user); // If this fails, does the booking fail?await inventoryService.lockSlot(item);The Motia Way: Our
BookingServicesimply emitsbooking.created.Then, independent Steps react to it:
SendBookingConfirmationlistens tobooking.confirmed.UpdateInventoryAnalyticslistens tobooking.confirmed.
This decoupling meant our team members could work on Notifications and Inventory in parallel without stepping on each other's toes.
B. "Steps" kept our code clean 🧼
Motia forces you to break logic into small, single-purpose "Steps".
Take a look at our Booking Confirmation handler. It doesn't know about HTTP or Express.js. It just knows input (validated by Zod) and logic:
// src/notification/send-booking-confirmation.step.tsexport const config: EventConfig = { name: 'SendBookingConfirmation', subscribes: ['booking.confirmed'], input: z.object({ bookingId: z.string(), ... }),};export const handler = async (input, { logger }) => { // Pure business logic here await sendEmail(input.renterId, "Your booking is confirmed!");};
C. Visual Debugging with Workbench 🕵️

The hardest part of event-driven architectures is debugging. "Did that event fire? Why didn't the email send?"
Motia comes with a Workbench. We could literally see our events flowing through the system in real-time.
Trace ID
req_123comes in.booking.workflowtriggers.Event
payment.succeededfires.Step
ConfirmBookingexecutes.
Seeing this visual graph saved us hours of console.log debugging.
3. What We Learned 🧠
1. Events > Monoliths
Thinking in events forces you to design better systems. It clarifies "what happened" vs "what needs to happen." It makes features additive—for example, if we wanted to add a "Notify Slack on High Value Booking" feature later, we could simply listen to the existing event, without touching the core booking code.king code.
2. Type Safety is Non-Negotiable
Motia's integration with Zod was a lifesaver. If we changed an event payload, TypeScript immediately flagged every consumer that needed updating. In the chaos of a hackathon, this safety net is invaluable.
3. Focus on Logic, Not Plumbing
We didn't spend time setting up message queues (BullMQ), configuring Express routers, or building logging middleware. Motia provided that "batteries-included" infrastructure so we could focus entirely on the business logic of renting items.
Summary: RentAny is live (conceptually)! Thanks to Motia, we built a complex, real-world backend in a fraction of the time, with code we're actually proud to show off.
Check out the code on GitHub! 👇
For Demo👇
Checkout my teammates here👇
Thankyou!🖤
