Skip to content

Commit

Permalink
review writing style
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-gomes authored Oct 13, 2023
1 parent c06c9dd commit 0db4709
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doc/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ For more details, check out the [Configuration](configuration.md) documentation.
## Models

Models are a layer of abstraction from the underlying data source. They are kept in the `models` folder,
in the root of the project (the `models` folder is in the same place as the `hello.py` file), with one file
at the root of the project (the `models` folder is in the same place as the `hello.py` file), with one file
defining each model. A `Cat` model could be defined by creating the following `cat.py` file in the `models`
folder:

Expand All @@ -70,14 +70,14 @@ For more details, check out the [Models](models.md) documentation.
## Controllers

Controllers are the bridge from the outside world to the app. They define handlers that listen to requested
URLs, perform logic, and return a response. Typically an handler upon receiving a request will do the following:
URLs, perform logic and return a response. Typically a handler upon receiving a request will do the following:

1. Retrieve entities (instances of a model stored in the data source)
2. Invoke their logic (application logic should be encapsulated in the model files)
3. Process a template using the retrieved entities
4. Return the result of that template having been processed as the response

Controllers are kept in the `controllers` folder, in the root of the project (the `controllers` folder is
Controllers are kept in the `controllers` folder, at the root of the project (the `controllers` folder is
in the same place as the `hello.py` file), with one file defining each controller. A `CatController`
could be defined by creating the following `cat.py` file in the `controllers` folder:

Expand Down Expand Up @@ -115,8 +115,8 @@ processed is static content:
</table>
```

Templates are kept in the `templates` folder, in the root of the project (the `templates` folder is
in the same place as the `hello.py` file). For better organization, they can be grouped into sub folders.
Templates are kept in the `templates` folder, at the root of the project (the `templates` folder is
in the same place as the `hello.py` file). For better organization, they can be grouped into sub-folders.
When templates are being processed in a controller, for example, the path provided will be the relative
path from the `templates` folder:

Expand All @@ -135,8 +135,8 @@ Static files are CSS, Images, Javascript files, or any other resource that is to
application (eg: the browser), without any modifications (as opposed to templates, which are processed before
being served).

These files are kept in the `static` folder, in the root of the project (the `static` folder is
in the same place as the `hello.py` file), and can be grouped into sub folders. When static
These files are kept in the `static` folder, at the root of the project (the `static` folder is
in the same place as the `hello.py` file), and can be grouped into sub-folders. When static
files are being referenced in a template, for example, the path provided will be the relative path from the
`static` folder. For example, here's how to reference a Javascript file located in `static/js/main.js`:

Expand Down

0 comments on commit 0db4709

Please sign in to comment.