How do I set up a React and Node full-stack project?
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.
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
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.
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
