How should I start my first full-stack app with React and Express?
Asked by
MellowPine47
I've learned the fundamentals of Node.js and Express, including authentication, connecting a database, and building a small full-stack app with dynamic EJS pages. For my next project, I want to keep using Node and Express for the backend but build the frontend with React. I've already designed the UI in Figma and planned the site's functionality, but I'm unsure how to organize the work. Should I build all the React pages first and then create the backend, or develop both sides together? I also don't understand the best way to connect a React frontend to an Express backend. Any recommended learning resources or books would be appreciated.
Answers
You donโt need to complete every page before starting the server. Define the data and API needed for one user action, build that endpoint, connect it to a React component, and test the entire path through the database. This gives you a practical structure for the project and makes it easier to spot problems than trying to integrate two finished applications at the end.
Reply to this answer
Build the application incrementally with complete features rather than finishing the entire frontend or backend separately. Pick one small featureโsuch as login or creating a postโand implement the React interface, the Express API, and the database work for that feature together. Once that flow works from start to finish, repeat the process for the remaining features.
Reply to this answer
React and Express usually communicate through an API. Create Express routes that handle requests and return JSON data rather than rendered HTML. From React, you can call those endpoints with the browserโs fetch functionโfor example, inside a useEffect hook when a component loads. As the project grows, a data-fetching library such as React Query can help manage loading states, caching, and updates. Start with one simple request and build from there.
Reply to this answer
Add your answer
Answers are reviewed before publication.
MellowPine47: That approach makes sense, but Iโm still unsure how React fits into the process since I havenโt used it with an Express backend before.