-
Start the docker-compose stack
The backend requires some middleware, including PostgreSQL, Redis, and Weaviate, which can be started together using
docker-compose
.cd docker cp middleware.env.example middleware.env docker compose -f docker-compose.middleware.yaml -p mvp up -d cd ../api
-
Copy
.env.example
to.env
-
Generate a
SECRET_KEY
in the.env
file.# For Linux sed -i "/^SECRET_KEY=/c\SECRET_KEY=$(openssl rand -base64 42)" .env # For Mac secret_key=$(openssl rand -base64 42) sed -i '' "/^SECRET_KEY=/c\\ SECRET_KEY=${secret_key}" .env
-
Create environment.
The MVP API service uses Poetry to manage dependencies. Execute
poetry shell
to activate the environment. -
Install dependencies
poetry env use 3.10 poetry install
-
Run migrate
Before the first launch, migrate the database to the latest version.
poetry run python -m flask db upgrade
-
Start backend
poetry run python -m flask run --host 0.0.0.0 --port=5001 --debug
-
Start the frontend service (if applicable).
-
Setup your application by visiting
http://localhost:3000
(adjust the port if necessary). -
If you need to process async tasks, start the worker service:
poetry run python -m celery -A app.celery worker -P gevent -c 1 --loglevel INFO -Q main
-
Install dependencies for both the backend and the test environment
poetry install --with dev
-
Run the tests locally
cd ../ poetry run -C api bash dev/pytest/pytest_all_tests.sh