All articles
Development9 min read

From MVP to Production: How We Structure a Full-Stack Project

March 5, 2025by Ehtesham Awan·Lead Developer

The project structure, branching strategy, and handover process we've refined across 50+ projects.

The Problem with Most MVPs

Most "MVPs" we've been brought in to rescue share the same problems: a monolithic file structure, no environment separation, hardcoded credentials, no testing, and deployment via SSH and prayer.

The irony is that this "fast" approach slows everything down after week 2. Adding features becomes archaeology. Fixing bugs breaks unrelated things. Onboarding a new developer takes days.

After 50+ projects, here's the process we've standardised on.


Week 1: Foundation (Before Writing App Code)

Repository Structure

For smaller projects, a single Next.js app repo works fine. For projects with multiple apps (web + mobile + API), we use a Turborepo monorepo with shared packages for types, utilities, and component libraries.

Environment Separation

We use four environment files: local (gitignored), example template (committed to repo), staging values (managed in CI), and production values (managed in CI).

Rule: Never commit real credentials. Use environment variables from day 1. We've seen projects where the production database URL was hardcoded in the repository. Don't do this.

Branching Strategy

  • main → production
  • staging → staging environment
  • dev → development integration branch
  • feature/x → individual features
  • fix/x → bug fixes

PRs go: feature branch → dev → staging → main.

This prevents the classic "it works on dev but broken on prod", staging exists to catch that.


Sprint Structure

We run 2-week sprints with Monday planning, daily 10-minute standups, Friday review/demo with the client, and a 15-minute retrospective.

Every ticket gets a "done" definition before the sprint starts. No ticket merges without meeting it.

Feature Development Workflow

  1. Create a feature branch from dev
  2. Write the feature
  3. Write tests (at minimum: happy path + one error case)
  4. Open a PR to dev with: what does this change, how to test it, screenshots for UI changes, and a checklist covering tests, types, and migrations

Code Review Standards

Every PR gets reviewed by at least one other developer. We look for: does it do what the ticket says, are there unhandled edge cases, are there N+1 queries or performance issues, is error handling explicit?

We don't nitpick style, that's what linters and Prettier are for.


Testing Strategy

We use a pragmatic testing pyramid:

E2E Tests (Playwright), Critical user journeys only

Integration Tests (Jest + Supertest), API endpoints, database queries

Unit Tests (Vitest), Pure functions, business logic

What we always test: Authentication flow, payment processing, critical business logic, API endpoints that touch user data.

What we don't unit test: UI components in isolation, third-party library internals.


CI/CD Pipeline

PRs cannot merge if CI fails. This is non-negotiable. "I'll fix the test later" always becomes "we'll never fix the test."

The pipeline runs type checking, linting, tests, and a full build on every PR targeting dev, staging, or main. All four must pass before merge.


Pre-Launch Checklist (Week 9)

Performance: Lighthouse 90+ on all metrics, images optimised, database indexes on all queried fields.

Security: Environment variables validated at startup, Helmet.js configured, rate limiting on auth endpoints, input validation on all endpoints, npm audit passes.

Monitoring: Error tracking (Sentry), uptime monitoring (Better Uptime), logging pipeline to Datadog or Logtail, database backups configured and tested.

Domain and SSL: Custom domain, active SSL certificate, www → root redirect, HSTS header.


The Handover Package

When we complete a project, the client receives full Git repository access, infrastructure documentation, environment variable reference, a runbook for common operations, and a 60-minute handover call.

We also offer a 30-day post-launch support retainer. In our experience, the first 30 days after launch surface the most questions and minor issues.


The One Rule That Changes Everything

Never merge to staging without tests passing. Never merge to main without staging being stable.

Every shortcut in this rule costs ten times as much to fix downstream. The discipline compounds, teams that hold this standard ship faster and with more confidence after month 3.

TagsArchitectureFull-StackProject Management

Start a project

Tell us what you are building.

Send a short note about your product and where it is stuck. We reply within one business day with a clear next step, no sales runaround.