Backend for the Buddhanexus project.
Includes:
The frontend README can be found inside ./frontend/README.md
. The rest of this file concerns the python backend (dataloader+api+db)
docker
and docker-compose
:Clone the project repository:
git clone ThisRepository && cd buddhanexus
(substitute ThisRepository with the corect filepath)
Also, in order to load the segment data, it is necessary to create the segment docker volume beforehand:
git clone https://github.com/dharmamitra/dharmanexus-data ; cd dharmanexus-data; make build; make init
This will make sure that the database loads segment files that are valid and up to date.
The match data is a lot and cannot be stored on github. It should be placed in a folder outside of the backend repository. The following variable in the .env configuration needs to point to the local folder with the match data (bo, sa, zh, pa):
LOCAL_MATCHES_PATH=/patch/to/matches/
This project uses pre-commit
to maintain code style and format it using black
.
pre-commit
needs to be installed on your machine. Follow the installation instructions listed here..pre-commit-config.yaml
file installed (currently 3.7).pre-commit install
..env.example
file, copy it and name the copy .env
..env
file. If running online, choose a strong password for arangodb.make run-dev
. This will download docker images and start all services.The API should now be accessible on port 8000.
The API Documentation is also available in the /docs
folder.
If running on a local machine, the address is [http://localhost:8000/docs].
So far the database is empty. To populate it, do the following:
make create-db
.make load-data
.There is also an additional command called make load-data-async
,
which speeds up the data loading process by running it in parallel.
This might overload the database depending on system resources.
The number of threads can be modified in the Makefile
.