Glowie
Edit this page
on GitHub

Basic MVC concepts

What is MVC?

Model-View-Controller (MVC) is an architectural pattern that separates an application into three main logical components: the model, the view, and the controller. Each of these components are built to handle specific development aspects of an application. MVC is one of the most frequently used industry-standard development pattern, and Glowie was built on top of it.

The application flow

The following diagram illustrates the basics of a Glowie application flow.

At its core, after the user types in an URL from your server, the Request is sent to Glowie Router. If a matching route is found and correctly validated, the request is sent to the next step. If there are no matching routes, a 404 Response with a Not Found error is thrown.

Now, if the matching route is protected by any Middlewares, the request will be handled by each one of them. If the middlewares validation is successful, the request is sent to the Controller. Otherwise, a 403 Response with a Forbidden error is thrown. If the route is not protected, this step is skipped.

In the Controller, the application business logic will be applied and a Response will be sent back to the user. In this step, your application can also interact with the Model or View layer.