What’s the best way to structure a repository for a full-stack project (React frontend + Express backend)? #212059
🏷️ Discussion TypeQuestion BodyI’m building a full-stack app with a React frontend and an Express.js backend. Should I keep both in one repository (monorepo) or use separate repositories? What are the pros and cons for deployment, version control, and collaboration? |
Replies: 1 comment
|
For a solo or small-team project, a monorepo is usually simplest: my-app/ |
For a solo or small-team project, a monorepo is usually simplest:
my-app/
├── client/ (React)
├── server/ (Express)
├── .gitignore
└── README.md
Pros: One clone, one set of issues/PRs, and a frontend and backend change that belong together land in a single commit. Versioning stays in sync.
Cons: CI and deploys need path filters so a frontend change doesn’t redeploy the backend. Permissions can’t be split per part.
Separate repos make sense when different teams own each part, they deploy on different schedules, or the API serves several clients.
Deployment: Most hosts (Vercel, Netlify, Render) let you set a root directory per service, so a monorepo deploys fine.