Local Development
If you are new here, read everything and follow the steps the end.
Develop and Test Locally
We have written a script that makes it easy to run this on any local machine (Mac, WSL2). Only deploy the services you need. This script depends on the env values in .env-dev.
$ ./scripts/run.sh <one or more service names that you are testing>
# names of the services - api, channel, language, flow, retriver, indexerIt's important that we test the data contracts (input / output JSONs) for our service. Run the service in one window, send JSON message to Kafka via another and read the messages generated by your service in another.
# create topics (queues) on kafka
./scripts/create-topic.sh topic_name
# send message to your service
./scripts/send-message.sh topic <json>
# read messages from your service
./scripts/read-message.sh topic
Setting up Local DB
Connecting to database
It will prompt for password.
flow - adding a user
flow - checking state stored in the db
Data Contracts
See the Pydantic models lib/data_models.py
API
Indexer
topic: indexer message:
Steps
Create environment by copying
.env-dev.templateto.env-dev. Update the values if required. You can look at the larger list of constants in.envBring up the service e.g.
api
Make any modifications to the database
Setup a listener to the queue
Test the data contracts by sending a message to the queue or api
Check the database by using DBeaver
Reseting Dev Environment
Often there are times when it's better to start from scratch.
Last updated
Was this helpful?
