This content originally appeared on DEV Community and was authored by Opajobi Oyegoke
I started to learn full-stack development using the MERN stack and only then did I fully understand the constant data exchange between the user and the server. This short article highlights the workflow in a simple MERN app.
Suppose you have ever seen a tutorial video on APIs. In that case, I bet this common analogy that APIs act as waiters in a restaurant bridging the gap between customers and kitchen staff, would not be strange to you.
The React frontend can be likened to diners in a restaurant who interact with the waiters to send and receive food. Mongodb database, the pantry where food recipes and ingredients are stored while the Express backend serves as the kitchen where dishes are prepared. The kitchen pulls from the pantry to prepare dishes for the diners.
The API Endpoints, the waiters, are responsible for carrying requests to the kitchen and delivering responses back to the diners. Each waiter handles a specific task which could be any of a GET, POST, PUT, OR DELETE request.
This analogy has helped paint a brighter picture of how the web works. I look forward to sharing more as I go through this learning curve.
This content originally appeared on DEV Community and was authored by Opajobi Oyegoke
Opajobi Oyegoke | Sciencx (2024-10-22T18:33:30+00:00) High-level workflow in MERN apps. Retrieved from https://www.scien.cx/2024/10/22/high-level-workflow-in-mern-apps/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.