Development Setup¶
Requirement(s)¶
Docker with compose plugin (https://docs.docker.com/get-docker/)
Python >= 3.10 (https://www.python.org/downloads/)
NodeJS >= 9.4 (https://nodejs.org/en/)
Getting started¶
Create a Virtual environment for the project
$ python -m venv venv
$ source venv/bin/activate
Install Python requirements
(venv) $ pip install -r requirements-generated.txt
Install NodeJS requirements
(venv) $ cd src/bmui
(venv) $ npm install
Start PostgreSQL and RabbitMQ using Docker compose
(venv) $ docker compose up --force-recreate
Run Alembic to update database schema to latest revision
(venv) $ cd src/bmapi
(venv) $ alembic upgrade head
Run User Interface Development Web Server
(venv) $ cd src/bmui
(venv) $ npm run start-dev
Start Web API Server and Jobs Worker
(venv) $ export FLASK_APP=src/bmapi/server.py
(venv) $ export FLASK_DEBUG=1
(venv) $ export PYTHONPATH=src/bmapi
(venv) $ python -m flask run --no-debugger
(venv) $ export PYTHONPATH=src/bmapi
(venv) $ python src/bmapi/jobs_worker.py --debug
Access the application at http://localhost:8080
Integrated Development Environment¶
We’re using Visual Studio Code as IDE (https://code.visualstudio.com/). We got everything setup in this repository to use it.
It fairly simple to use. Just do the initial setup as mention in the Getting started section, step 1 to 3. Use Task(s) to start docker compose Docker Compose Up and Start UI with Start UI Dev server.
After that you can attach to the API and the Jobs Worker using the Launch options (Jobs Worker (remote), BMAPI (remote)), you can also use breakpoint and debug it. You can now browse the applcation at http://localhost:8080