ZEN Temple is a FastAPI Application.
Create a new conda environment, activate it, and install all dependencies:
conda create --name <your-env-name> python==3.12
conda activate <your-env-name>
pip install -e .
Then, create a new copy of .env
.
cp .env.example .env
Modify the SOLUTION_FOLDER
variable to the location of your solutions. This is the outputs
folder generated by ZEN garden. Look at the page Running a model of the ZEN garden documentation.
Activate your conda environment and run the application with this command:
conda activate <your-env-name>
uvicorn src.zen_temple.main:app --reload
The folder and file structure is the following:
explorer
contains the html files for the frontend.
Warning
Do not edit the files in this folder. This folder is automatically generated by the frontend repository pipeline.
models
contains the Pydantic-models that are used for the documetnation. Some of these models also include generators that create an instance of the model given the path of a solution. See https://fastapi.tiangolo.com/tutorial/body/#create-your-data-model
repositories
contains the repositories for the data access. These provide an abstraction layer for the routers such that the data access is separtated from the data source. Arguably, the generators defined in the models should be part of the repository in order to separate the instanciation of the models from the way that the solutions are stored. For more information visit https://www.umlboard.com/design-patterns/repository.html
routers
contains the FastAPI routers which define the different paths of the API server. For more information visit https://fastapi.tiangolo.com/tutorial/bigger-applications/
config.py
contains the config of the application.
main.py
contains the setup of the FastAPI application. For more information visit https://fastapi.tiangolo.com/tutorial/bigger-applications/
In order to release a new version to Pypi you have to create a new tag in the correct semantic versioning form (i.e. v[0-9]+.[0-9]+.[0-9]+
). Whenever such a tag is created, a new release is generated, the pyproject.toml file is updated and a new version is being published to Pypi.