Facebook Pixel

Should I use one repo or two for a full-stack project?

For a learning project, two folders in one repo is simplest. For production, separate repos are common because they deploy independently and have different lifecycles. Start with one repo while learning and split later if needed.

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in How to Set Up a Full Stack React + Node Project Like DevTinder

Decide on one or two repos, set up the Node backend with Express and Mongoose, set up the React frontend with Vite or CRA, use environment variables for config, run both with the right API URL, configure CORS, and organize each codebase by feature.

Run the backend on one port and the frontend on another. Use a proxy in the frontend dev config or set the API URL in env vars, so the frontend calls the right backend during development.

Configure CORS on the backend to allow the frontend's origin in development. In production, serve both from the same origin to avoid CORS entirely, or configure the backend to allow the production frontend domain.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.