Skip to content

Commit

Permalink
docs: add project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
livioribeiro committed Dec 15, 2024
1 parent abe984a commit c36c219
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/structure.md
Original file line number Diff line number Diff line change
@@ -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
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ markdown_extensions:
nav:
- Selva: index.md
- tutorial.md
- structure.md
- controllers.md
- routing.md
- templates.md
Expand Down

0 comments on commit c36c219

Please sign in to comment.