The Modern Monolith: Speed and Sustainability in SaaS Development
In the fast-moving startup ecosystem, the choice of technology stack can be the difference between a successful launch and the "endless analysis loop" (when you are forever adding something new and never manage to ship). I recently reread Martin Fowler's classic article, Monolith First, and the premise still holds up: almost every successful system starts out as a monolith, even if it evolves into something else later.
Building our SaaS, we decided to embrace that philosophy — but with a contemporary stack that avoids the headaches of legacy monoliths.
The Stack's "Vibe": Laravel, InertiaJS and Vue
Our choice wasn't based on passing trends, but on productivity and cohesion. Together, these tools create a workflow where context isn't lost between the backend and the frontend.
- Laravel: This is our core. The PHP framework built for the web's "artisans". It natively solves what is basic yet complex (solid authentication, queues, a powerful ORM), letting our programming focus on business logic rather than on the plumbing of the code. Plenty of PHP dinosaurs complain, especially about performance, but once you know how to use the framework it is brilliant. In my experience, the gain in code maintainability is a total game changer.
- InertiaJS (The Modern Monolith): Inertia is the magic glue. It calls itself the "Modern Monolith" because it removes the need to build a complex REST or GraphQL API just to feed the frontend. With Inertia, routing and controllers stay in Laravel, but the view is delivered as a Vue JS component. That removes the overhead of juggling JWT tokens, CORS or manual loading states.
- VueJS: On the frontend, VueJS provides the interactivity layer. We chose Vue for its gentle learning curve and its intuitive reactivity. It lets us build highly dynamic interfaces, with reusable components and state management that actually makes sense. In the context of Inertia, Vue behaves like a powerful templating engine — but with all the power of an SPA (Single Page Application).
- TailwindCSS: It ensures the design is implemented directly in the HTML, keeping the bundle light and visual maintenance extremely simple, with no giant, unmanageable CSS files.
Bonus: The Future With NativePHP
Beyond the web, this stack opens the door to the desktop and mobile ecosystems in an unprecedented way, through NativePHP. It lets us package our PHP / Laravel application as a native executable for Windows, Mac, Linux, Android and iOS!
The real potential here is logic reuse: you don't need a Swift or C# team to build an app. You use the same routing system and the same Vue views. NativePHP turns our web stack into a complete cross-platform development tool.
Code Organization and Maintenance
From a software engineering standpoint, the great advantage of this monolithic approach is the reduced integration burden. While coding, we don't have to switch between repositories or deal with broken API contracts. If I change a database field with a migration, I see that change reflected immediately in the Vue component through Inertia. There is only one codebase.
The organization follows the MVC (Model-View-Controller) pattern, except the "View" is a modern, reactive component. That makes long-term maintenance easier: new developers grasp the application's full flow quickly, since the authorization and data logic is centralized in the backend.
DevOps Without the Headache: The Power of Laravel Forge
Many teams lose weeks configuring Kubernetes clusters or complex Docker orchestration. Since we already follow a monolithic approach, we opted for pragmatism with Laravel Forge.
For many use cases, Forge removes the need to manage Docker containers in production. It provisions servers directly on the cloud provider and configures firewalls, Nginx, SSL certificates and user isolation automatically. That gives us "bare metal" performance with the convenience of the cloud.
Global Infrastructure and Storage
Our infrastructure is designed for resilience and low latency, using the best of each region:
- United States: We use Digital Ocean with its Object Storage system (Spaces) for assets and uploads. Digital Ocean's user experience is unmatched and the service simply doesn't give us trouble.
- Brazil: Since Digital Ocean isn't an option here, we use Vultr combined with S3 (or S3-compatible storage).
In both cases, the topology is scalable. Forge makes it easy to split responsibilities across separate servers as traffic grows, allowing dedicated instances for web servers, queue workers and the database, as well as load balancers to distribute the load.
Security and Performance With Cloudflare
To round out this brief DevOps section: we don't leave our servers exposed directly to the internet (obviously). We use Cloudflare as our first line of defense.
Having a WAF (Web Application Firewall) is mandatory these days. It protects us against SQL injection, Cross-Site Scripting (XSS) and denial-of-service (DDoS) attacks before the traffic even reaches our infrastructure on Forge (DO or Vultr).
Conclusion
Building a SaaS shouldn't be about managing complex infrastructure, but about delivering value to the customer. By adopting the Modern Monolith with Laravel and Inertia, and simplifying DevOps with Forge, we gained the most precious thing of all: time to innovate.
📌 This article was originally published on LinkedIn, in Portuguese. Read it and leave a comment there too!