Member-only story
Docker: Implement MongoDB with a React App
Looking for a great (remote only) React Dev? Or just feel like having a chat? Visit my profile on LinkedIn and say hi! 😃
In the previous article, we explored how to get started with Docker, but the app we built was incredibly simple. All it did was respond with a string to a HTTP request to the main URL.
What if we wanted to do something a little more complex? How about a React app that stores its state in MongoDB?
App Explanation
You can see the code for the app here:
https://github.com/bengrunfeld/docker-nextjs-mongo
So this is a really simple CRUD app. It only takes numbers as an input, but you can create a new record, update or delete an existing one, and of course, read all the existing records.
To execute an Create or Update action, just click out of the box.
Here’s the final result:
Tech Stack
Instead of coding everything from the ground up with Webpack and Express, I decided to use Next.JS, since everything’s already done for you and you don’t need to…