My topic for today is the MERN stack.
Let's break this one down.
The M stands for MongoDB; great NoSQL database.
There's a lot more on that in other videos that we have.
The E is for Express, your web server.
R for React.
Great web language to build presentation layer, or front ends. And the N is for Node.js, which really empowers it all and brings it all together.
Now that we defined everything, let's kind of show some of the areas I looked at when I evaluated my MERN stack
to use it for my applications and why I made the decisions here and the capabilities that it provides.
So the first.
Let's deal with the front end; I'll break things up by front end, server side, and the back end, or the database layer.
This is how I really kind of conceptually break things down in my separation of concerns.
So let's say the front end.
And what I really look for is the capability, when you do a Web 2.0, is really all about the user experience.
So let's break that up.
And when we come from the LAMP stack to move into other different kind of frameworks,
mainly the MEAN and the MERN, it's really about the level of interaction you can provide from your front end.
And that's really where React kind of comes in.
And it gives you the instant capabilities to produce single page applications, or SPAs, as you can see. Hot keyword.
But really, it's really about building user interfaces that don't have the traditional page loading -- every click loads the entire page
but just really focusing on the content of what needs to, to actually update.
Example of that, if I have a website
that has common sidebar and a table of options.
Every option I click, updates the table.
Updates to table.
Just that part of the website, not necessarily the whole user interface.
And that's really what Web 2.0 accomplishes for you now.
Now React is your language to do that.
Love the declarative nature of that,
where you're just concerned about
what should the state be.
Great opportunity there.
The second -- let's get into your server side.
So on the server.
So I looked at that here,
what flexibility does it offer for me?
When I was in a LAMP stack situation, I was really, the programing language, really had to in this instance, the Node.js,
or in that one the PHP, had to really heavily depend upon its capabilities to provide me all the functionality.
Well, that paradigm shifts upside down.
This is really the core foundation of everything you're doing here.
Let's make that actually another level here.
It's a big separation
from front end and the back end and the server side here.
So with this, you're going to start off by being
on Node.js,
which is going to have, can be extended through
packages called NPMs.
All right.
The Node Package Manager provides you opportunity to augment the capabilities of what Node.js can do.
Just like in app development,
we say there's an app for every kind of utility that you want to do, every function that you want to do.
Same thing -- rule applies when it comes to Node.js and NPMs.
There is always an NPM for anything that you need to do or want to do in your application.
One of the frameworks of that is Express.
And it's built on top of Node.js. Functions as your web server assembly, as do many popular ones out there, like Apache for my LAMP stack.
Now, with the user experience, it gives me that ability to instantly go SPA and do traditional.
I didn't mention that, but I can also still facilitate,
there are some use cases where I
still may want to have a hybrid mixed --
half SPA, half traditional.
I have all that flexibility to do.
Now with server side,
I can really -- that's well a lot of my functionality is. Express gives me the ability to create
REST APIs that can
feed the front end, the React web application, and
also I can do
the REST; I have option for web sockets.
NPMs is where I will actually also bring in my database functionality for me to use; and that's where I'll put this final piece here.
Let's do this.
Let's break that up again.
And that's what we're going to have the database.
I'll abbreviate it here, and this is going to be Mongo.
Again, we have more dedicated videos we can deep dive into Mongo,
but we have that NoSQL nature that it provides here. In these usual scenarios,
all the data I'm providing through REST APIs to my SPA, to React, is going to be JSON objects.
And so we know that Mongo is already set up to be a NoSQL, so no definite SQL structure, all JSON entities or objects.
So that's great.
As you can see, the framework really provides all these set up for you to really work.
And at the end of the day, it's really about the
flexibility.
Let's not forget the overall goal in mind here is to be as efficient and to move as quickly as possible to build our MVPs.
And that's why these stacks are important, is because they already provide these things that work together.
Now, with that particular piece,
I had the separation of the front end from the server side.
So it allows me to move at different speeds.
You know, I can I have that ability to really work on my web front end and only add in things that I need.
I can deploy them independently to actually have them work together.
But that flexibility is very, very important to me and having the ability of almost being able to accommodate most scenarios.
So this quickly became my top choice when it came to build web applications and also APIs to feed mobile applications as well.
Definitely is still in my toolkit whenever a project comes to mind.
All right.
So that's all I have for today.
Please leave your comments below about questions about the MERN stack
or any other topics you would like to see us talk about moving forward.
Till next time, I'm Jamil Spain, technically yours.
If you have any questions, please drop us a line below. And if you want to see more videos like this in the future,
please Like and Subscribe.