CASE STUDY / PRODUCT ENGINEERING
CabinFy
Active iteration
From a course prototype to a bilingual cabin-booking platform
A React, React Query and Tailwind CSS rebuild of a guest booking experience and admin workspace, backed by Node.js, Express, Prisma and PostgreSQL for cabins, bookings, reviews and operational settings.
01 / PRODUCT SCOPE
Why build a two-sided accommodation product?
CabinFy serves two audiences: guests who want to discover and book cabins, and administrators who need to manage listings, reservations and check-in workflows. The challenge was not simply rendering a list of cabins, but organising two user experiences around one business data model, including routes, server state, forms, tables and responsive interaction.
- Organise guest and admin experiences around one cabin and booking data model
- Separate server state from local interaction state with React Query
- Keep the frontend maintainable through validation, reusable primitives and lazy loading
- Provide a consistent experience across languages, themes and screen sizes
02 / BOOKING FLOW
How a booking moves from discovery to operations
- 01
Discover
Guests browse the cabin catalogue and use filtering, sorting and pagination to find available stays.
- 02
Decide
The cabin detail page brings together images, description, price, location and reviews while guests choose dates and capacity.
- 03
Calculate
The booking form presents an estimate based on dates, nights, guests and breakfast options before submission.
- 04
Book
After signing in, the frontend uses the JWT cookie to call the protected booking endpoint and submit the form.
- 05
Operate
Administrators use the dashboard, bookings, cabins and check-in screens to handle reservations, listings and stay status.
03 / ENGINEERING DECISIONS
Frontend and full-stack decisions visible in the code
- 01
Use React Query for server state
ImplementationCabins, bookings, reviews and settings are fetched through dedicated query hooks, while create, update and delete operations use mutation hooks with shared loading, error and update states.
ValueServer data stays separate from local UI state instead of coupling request results, form input and modal state in one global container.
- 02
Organise the frontend by business boundaries
ImplementationThe features directory separates authentication, bookings, cabins, check-in/out, dashboard, guests and settings, combining page components, forms and data hooks within each domain.
ValueBusiness entry points are easier to find, while lists, forms, dialogs and request logic can be reused within a coherent domain boundary.
- 03
Separate guest and admin route boundaries
ImplementationReact Router keeps /admin/* apart from the guest-facing pages. The admin workspace has its own layout and ProtectedRoute, while the guest flow centres on discovery, cabin details and booking.
ValueThe two audiences get different information hierarchies and operation boundaries while sharing the same API and domain data.
- 04
Use lazy routes and skeletons for transitions
ImplementationDashboard, bookings, cabins, home and cabin pages load through React.lazy and Suspense, with dedicated skeletons for cabin lists and details.
ValueRoute-level code splitting reduces the initial JavaScript payload, while stable placeholders reduce blank states and layout movement during requests.
- 05
Keep validation and UI primitives consistent
ImplementationReact Hook Form manages form state, Zod handles runtime validation, and shared Table, Dialog, Select, Form and Sheet primitives support both guest and admin interactions.
ValueDifferent flows—cabins, bookings, authentication and settings—share predictable validation and feedback patterns instead of bespoke form logic.
- 06
Treat language, theme and responsiveness as product capabilities
Implementationreact-i18next detects the browser language and loads English and Chinese JSON locales, while Tailwind responsive styles, DarkModeProvider and mobile layouts cover different devices and preferences.
ValueInternationalisation and accessible visual choices are part of the interface foundation rather than a final-page patch.
04 / CURRENT BOUNDARIES
Backend boundaries that still need to converge
The frontend and business flows have a clear shape, while authorization, booking consistency and production safeguards remain the next engineering focus.
- High priority
Backend authorization is not consistent yet
ProtectedRoute guards the admin UI, but some cabin mutations, booking operations and settings updates still lack a single server-side authentication and ADMIN role boundary. The backend should be the final authority.
- High priority
Booking consistency cannot rely on client forms alone
The create-booking path validates input, but date overlap checks, concurrent booking protection, server-side price calculation and transaction boundaries still need strengthening to avoid duplicate reservations or tampered totals.
- Medium priority
Session and JWT authentication are used together
Administrators and guests use Passport sessions and JWT cookies respectively. This can work, but cookie security, refresh and revocation, CORS, rate limiting and a unified error contract need further convergence.
- Medium priority
Testing and observability are still thin
The current system mainly relies on Morgan and application logs. A fuller health, metrics and tracing layer, together with tests for booking conflicts, authorization and failure recovery, is still needed.
- Medium priority
Money and deployment configuration need stricter production constraints
Money fields use Float and deployment files contain environment-specific paths and security options. Decimal values, environment-driven configuration and explicit production cookie and CORS settings should come next.
05 / NEXT ITERATION
What to improve next
- 01
Add consistent authentication and ADMIN role middleware to cabin, booking and settings writes
- 02
Recalculate totals on the server and use transactions plus date-overlap checks for booking consistency
- 03
Converge Session and JWT security policy with Secure Cookie, SameSite, CORS and login rate limiting
- 04
Add API integration, frontend interaction and end-to-end booking tests
- 05
Add health checks, structured logs and baseline metrics before evaluating cache or asynchronous work