✦vishal/VJ
← work/room-booking
● shipped·2025·Solo full-stack build

Student Room Booking Platform.

A full-stack marketplace for student accommodation — listings, bookings, payments, in production.

Next.jsTypeScriptPrismaPostgreSQLTailwindDockerGitHub Actions
01
Problem.
$ cat problem.md

Off-campus housing for students in Indian college towns is a mess of WhatsApp groups, broker fees, and unverifiable listings. I wanted a focused, mobile-first marketplace where students can browse, book, and pay for verified rooms without the noise.

02
Approach.
$ ./build.sh
01

Modelled the domain carefully in Prisma: Users, Listings, Bookings, Payments, Reviews, with the right cascade rules so a cancelled listing never leaves orphan bookings.

02

Built a Next.js (App Router) front end with server components for the listing pages — listings render fast, even on a 3G hostel connection, and the URL is the source of truth.

03

Implemented booking + payment as a state machine: pending → confirmed → checked-in → completed, with optimistic UI and idempotent webhook handlers so retries never double-charge.

04

Containerised with Docker, set up a CI pipeline in GitHub Actions that runs typecheck + lint + tests on every PR, and ships to a container host on merge to main.

03
Architecture.
$ tree ./layers
layer_01
Web
Next.js (App Router), RSC, Tailwind
layer_02
API
Route handlers + server actions
layer_03
ORM
Prisma, PostgreSQL
layer_04
Payments
Idempotent webhooks, state machine
layer_05
Auth
Email + OAuth, httpOnly cookies
layer_06
Deploy
Docker, GitHub Actions CI/CD
04
Decisions.
$ git log --grep=why
commit_01 · Server Components, not a SPA

Server Components, not a SPA

Listings are SEO-critical and most users arrive from Google. Rendering on the server means the page works without JS, loads fast on bad networks, and the data layer stays the source of truth.

commit_02 · Prisma over a hand-rolled query layer

Prisma over a hand-rolled query layer

The schema is the contract. Prisma's type-safe client means a typo in a relation is a compile error, not a 3am production incident.

commit_03 · Booking as a state machine

Booking as a state machine

Status transitions are explicit and tested. Every payment webhook, every cancellation, every admin override goes through the same function — which means we can replay the audit log and know exactly what happened.

05
Reflections.
$ cat TODO.nice-to-have
↳ TODO_1

I'd add a verified-student flow (college email domain check + ID upload) before allowing listings. Right now trust is reputational; it should be cryptographically grounded.

↳ TODO_2

Search is naive (LIKE on title). For the next iteration I'd add a real search layer (Postgres trigram or Meilisearch) and a 'rooms near me' geo query.

// nav.next