Home

Awesome


permalink: /index.html

Introduction

Clace is an open-source Apache-2.0 licensed project building a platform to easily develop and deploy self-hosted web applications. The main repository for Clace source code is clace. This repository has the source for Clace app template specs, which can be used as spec argument during app initialization. For example, --spec python-flask. See here for details.

App specs allow for existing applications to be used with Clace with no changes required in the application code. Pass the --spec option during app create. Clace will include the template files from the spec and bring up the application. If the spec uses containers (most do, proxy spec is the exception), then Clace will download the source code, add the template spec files, build the image and start a container with that image. API calls are automatically proxied to the application within the container.

App Specs

Spec NameRequired ParamsOptional ParamsSupports Path RoutingNotesExample
container<ul><li><b>port</b> : The port number within container, optional if EXPOSE directive is present</li></ul>Depends on appRequires app code to have a Containerfile/Dockerfile
image<ul><li><b>image</b>: The image to use for the container</li> <li><b>port</b> : The port number within container</li></ul>Depends on appNo source url required when creating app, use - as urlclace app create --spec image --approve --param image=nginx --param port=80 - nginxapp.localhost:/
proxy<ul><li><b>url</b>: The url to which requests should be proxied</li> </ul>NoNo source url required when creating app, use - as urlclace app create --spec proxy --approve -param url=https://clace.io - proxyapp.localhost:/
python-wsgi<ul><li><b>APP_MODULE</b>: The module:app for the WSGI app. Defaults to app:app, meaning app in app.py</li> </ul>Depends on appRuns Web Server Gateway Interface (WSGI) apps using gunicorn
python-asgi<ul><li><b>APP_MODULE</b>: The module:app for the ASGI app. Defaults to app:app, meaning app in app.py</li> </ul>Depends on appRuns Asynchronous Server Gateway Interface (ASGI) apps using uvicorn
python-flask<ul><li><b>port</b> : The port number within container. If EXPOSE directive is present, that is used. Defaults to 5000</li></ul>Depends on appRuns app using flask dev server
python-streamlit<ul><li><b>app_file</b> : The file name of the streamlit app to run. Default streamlit_app.py</li></ul>Yesclace app create --spec python-streamlit --branch master --approve github.com/streamlit/streamlit-example /streamlit_app
python-streamlit-poetry<ul><li><b>app_file</b> : The file name of the streamlit app to run. Default streamlit_app.py</li></ul>YesInstalls packages using poetry
python-fasthtml<ul><li><b>APP_MODULE</b>: The module:app for the ASGI app. Defaults to app:app, meaning app in app.py</li> </ul>Depends on appRuns app using uvicornclace app create --approve --spec python-fasthtml --param APP_MODULE=basic_ws:app https://github.com/AnswerDotAI/fasthtml/examples fasthtmlapp.localhost:/
python-gradio<ul><li><b>app_file</b> : The file name of the gradio app to run. Default run.py</li></ul>Yesclace app create --spec python-gradio --approve github.com/gradio-app/gradio/demo/blocks_flag /gradio_app
go<ul><li><b>port</b> : The port number within container</li></ul><ul><li><b>MAIN_PACKAGE</b> : The go module to build, default ".". Pass as a --carg instead of --param.</li><li><b>APP_ARGS</b> : Args to pass to the app</li></ul>Depends on appCGO is disabled; go.mod has to be present; app should bind to 0.0.0.0clace app create --approve --spec go --param port=8080 --param APP_ARGS="-addr 0.0.0.0:8080" --branch master github.com/golang/example/helloserver /goapp