Next.js · Laravel · Stripe
Full Stack SaaS Case Study

The context
BabalCloud aimed to disrupt the local cloud hosting market by offering an automated, self-service portal for developers to provision Virtual Private Servers (VPS) and cloud instances. The existing solutions in the region were largely manual, requiring customers to email support to scale servers or handle billing.
The client needed a highly reliable platform that could interface with underlying hypervisor APIs (like Proxmox), manage complex metered billing, and provide a snappy, modern dashboard for users to monitor their server states (CPU, RAM usage) in real time.
Architecture & Stack
The Backend: Built with Laravel. The backend acted as the orchestrator, taking user requests, verifying billing status via Stripe, and then communicating with the underlying hypervisor APIs to spin up or tear down virtual machines. PostgreSQL handled the complex relational data of users, invoices, and server configurations.
The Frontend: A Next.js App Router application. The marketing site needed perfect SEO, while the user dashboard required highly interactive state management. Next.js allowed us to serve static marketing pages at the edge while rendering the secure dashboard dynamically.
Technical hurdles
When a user clicked "Reboot Server", the UI needed to show "Rebooting..." and then automatically switch back to "Running" once the hypervisor completed the task, without the user refreshing the page.
Implemented intelligent short-polling using React Query. When a mutation (like reboot) occurred, React Query automatically invalidated the server state cache and began polling the backend endpoint every 3 seconds until the backend confirmed the final state, providing a seamless UX.
Stripe handles the subscription lifecycle. If a user's credit card failed to renew, Stripe would eventually cancel the subscription. We needed to suspend the user's servers immediately to prevent revenue leakage.
Built a robust, idempotent Stripe Webhook handler in Laravel. When `customer.subscription.deleted` was received, a background job was immediately pushed to Redis to interact with the hypervisor API and suspend the associated VMs.
Business results
BabalCloud successfully launched its automated provisioning system, allowing developers to spin up servers in under 60 seconds. The platform completely eliminated manual intervention from the billing and provisioning lifecycle, allowing the company to scale its customer base without increasing support staff headcount.
<60s
Provisioning Time
100%
Automated Billing
0
Manual Interventions