MEAN Thinking - MEAN Machine - A beginner's practical guide to the JavaScript stack (2015)

MEAN Machine - A beginner's practical guide to the JavaScript stack (2015)

MEAN Thinking

When building MEAN stack applications throughout our book, there’s a certain way of thinking that we’ll want to use. We’re talking about the client-server model.

We are going to think of our application as two separate parts that handle specific tasks. The providers of a resource or service (servers/backend/Node) will handle the data layer and will provide information to our service requesters (clients/frontend/Angular).

Client-Server Model

When building this book, we will be thinking in the [client-server model]. This is a very important concept while we are building our applications and learning the MEAN stack.

Client-Server Model A network architecture in which one program, the client, requests service from another program, the server. They may reside on the same computer or communicate across a network. —

There are many benefits to thinking of your application as two separate parts. By having our server be its own entity with an API from which we can access all of our data, we provide a way to create a scalable application.

This sort of thinking doesn’t just have to be exclusive to the MEAN stack either. There are numerous applications that would benefit from this type of architecture. Having the server-side code be separate lets us create multiple front-end client applications like websites, Android apps,iPhone apps, and Windows apps that all connect to the same data.

We can iterate on our server side code and this will not affect our frontend code. We also see large companies like Facebook, Google, Twitter, and GitHub using this method. They create the API and their frontend clients (website, mobile applications, and third party applications) integrate with it.

Fun Note: The practice of using your own API to build a frontend client is called dogfooding (one of my absolute favorite words).

Here are the parts of our application separated as server and client.

Server Components

· Database (MongoDB)

· Server/API (Node and Express)

Client Components

· Frontend Layer (Angular)

Client to Server Model

Client to Server Model

Book Outline

When building MEAN applications, we are going to look at the duties of the server (Node) and the client (Angular) separately.

1. Chapter 1-3: Getting Started Setting up the tools we’ll need for the book.

2. Chapters 4-9: Server/Backend Concepts, applications, and best practices.

3. Chapters 10-16: Client/Frontend Concepts, applications, and best practices.

4. Chapters 17-19: MEAN Stack Applications Bringing it all together so that we can build amazing applications.

5. Chapters 20-Infinity: More Sample Applications!