BuddhaNexus / buddhanexus

Backend for the Buddhanexus project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

buddhanexus

Backend for the Buddhanexus project.

Includes:

  • API (using fastapi)
  • ArangoDB (in docker)
  • Dataloader - loads texts into the database.

Guide:

1. Setup:

1.1: Install docker and docker-compose:

1.2 Obtain the project files:

Clone the project repository:

git clone https://github.com/ayya-vimala/buddhanexus.git && cd buddhanexus

1.3 Install our githooks:

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.

2. Running:

  • 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].

3. Loading the segment data

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.
Experimental feature:

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.

About

Backend for the Buddhanexus project


Languages

Language:Python 95.2%Language:Makefile 4.8%