App structure
The file structure of a typical Meya app
In Meya all your bot's BFML code and custom element Python code is stored in files within your app's built-in code repo.
(For the more technically inclined, each app in Meya is backed by its own Git repo and all code changes are pushed/pulled from this internal app Git repo. The Meya CLI abstracts the Git repo away with the meya push
and meya pull
commands, but you can use meya git
to interrogate the app's local git repo 🤓)
Each Meya app usually has the following file structure:
meya-app/
├─ .github/
├─ .meya/
├─ bot/
│ ├─ default.yaml
├─ component/
│ ├─ welcome.py
│ ├─ welcome_test.py
│ ├─ ...
├─ flow/
│ ├─ hi.yaml
│ ├─ welcome.yaml
│ ├─ ...
├─ integration/
│ ├─ db.yaml
│ ├─ sensitive_data.yaml
│ ├─ orb.yaml
├─ translation/
│ ├─ fr/
│ ├─ app.pot
├─ trigger/
├─ .gitignore
├─ .isort.cfg
├─ .meyaignore
├─ config.yaml
├─ pyproject.toml
├─ pytest.ini
├─ README.md
├─ translation_mapping.ini
├─ vault.yaml
.github | If you use GitHub then this folder will contain the specific configuration for GitHub and GitHub actions. |
.meya | This folder contains the app's internal Git repo. Note that this folder is never committed to the remote Git repo. |
bot/ | This folder contains the configuration settings for each bot defined in your app. |
bot/default.yaml | Every Meya app always comes with one default bot. You can set the default bot's configuration settings in this file. See the demo-app 's bot/default.yaml file as an example. |
component/ | The component folder is where you can save your component element Python code. You can create any sub-folder structure in the component folder and reference these from Python and BFML. |
flow/ | The flow folder is where you save all your BFML code. You can create any sub-folder structure in the flow folder. |
integration/ | The integration folder is where you save all your configured integrations. You can create any sub-folder structure in the integration folder to group integrations. |
translation/ | If you're translating your app into multiple languages, this is where you would save all your translation files for each language. |
trigger/ | The trigger folder is where you can save your trigger element Python code. You can create any sub-folder structure in the trigger folder and reference these from Python and BFML. |
.gitignore | This is used to ignore any files you don't want to commit to your own Git repo. (This is only applicable if you use Git to manage code changes across your own team). |
.isort.cfg | This contains the configuration to sort Python module imports in any of your custom Python code. This configuration is used by the meya format command. |
.meyaignore | This is similar to .gitignore except it's for the internal .meya/git/ repo, not your own Git repo. You shouldn't need to modify this file. |
config.yaml | This contains your app's configuration. You can use this file to store any static configuration settings that you would like to use in your BFML code. |
pyproject.toml | This contains the configuration for the Python code formatter. This configuration is used by the meya format command. |
pytest.ini | This contains the configuration for the Python unit test runner. This configuration is used by the meya tests command. |
README.md | Your app's README, this is useful for any technical documentation you would like to share with your bot development team. |
translation_mapping.ini | This contains the configuration settings for the pybabel translation utility. |
vault.yaml | This is a sample vault file that contains all the vault keys your app defines. Note, this is just a reference file, and you should never add any real secrets to this file. |
Example apps
-
hello-world-template: A very simple hello world Meya app. This is often a great starting point for a new app 🚀
-
demo-app: The canonical Meya demo app, that contains many reference flows for the various elements in the Meya SDK.
-
page-demo: Demonstrates how to use page widgets with the Meya Orb Web and Meya Orb Mobile integrations.
-
front-demo: An example app that integrates with Front.
-
fitness-demo: An example app that integrates with Zendesk Support, Zendesk Chat and Zendesk Help Center.
Updated almost 2 years ago