Follow the steps below to set up the Aera platform on your local machine.
The backend requires some middleware, including PostgreSQL, Redis, and Weaviate, which can be started together using docker-compose.
.env.example to .envSECRET_KEY in the .env FileFor Linux:
For Mac:
Aera API service uses to manage dependencies. First, you need to add the Poetry shell plugin, if you don't have it already, in order to run in a virtual environment. [Note: Poetry shell is no longer a native command, so you need to install the Poetry plugin beforehand]
Then, you can execute poetry shell to activate the environment.
Before the first launch, migrate the database to the latest version.
Follow the instructions for setting up the frontend (see below) to start the web service.
Once the web service is running, visit http://localhost:3000 to begin setting up your application.
If you need to handle and debug async tasks (such as dataset importing or document indexing), start the worker service:
Before starting the web frontend service, ensure the following environment is ready:
Node.js >= v22.11.x
pnpm v10.x
First, install the dependencies:
Then, configure the environment variables. Create a file named .env.local in the current directory and copy the contents from .env.example. Modify the values of these environment variables according to your requirements:
For production release, change this to PRODUCTION:
The deployment edition:
The base URL of the console application, which refers to the Console base URL of the web service if the console domain is different from the API or web app domain:
The URL for the web app:
SENTRY configuration:
Finally, run the development server:
Visit http://localhost:3000 in your browser to see the result.
First, build the app for production:
Then, start the server:
If you want to customise the host and port:
If you want to customise the number of instances launched by PM2, you can configure PM2_INSTANCES in the docker-compose.yaml or Dockerfile.
cd ../docker
cp middleware.env.example middleware.env
# Change the profile to another vector database if you're not using Weaviate
docker compose -f docker-compose.middleware.yaml --profile weaviate -p aera up -d
cd ../apicp .env.example .envsed -i "/^SECRET_KEY=/c\SECRET_KEY=$(openssl rand -base64 42)" .envsecret_key=$(openssl rand -base64 42)
sed -i '' "/^SECRET_KEY=/c\\
SECRET_KEY=${secret_key}" .envpoetry self add poetry-plugin-shellpoetry env use 3.12
poetry installpoetry run python -m flask db upgradepoetry run python -m flask run --host 0.0.0.0 --port=5001 --debugpoetry run python -m celery -A app.celery worker -P gevent -c 1 --loglevel INFO -Q dataset,generation,mail,ops_trace,app_deletionpoetry install -C api --with devpoetry run -P api bash dev/pytest/pytest_all_tests.shpnpm installcp .env.example .env.localNEXT_PUBLIC_DEPLOY_ENV=DEVELOPMENTNEXT_PUBLIC_EDITION=SELF_HOSTEDNEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/apiNEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/apiNEXT_PUBLIC_SENTRY_DSN=pnpm run devpnpm run buildpnpm run startpnpm run start --port=3001 --host=0.0.0.0