ZenPilates

ZenPilates

Full-stack Pilates studio reservation system

ZenPilates
Category
Web App
Role
Full-stack Developer
Timeline
January 2026 – January 2026
01

Overview

ZenPilates is a full-stack web application that simulates an end-to-end Pilates studio reservation system, developed as part of the DIRO Technical Test. Unlike simple CRUD demos, ZenPilates implements a realistic business flow with complex state management β€” users browse Pilates classes, select available dates and timeslots, choose an available court, complete payment via Midtrans Snap, and manage their reservation history. The frontend uses Next.js App Router with progressive booking state management, while the backend is built with Golang following Clean Architecture principles.

02

Problems

πŸ”„

Complex booking state transitions

The reservation flow involves multiple sequential steps β€” class selection β†’ date pick β†’ timeslot pick β†’ court selection β†’ booking summary β†’ payment β†’ confirmation. Each step depends on the previous, and invalid state transitions must be prevented to maintain data integrity.

🚫

Double booking prevention across three dimensions

Availability must be validated across three interdependent dimensions: date, timeslot, and court. A court might be available on a given date but booked for a specific timeslot. The system must prevent any combination that results in double booking.

πŸ’³

Payment-first booking confirmation flow

Unlike simple reservations that confirm immediately, ZenPilates requires successful payment (via Midtrans Snap) before a booking is confirmed. This introduces a pending payment state and requires synchronizing payment status with reservation confirmation.

πŸ—οΈ

Cross-platform architecture: Next.js + Golang backend

The frontend and backend use different technologies and run independently. Coordinating API contracts, JWT authentication, error handling, and CORS configuration between Next.js and a Golang net/http server required careful planning.

03

Solutions

πŸ—ΊοΈ

Progressive booking state management

Designed a step-by-step booking flow where each step validates the previous before proceeding. State is managed on the frontend using progressive state machine patterns, ensuring users cannot skip steps or submit invalid combinations.

πŸ›‘οΈ

Multi-dimensional availability validation

Implemented backend validation logic that checks availability across three dimensions β€” date, timeslot, and court β€” before allowing any booking to proceed. The validation uses explicit database queries to verify no conflicting reservations exist, preventing double bookings at the data layer.

βš–οΈ

Midtrans Snap payment integration with status sync

Integrated Midtrans Snap payment gateway for real payment processing simulation. The booking transitions through states: Pending Payment β†’ Payment Confirmed β†’ Confirmed. Backend webhook handling synchronizes payment status with reservation status, ensuring atomic booking confirmation.

πŸ—οΈ

Clean Architecture with explicit API contracts

Golang backend follows Clean Architecture (Domain β†’ Usecase β†’ Repository β†’ Delivery) with explicit separation of concerns. RESTful API design with versioned endpoints, JWT auth middleware, and CORS configuration ensures clean communication with the Next.js frontend.

04

Contributions

Architected the full-stack application with Next.js frontend and Golang backend following Clean Architecture principles

Designed and built the Golang backend with net/http server, implementing Domain, Usecase, Repository, and Delivery layers for maintainability and testability

Implemented the progressive booking flow with multi-step state management β€” class selection, date/timeslot/court availability, booking summary, payment, and confirmation

Built availability validation logic that prevents double booking across date, timeslot, and court dimensions with explicit database queries

Integrated Midtrans Snap payment gateway with webhook-based payment status synchronization for booking confirmation

Developed the JWT authentication middleware for route protection, ensuring booking, payment, and history pages require authentication

Created the responsive Next.js frontend with feature-based folder structure, reusable UI components, and centralized design tokens

Implemented booking history page with reservation status display (Pending, Confirmed, Cancelled) and filtering capabilities

05

Features

🧘

Class Browsing

Browse available Pilates classes with descriptions, schedules, and pricing information

πŸ“…

Dynamic Availability

Real-time availability checking across dates, timeslots, and courts with visual indicators of open/closed slots

🚫

Double Booking Prevention

Strict backend validation ensures no court can be double-booked across any date-timeslot combination

πŸ’³

Midtrans Payment

Secure payment processing via Midtrans Snap with sandbox integration and automatic booking confirmation on success

πŸ“‹

Booking History

Complete reservation history with status tracking (Pending, Confirmed, Cancelled) and detailed booking information

πŸ”

JWT Authentication

Secure login/signup with JWT-based authentication protecting all booking, payment, and history operations

06

Tech Stack

  • Next.js
    Next.js
  • Golang
    Golang
  • Supabase
    Supabase
  • Midtrans
    Midtrans
  • PostgreSQL
    PostgreSQL
08

Results

βœ…

Real-World Booking Flow

Complete end-to-end reservation system with class selection, availability checking, payment, and confirmation β€” not a simple CRUD

πŸ”’

Double Booking Prevention

Three-dimensional validation (date Γ— timeslot Γ— court) ensures data integrity and prevents reservation conflicts

πŸ’³

Payment Integration

Midtrans Snap payment gateway integration with webhook-based status synchronization for production-ready payment flow

πŸ—οΈ

Clean Architecture

Golang Clean Architecture with 4 layers ensures maintainability, testability, and separation of business logic from infrastructure