Skip to main content

Middleware

The next concept will cover this in more detail - but the middleware is how the front end and the back end interact. Keep in mind the client side and server side code is run on different computers. So, we need to find a way for two computers to interact - I wonder what we are going to use. The internet

As i said before the internet is all about communication. Middleware are like the sockets that connect the front end to the back end.

The middleware is like a harbour. Each computer (front and back end) must have the necessary infrastructure to receive and send messages to other computers - much like how harbours allow ships to come and go with cargo.

So, this is how the process would go

  1. Frontend needs something (lets say a user just asked to find all items in a catalogue)
  2. Sends the request through the internet to the backend containing everything it needs to fullfil that request (in this case the specific search parameters)
  3. The backend processes that request and sends the results back to the front end
  4. The front end receives those results

All of this communication is facilitated through middleware. It is like - when you are driving a car - you are not interacting with the engine, or with the tyres - you are interacting with buttons and dials that control the engine or the tyres.

The middleware are those buttons and dials - they allow the frontend to access and use backend functions through a exposed interface that is secure and controlled (like how a user can only interact with the engine through pedals)

I know this seems a little bit abstract but we will go through more concrete examples in the API section.