Skip to content

Commit

Permalink
Updated the docs on Architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Feb 16, 2025
1 parent baa2420 commit 6f0bd40
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

Some familiarity with [JavaScript modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#importing_modules_using_import_maps) as well as with Symfony's [Asset Mapper](https://symfony.com/doc/current/frontend/asset_mapper.html) component is recommended in order to follow this section.

The ChesslaBlab website is a multi-page application (MPA) that is not adhering to the MVC architectural pattern. The controller actions are basically sending an HTML document to the browser on each request. The business logic is implemented in the chess server.

In this website architecture in particular, there is no model layer (M) and as a result the Controller layer (C) remains quite basic as in the following example. The main reason behind a multi-page architecture like this one as opposed to a single-page architecture is that we want the pages to be indexed by web crawlers.
The ChesslaBlab website is a multi-page application (MPA) where controller actions are basically sending an HTML document to the browser on each request. The business logic is implemented in the chess server, and as a result the controller layer remains thin as in the following example.

```php
<?php
Expand All @@ -25,7 +23,7 @@ class ComputerController extends AbstractController
}
```

As a rule of thumb, there is a `.twig.html` file and a `.js` file associated to each controller action. So the structure of the [App\Controller\Pages](https://github.com/chesslablab/website/tree/main/src/Controller/Pages) namespace is mirroring the structure of both the [templates/pages](https://github.com/chesslablab/website/tree/main/templates/pages) folder and the [assets/js/pages](https://github.com/chesslablab/website/tree/main/assets/js/pages) folder.
As a rule of thumb, there is a `.twig.html` file and a `.js` file associated to each controller action.

- [src/Controller/Pages/Play/ComputerController.php](https://github.com/chesslablab/website/blob/main/src/Controller/Pages/Play/ComputerController.php)
- [templates/pages/play/computer/index.html.twig](https://github.com/chesslablab/website/blob/main/templates/pages/play/computer/index.html.twig)
Expand Down

0 comments on commit 6f0bd40

Please sign in to comment.