I'm working on a project where I want to use C++ for the backend and React for the frontend, along with Firebase for the database. However, I'm struggling to figure out how to connect the two. I've taken a course in C++ and developed a project, but now I want to enhance it by adding a frontend instead of just working with a command-line interface. If you have any suggestions or advice on how to achieve this connection, I'd really appreciate your help!
2 Answers
Just a heads-up: Firebase is often used for web apps without a separate backend, allowing your frontend to connect directly to it. You should keep in mind the main functions of your backend. While using C++ for a backend isn't common due to its complexity, it's not impossible. Typically, C++ web services would run on a URL like localhost:8000, and you'd make requests using React's fetch() to interact with it.
To link your C++ application with React, consider turning your C++ app into a web service. This way, React can interact with it like any other typical frontend application. A framework you might want to look into is oatpp.io, which could simplify the process for you.
Thanks for the tip!
Thanks for the clarification! What do you suggest if I want to implement a frontend?