Chapter 02Field guide
The web layer carries the request inward.
Between the browser and the application sits the web layer. It receives requests, shapes responses and gives the rest of the system a stable way to communicate.
At the web layer, full stack developers need to be familiar with server side technologies like Node.js and PHP. They should be able to build RESTful APIs and use tools like Express.js and Zend Framework to develop web services. They should also be familiar with database technologies like MySQL and MongoDB.
What the layer owns
The web layer owns the conversation between the interface and the application. It validates requests, applies the rules that belong at the edge, calls the application services and sends a response that the interface can use. It is also where authentication, session handling and many operational concerns meet.
Two server side routes
Node.js lets a team use JavaScript on the server as well as in the browser. PHP has a long history in web applications and remains a practical choice for many systems. The language matters less than the clarity of the boundary: a request should arrive, be understood and receive a useful answer.
APIs are the contract
A RESTful API gives the interface and other clients a predictable way to ask for work. Express.js and Zend Framework are examples of tools that help structure those services. A good API makes the common path easy and the failure path explicit.
The database enters the picture
The web layer often talks to MySQL or MongoDB, but it should not become the place where every data rule lives. The web layer can shape a request and enforce a boundary. The data layer still owns the structure and integrity of the stored information.
Where the layer connects
To the outside, the web layer serves the interface. To the inside, it calls the application layer and works with the data layer. Clear contracts at both edges keep the system understandable when a team changes.
03 / Continue Application: see where the logic livesReference shelf
Read the server side.
Primary documentation for the languages, tools and protocols named in this chapter.