diff --git a/docs/structure.md b/docs/structure.md new file mode 100644 index 0000000..4a49b68 --- /dev/null +++ b/docs/structure.md @@ -0,0 +1,46 @@ +# Project Structure + +In a Selva project, you need to define at least the `application`. + +It can be a Python module or package and represents the main code of the project. +Any controllers or services defined under it will be discovered and registered +in the dependency injection context. + +If your project is small, you can just define the `aplication.py` module, but you +can have any structure you need inside the `application` package. + +For example: + +``` +project/ +└── application/ + ├── __init__.py + ├── controller/ + │ ├── __init__.py + │ ├── public/ + │ │ ├── __init__.py + │ │ ├── about.py + │ │ ├── home.py + │ │ └── product.py + │ └── private/ + │ ├── __init__.py + │ ├── category.py + │ ├── customer.py + │ └── product.py + ├── model/ + │ ├── __init__.py + │ ├── category.py + │ ├── customer.py + │ └── product.py + ├── repository/ + │ ├── __init__.py + │ ├── category.py + │ ├── customer.py + │ └── product.py + └── service/ + ├── __init__.py + ├── category.py + ├── customer.py + ├── email.py + └── product.py +``` diff --git a/mkdocs.yml b/mkdocs.yml index 7c94bb4..e2f5d75 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -43,6 +43,7 @@ markdown_extensions: nav: - Selva: index.md - tutorial.md + - structure.md - controllers.md - routing.md - templates.md