Skip to main content
ABScaleForge
Back to blog
2 min read

Prime Alley Microservices — One Product, Four Deployable Services

How we split billing, accounts, payments, and live updates into separate services while keeping a single login and navigation shell for end users.

MicroservicesReactLaravelNext.jsStripeGitLab CI

Monolithic billing apps are hard to deploy piece by piece, scale by feature, or split across teams — but users still want one login and one menu. That tension drove the Prime Alley architecture.

The split

Instead of one repo doing everything, we run four deployable services behind a shared shell:

  • Accounts — central auth, companies, customers, vendors, invoices, Stripe billing API
  • Billings — modern Next.js UI using the BFF pattern to proxy Laravel
  • GSM — focused Stripe checkout with Elements for card payments
  • AI/ML Gateway — WebSockets and Redis queues for live updates and async jobs

The main app shell handles navigation, layout, and entry point. Users experience one product. Engineers ship each service independently.

Why not rewrite everything?

Accounts already owned login, RBAC, and financial data. Billings needed a modern SPA without CORS pain. GSM needed a lighter checkout surface. The gateway needed to offload long-running work from the core API.

Rewriting into one Next.js monolith would have blocked parallel team work for months. Microservices matched the org structure and deployment cadence.

Integration patterns

  • Accounts exposes JSON APIs — single source of truth for auth and billing data
  • Billings never calls Laravel from the browser; Next.js proxies server-side
  • GSM reads invoices and sessions from Accounts, handles card UI only
  • Gateway enqueues jobs and pushes Socket.IO events when work completes

Shared conventions: JWT sessions, company_id scoping on every record, audit logs on admin actions.

Quality and delivery

GitLab CI runs per service. SonarQube tracks code quality. Vitest covers critical paths in the shell and frontends. Each service can fail deploy without taking down the entire platform — if the gateway is down, billing still works; users just lose live progress toasts.

Takeaway

Microservices pay off when boundaries match team ownership and users do not feel the seams. Invest in the shell, shared auth, and consistent company scoping first. Split services second.