# odoo/tutorials architecture

> Architecture diagram of the GitHub repository odoo/tutorials, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/odoo/tutorials
- Repository: https://github.com/odoo/tutorials

## Overview

##### Internal Structure of Each Module
- For each module component, layer its internal architecture as follows:
a. Controllers (if present): These typically handle HTTP routes or business logic. For example, awesome_dashboard/controllers and awesome_owl/controllers should be shown as “Controllers” that interface between the client and the server.
b. Views: Represent the XML or other files that define the UI components (e.g., views in awesome_dashboard/views, awesome_gallery/views, etc.). They are the presentation layer.
c. Static Assets: Include the static directories (e.g., awesome_dashboard/static/src and others) which contain JavaScript, XML templates, and possibly CSS, indicating the front-end logic.
e. Manifest & Initialization Files: These are more about configuration (e.g., __manifest__.py and __init__.py) that enable the module integration in Odoo.

##### Relationships and Data Flow
- From the client (browser) to the Odoo Server, mediated via controllers.
- From controllers to views (which serve the UI), and if applicable, to models for data operations.
- Dependency flows where a module might require actions from the core Odoo framework.
- How static assets (JavaScript files, XML templates) support the rendered views and often interact with the controllers.

##### Architectural Patterns
- Common design patterns in Odoo, such as modularity and extensibility. For example, note that the __manifest__.py files are responsible for declaring module dependencies and configurations.

##### Final Touch
- Be detailed but not overly cluttered: ensure each module’s architectural elements (controllers, views, static, models) are captured and clearly arranged.
- Clearly separating concerns and showcasing integration via the Odoo framework.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["Client (Browser)"]:::client
    Odoo["Odoo Server/Framework"]:::framework

    Client -->|"sends request"| Odoo

    %% Awesome_Clicker Module
    subgraph "Awesome_Clicker Module"
        AC_Init["Init: __init__.py"]:::info
        AC_Manifest["Manifest: __manifest__.py"]:::info
        AC_Init --> AC_Manifest
    end

    %% Awesome_Dashboard Module
    subgraph "Awesome_Dashboard Module"
        AD_Init["Init: __init__.py"]:::info
        AD_Manifest["Manifest: __manifest__.py"]:::info
        AD_Controllers["Controllers"]:::controller
        AD_Static["Static: dashboard.js, dashboard.xml"]:::static
        AD_Views["Views: views.xml"]:::view
        AD_Init --> AD_Manifest
        AD_Controllers -->|"renders"| AD_Views
        AD_Static -->|"supports"| AD_Views
    end

    %% Awesome_Gallery Module
    subgraph "Awesome_Gallery Module"
        AG_Init["Init: __init__.py"]:::info
        AG_Manifest["Manifest: __manifest__.py"]:::info
        AG_Models["Models: ir_action.py, ir_ui_view.py"]:::model
        AG_Static["Static: gallery_view.js"]:::static
        AG_Views["Views: views.xml"]:::view
        AG_Init --> AG_Manifest
        AG_Models -->|"data operations"| AG_Views
        AG_Static -->|"enhances"| AG_Views
    end

    %% Awesome_Kanban Module
    subgraph "Awesome_Kanban Module"
        AK_Init["Init: __init__.py"]:::info
        AK_Manifest["Manifest: __manifest__.py"]:::info
        AK_Static["Static: awesome_kanban_view.js"]:::static
        AK_Views["Views: views.xml"]:::view
        AK_Init --> AK_Manifest
        AK_Static -->|"drives"| AK_Views
    end

    %% Awesome_Owl Module
    subgraph "Awesome_Owl Module"
        AO_Init["Init: __init__.py"]:::info
        AO_Manifest["Manifest: __manifest__.py"]:::info
        AO_Controllers["Controllers"]:::controller
        AO_Static["Static: main.js, playground.js, playground.xml"]:::static
        AO_Views["Views: templates.xml"]:::view
        AO_Init --> AO_Manifest
        AO_Controllers -->|"handles"| AO_Views
        AO_Static -->|"assists"| AO_Views
    end

    %% Odoo Server integrates all modules
    Odoo --> AC_Init
    Odoo --> AD_Init
    Odoo --> AG_Init
    Odoo --> AK_Init
    Odoo --> AO_Init

    %% Class Definitions for color styling
    classDef client fill:#fefefe,stroke:#ced4da,stroke-width:2px;
    classDef framework fill:#d1ecf1,stroke:#0c5460,stroke-width:2px;
    classDef info fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef controller fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef static fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef view fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef model fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;

    %% Click Events
    click AC_Init "https://github.com/odoo/tutorials/blob/18.0/awesome_clicker/__init__.py"
    click AC_Manifest "https://github.com/odoo/tutorials/blob/18.0/awesome_clicker/__manifest__.py"

    click AD_Init "https://github.com/odoo/tutorials/blob/18.0/awesome_dashboard/__init__.py"
    click AD_Manifest "https://github.com/odoo/tutorials/blob/18.0/awesome_dashboard/__manifest__.py"
    click AD_Controllers "https://github.com/odoo/tutorials/tree/18.0/awesome_dashboard/controllers/"
    click AD_Static "https://github.com/odoo/tutorials/tree/18.0/awesome_dashboard/static/src/"
    click AD_Views "https://github.com/odoo/tutorials/blob/18.0/awesome_dashboard/views/views.xml"

    click AG_Init "https://github.com/odoo/tutorials/blob/18.0/awesome_gallery/__init__.py"
    click AG_Manifest "https://github.com/odoo/tutorials/blob/18.0/awesome_gallery/__manifest__.py"
    click AG_Models "https://github.com/odoo/tutorials/tree/18.0/awesome_gallery/models/"
    click AG_Static "https://github.com/odoo/tutorials/tree/18.0/awesome_gallery/static/src/"
    click AG_Views "https://github.com/odoo/tutorials/blob/18.0/awesome_gallery/views/views.xml"

    click AK_Init "https://github.com/odoo/tutorials/blob/18.0/awesome_kanban/__init__.py"
    click AK_Manifest "https://github.com/odoo/tutorials/blob/18.0/awesome_kanban/__manifest__.py"
    click AK_Static "https://github.com/odoo/tutorials/tree/18.0/awesome_kanban/static/src/"
    click AK_Views "https://github.com/odoo/tutorials/blob/18.0/awesome_kanban/views/views.xml"

    click AO_Init "https://github.com/odoo/tutorials/blob/18.0/awesome_owl/__init__.py"
    click AO_Manifest "https://github.com/odoo/tutorials/blob/18.0/awesome_owl/__manifest__.py"
    click AO_Controllers "https://github.com/odoo/tutorials/tree/18.0/awesome_owl/controllers/"
    click AO_Static "https://github.com/odoo/tutorials/tree/18.0/awesome_owl/static/src/"
    click AO_Views "https://github.com/odoo/tutorials/blob/18.0/awesome_owl/views/templates.xml"
```
