r/learnwebdev • • Mar 03 '21

Confused About Middleware / Backend / FullStack

Hi I am pretty new to web development. I am programming native iOS-Apps with Swift for a while. Now since a few months I am learning VueJS.

In my iOS-Projects Im using AWS as a backend service for Authentication, API, Storage, etc.

Now I was reading about 'middleware' with Laravel for Authentication. Where is the difference? I thought to build an enterprise web app with the same data and authentication sources like in my iOS App I could import it to my web-app and use it (e.g. with AWS Amplify). This middleware thing in combination with dynamic websites is pretty confusing from an iOS dev perspective for me. Cant link them together in my brain.

Where is this 'middleware' when looking to my iOS App? How is this handled? Can we even compare it?

And what is FullStack Development? I thought it was Frontend and Backend Development. Or is it Frontend Backend and Middleware?

Would be nice, when someone can give me a little explanation or sources to read where the differences between all these things are.

3 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/xiipaoc Mar 04 '21

I haven't used AWS API Gateway before, so I have no idea how it works or if it even accepts any middleware. It will also depend on how the gateway actually calls your app. I don't know how much of the process is handled by one versus the other.

But basically, any sort of middleware works like this. You have some function with an input that produces an output (this is pseudocode; I'm not following syntax rules very closely):

function processInput(input) {
    output = whatever(input); // generate some basic output
    // do stuff
    doMiddleware(input, output); // this could change the input and output objects or maybe throw an exception
    // do more stuff
    return output;
}

function doMiddleware(input, output) {
    for (middleware in middlewares) middleware(input, output); // middlewares is populated earlier with your middlewares
}

This might be a multi-step process, with different middlewares at different points. There will generally be some system for chaining middleware or otherwise combining it. Where this lives depends entirely on what you're doing.

2

u/Positive-Banana-5350 Mar 19 '26

I just want to say, thank you for your time in writing this because, as someone who knows nothing about programming, I feel like I know tons more after reading this.