Initial Setup
Install Dependencies
Install pyenv (MacOS)
We use python 3.9.11 for the back end in our repo, but python >= 3.9.11 should work in general.
You should use pyenv to set up the right python version for the project.
- Install
brew(if not already installed). - Install the
xzlibrary (if not already installed). - Then install
pyenvand set the rightpythonversion. - Add this to your
~/.zshrc: - Run
zshto open a new shell (with the updated~/.zshrc). -
Check that the version of
pythonis the same as you set topyenv local.
Install Poetry
We use poetry as our dependency manager for the back end.
- Install
poetry. -
Check that the version of python that
poetryuses is the same as you set topyenv local. -
Install the dependencies.
Docker (Optional)
Docker is needed for different tasks such as releasing and updating the documentation. However, it won't be needed at first to develop and launch the app. You can skip this step and wait until you are required to use it.
- Install
Docker Desktop. If you are using a Mac, check "Apple logo" > "About This Mac" to know if you have aMac with Intel Chipor aMac with Apple Chip. - Set the memory to at least 9 GB in Docker > Preference > Resources.
Front End
-
Install
Node.jsversion 16. If you need to use different versions of Node on your machine, you may be interested in NVM. Otherwise, the simplest way to install Node on you Mac is to useHomebrew(and follow directions to add this version to your PATH). -
Once you've installed
Node, you can installyarn. -
You can then install front-end dependencies, from the webapp folder, using:
Setting up the development environment
Install IDE
- If developing in back end, we recommend installing PyCharm:
- Install PyCharm.
- In PyCharm preferences, you can add your existing python virtual environment as the "Python Interpreter", pointing where what
poetry run which pythonprints.
- If developing in front end, we recommend installing Visual Studio Code:
- Install Visual Studio Code
- A pre-defined configuration is available in the repo, to help development. Two things to do:
- View > Extensions > search for
esbenp.prettier-vscodeand install it. That's the officialCode formatter using prettierby publisherPrettier. - File > Open Workspace from File > select
azimuth.code-workspace, which will set up two folders:webappand.(for the rest). In thewebappfolder,webapp/.vscode/settings.jsonwill configure Prettier to format your files on save.
- View > Extensions > search for
Pre-commit Hooks
We installed pre-commit hooks which will format automatically your code with each commit. The first time, you need to run the following command.