Backend for the Buddhanexus project.
Includes:
- API (using fastapi)
- ArangoDB (in docker)
- Dataloader - loads texts into the database.
- install docker
- (optional) run post-installation steps:
- install docker-compose
Clone the project repository:
git clone https://github.com/ayya-vimala/buddhanexus.git && cd buddhanexus
This project uses pre-commit
to maintain code style and format it using black
.
- First,
pre-commit
needs to be installed on your machine. Follow the installation instructions listed here. - You also need to have the Python version listed in the
.pre-commit-config.yaml
file installed (currently 3.7). - Navigate to the project root folder and run
pre-commit install
. - From now on, modified files will be formatted automatically.
- First, open the
.env.example
file, copy it and name the copy.env
. - Modify the variables in the
.env
file. If running online, choose a strong password for arangodb. - Run
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:
- (One-time) To initialize the database and create collections, run
make create-db
. - (Long running task) to load the data into arangodb, run
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
.