Separate Frontend and Backend Repos: What It Cost on One Project

My experience with a React SPA and a REST API in separate repos on small CRUD apps, and why I now often keep them together.

· 2 min read · Erik Kubica

I have looked at a few codebases for early-stage SaaS founders who wondered why feature delivery had slowed down.

The team had three engineers. The product was a standard business dashboard with maybe thirty database tables. Yet they maintained two separate Git repositories: app-backend-api and app-frontend-client. They ran two CI/CD deployment pipelines, managed two Docker environments, and spent a good part of each sprint syncing TypeScript interfaces with Go backend structs.

A task like adding a vat_id field to a customer profile took about two days instead of twenty minutes.

The Synchronization Cost

When frontend and backend live in separate repositories, a small database change turns into a chain of steps:

  1. Write a database migration adding vat_id TEXT to the table.
  2. Update the backend domain model and repository scanner.
  3. Update the REST API response serializer.
  4. Regenerate or manually update the Swagger/OpenAPI specification.
  5. Push a backend PR, wait 8 minutes for CI, and deploy to staging.
  6. Open the frontend repository, pull the updated API schema.
  7. Update the TypeScript interface, the Zod validation schema, and the form component.
  8. Push a frontend PR, debug CORS configuration mismatches, and deploy.

That is eight files across two repositories to store one string. If the backend developer forgets to export the field, the frontend ends up with a blank screen on staging.

The Network Waterfall

Splitting also changes client-side performance. Here is the comparison as I measured it on one dashboard:

// Monolithic Server-Side Render:
Client ---- GET /dashboard ----> Server
Client <--- 200 OK (HTML 18 KB) - Server (Total: 14ms)

// Decoupled SPA Waterfall:
Client ---- GET /dashboard ---------> CDN (HTML 2 KB, 15ms)
Client ---- GET /static/bundle.js --> CDN (JS 1.4 MB, 180ms)
Client executes JS runtime (Parse & evaluate: 85ms)
Client ---- GET /api/v1/me ---------> Backend (45ms)
Client ---- GET /api/v1/profile ----> Backend (52ms)
Client ---- GET /api/v1/billing ----> Backend (75ms)
Total time before interactive UI: 452ms

In the first case the server queries Postgres locally and returns complete HTML in 14ms. In the second, the browser downloads a large JavaScript bundle and then makes several fetches, which is slower, especially on mobile networks. A well-tuned SPA can narrow this gap, so the numbers above are from one case.

Keeping It in One Repository

For client backends these days, I often keep presentation and data in the same repository.

With Go standard library templates and HTMX, or Laravel with Blade, adding a field takes two edits: the SQL query and the template markup. The server handles validation, queries the database in about 1.2ms over Unix sockets, and returns HTML.

Metric Decoupled SPA + API Unified Monolith (Go + HTMX)
Repositories 2 separate repos 1 repo
Files to Add 1 Field 8 files + 2 PRs 2 files in 1 commit
Initial Page Load 450 ms (waterfall) 18 ms (direct HTML)
Hosting Baseline $35 / mo (Vercel Pro + API server) $15 / mo (single production node)

Those are the numbers from the projects I compared, and they will differ elsewhere.

For small CRUD apps, a separate repo per layer added more coordination work than it saved, in my experience.

Separate repositories make sense when you have independent mobile and web teams with their own release cycles, or a public API with several consumers. If that's not your situation, starting with one repository is easy to do and easy to split later.

Tell me what you need built

Usually a reply within a day, by email or WhatsApp.