Launching
The app can be launched on different data and models, which are defined in a config file.
Different config files are readily available in the repo, under config/
.
TLDR to launch the app locally
Assuming you already installed poetry
and yarn
(See
Initial Setup), you can run the app by performing:
make local_configs # modify all configs for local usage
make CFG_PATH={path to config file} launch.local # Start the backend.
{path to config file}
should be the path in local_configs
. Ex for clinc dummy: local_configs/development/clinc_dummy/conf.json
In another terminal:
Launching locally
When debugging, it is easier to launch the back end and the front end separately, as shown in the next two sections.
However, it is also possible to launch both together using Docker
, as shown in the third section below.
It will just take longer, and does not allow for fast debugging.
Back End
- Config files need to be regenerated for local development.
This will create a new folder
/local_configs
under the project root and will perform the necessary config updates to run locally. -
You can then launch the back end using:
- For
{path to config file}
, use the path to the file inlocal_configs
rather thanconfigs
. Withclinc_dummy
, this will be:
Error in the Back End?
If you get an error while launching the back end, common causes can be that the
poetry
has new dependencies or the configs were changed. Be sure to run:If you get
No module named '_lzma'
...You may be missing the
xz
library (https://tukaani.org/xz/). That would result in aModuleNotFoundError: No module named '_lzma'
when you try to run locally. This may be corrected by using homebrew to install it. The following instructions are inspired from those. - For
From this point, the back end will launch and compute the start-up task.
- You can consult the openapi documentation at
localhost:8091/docs
. From there, you can consult the API documentation and try out the different endpoints. This can be useful for debugging. - Note that the back end will not reload automatically based on code changes.
Cleaning the Cache
If you make changes to back-end modules that result in different module responses, you will need to delete the cache, using:
As soon as you have an error in the start-up task, a good reflex is to use this command. Optionally, you can clean a single project by supplying the project name as an argument. will delete all cache folders beginning withCLINC
.
Front End
You can then launch the front end using:
- The front-end app will launch and automatically connect to the back-end API, assuming you launched it already.
- The front end will hot reload automatically based on code changes.
Error in the Front End?
If you get an error while launching the front end, make sure that the dependencies were updated using yarn
.
Launch Using Docker
- Docker compose will build the images and connect them, using the following command.
Note that the path starts with
/config
as we mount./config:/config
.