{"id":20398057,"url":"https://github.com/zgbjgg/dasherl","last_synced_at":"2025-10-15T00:40:23.675Z","repository":{"id":57488180,"uuid":"169609888","full_name":"zgbjgg/dasherl","owner":"zgbjgg","description":"Dasherl - A deployment environment and builder for Dash apps running from Erlang/Elixir","archived":false,"fork":false,"pushed_at":"2019-11-27T17:22:05.000Z","size":1793,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-22T05:39:16.078Z","etag":null,"topics":["dash","elixir","erlang","gunicorn","plotly","python","wsgi","wsgi-server"],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zgbjgg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-07T17:12:32.000Z","updated_at":"2024-07-10T09:46:39.000Z","dependencies_parsed_at":"2022-08-29T13:31:15.858Z","dependency_job_id":null,"html_url":"https://github.com/zgbjgg/dasherl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zgbjgg/dasherl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgbjgg%2Fdasherl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgbjgg%2Fdasherl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgbjgg%2Fdasherl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgbjgg%2Fdasherl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zgbjgg","download_url":"https://codeload.github.com/zgbjgg/dasherl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgbjgg%2Fdasherl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279032462,"owners_count":26089384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dash","elixir","erlang","gunicorn","plotly","python","wsgi","wsgi-server"],"created_at":"2024-11-15T04:18:05.883Z","updated_at":"2025-10-15T00:40:23.645Z","avatar_url":"https://github.com/zgbjgg.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dasherl\n\n**Dasherl** - A deployment environment and builder for Dash apps running from Erlang/Elixir\n\n[![Hex.pm](https://img.shields.io/hexpm/v/dasherl.svg)](https://hex.pm/packages/dasherl)\n[![Build Status](https://travis-ci.org/zgbjgg/dasherl.svg?branch=master)](https://travis-ci.org/zgbjgg/dasherl)\n[![Codecov](https://img.shields.io/codecov/c/github/zgbjgg/dasherl.svg)](https://codecov.io/gh/zgbjgg/dasherl)\n[![License: MIT](https://img.shields.io/github/license/zgbjgg/dasherl.svg)](https://raw.githubusercontent.com/zgbjgg/dasherl/master/LICENSE)\n[![Hex.pm](https://img.shields.io/hexpm/dt/dasherl.svg)](https://hex.pm/packages/dasherl)\n[![Hex.pm](https://img.shields.io/hexpm/dw/dasherl.svg)](https://hex.pm/packages/dasherl)\n\nDasherl is a deployment environment (using gunicorn for now) for dash apps using Erlang or Elixir, but also it's a builder for the Dash apps so you can write erlang code (just through nested records) and setup the route to use the erlang code then Dasherl can handle the requests to erlang code as serve as a python code (using dash).\n\nThis project is under development and should not be used in production, it's not ready for that.\n\n**IF YOU ARE LOOKING FOR CREATING ANALYTICAL APPS WITH ELIXIR TRY `QUETZAL`, A PURE LIBRARY WRITTEN IN ELIXIR :bird: !!**\n\n### Creating an isolated environment\n\nTo create an environment with dash running on gunicorn just start a single process. In order to start you need define the settings used by gunicorn, for now there are two options: `bind` that defines the ip and port for wsgi server and `workers`:\n\n```erlang\n(dasherl@hurakann)1\u003e Settings = [{bind, \"127.0.0.1:8000\"}, {workers, 3}]\n[{bind,\"127.0.0.1:8000\"},\n {workers,3}]\n(dasherl@hurakann)2\u003e {ok, Pid} = dasherl_gunicorn_worker:start_link(Settings).\n12:30:02.121 [info] initialized default modules for py pid \u003c0.353.0\u003e\n{ok,\u003c0.352.0\u003e}\n```\n\nNow there are two tools in order to manage the gunicorn server: run or stop. To run server:\n\n```erlang\n(dasherl@hurakann)3\u003e dasherl_gunicorn_worker:run_server(Pid).\nok\n```\n\nThat's all, if all goes ok then point your browser to http://127.0.0.1:8000 and you will see the error 404 page, since there are not routes defined. To stop server:\n\n```erlang\n(dasherl@hurakann)5\u003e dasherl_gunicorn_worker:stop_server(Pid).\nok\n```\n\n### Write it like erlang use it like Dash\n\nThe routes and callbacks are expressed as an erlang terms, so building erlang terms with the dasherl api is enough to build layouts or callbacks for events in the dash app. To simplify work dasherl has a module called compiler so building an entire module (erlang module) with a specific behaviour will be enough to compile that module at runtime and setup layouts and callbacks into dash app.\n\nLet's take the Dash example using python code:\n\n```python\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\n\nexternal_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']\n\napp = dash.Dash(__name__, external_stylesheets=external_stylesheets)\n\napp.layout = html.Div([\n    dcc.Input(id='my-id', value='initial value', type='text'),\n    html.Div(id='my-div')\n])\n\n\n@app.callback(\n    Output(component_id='my-div', component_property='children'),\n    [Input(component_id='my-id', component_property='value')]\n)\ndef update_output_div(input_value):\n    return 'You\\'ve entered \"{}\"'.format(input_value)\n\n\nif __name__ == '__main__':\n    app.run_server(debug=True)\n```\n\nThe above app can be translated to dasherl into erlang module as follows:\n\n```erlang\n-module(mod_example).\n\n-behaviour(dasherl_handler).\n\n-export([layout/0, callbacks/0, my_callback_handler/2]).\n\nlayout() -\u003e\n    Input = dasherl_components:input([{value, 'initial value'}, {type, 'text'}, {id, 'my-id'}]),\n    Div = dasherl_components:divc([{id, 'my-div'}]),\n    dasherl_components:divc([{children, [Input, Div]}]).\n\ncallbacks() -\u003e\n    Output = dasherl_dependencies:output('my-div', 'children'),\n    Input = dasherl_dependencies:input('my-id', 'value'),\n    [{Output, [Input], 'update_output_div', ?MODULE, my_callback_handler}].\n\nmy_callback_handler(_Bind, {InputValue}) -\u003e\n    Retval = \"You've entered \" ++ InputValue,\n    list_to_atom(Retval).\n```\n\nNow in the dasherl console, start the release, after that start the gunicorn worker, this not start the wsgi server, only prepare to compile module and setup all the environment:\n\n```erlang\n(dasherl@zgbjgg)1\u003e {ok, Server} = dasherl_gunicorn_worker:start_link([]).\n{ok,\u003c0.358.0\u003e}\n20:16:41.828 [info] gunicorn is up and running at linked process: ok\n```\n\nNext compile the module above defined, in this case, dasherl needs an url to serve the content:\n\n```erlang\n(dasherl@zgbjgg)2\u003e dasherl:compile(Server, \"/my-route\", mod_example).\nok\n```\n\nFinally run the gunicorn server and go to your browser at: http://127.0.0.1:8000/my-route and you will see the same app as python:\n\n```erlang\n(dasherl@zgbjgg)3\u003e dasherl_gunicorn_worker:run_server(Server).\nok\n```\n\nNice eh? enjoy!!.\n\n### Dash custom app\n\nIn this repo you will find a custom app built in purely erlang using dasherl and jun: https://github.com/zgbjgg/dasherl-custom-app\n\n### @TODO\n\n* Support states into callbacks.\n\n#### Authors\n\n@zgbjgg Jorge Garrido \u003czgbjgg@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzgbjgg%2Fdasherl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzgbjgg%2Fdasherl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzgbjgg%2Fdasherl/lists"}