Local Server Setup
This guide provides step-by-step instructions on how to set up the Digital Pāḷi Dictionary (DPD) database for use as a local server. This is useful for running the web application locally or providing an API for other dictionary software like GoldenDict or DictTango.
Prerequisites
- uv: This project uses astral uv for dependency management and Python version control. Install it if you haven't already:
- Python:
uvwill automatically manage and install the required Python version for you when you run the setup commands below. There is no need to install Python manually.
Step-by-Step Instructions
1. Download the Repository
Clone the DPD database repository from GitHub (using --depth 1 for a faster download):
2. Setup Dependencies
Use uv to sync the environment and install all necessary dependencies:
3. Download the Databases
You need to download three main database files: the primary DPD database, the audio database, and the translations database.
3.1. Primary DPD Database
Download and extract the latest primary database:
wget -qO- https://github.com/digitalpalidictionary/dpd-db/releases/latest/download/dpd.db.tar.bz2 | tar -xj
3.2. Audio Database
Download the audio database using the provided script:
3.3. Translations Database
Download the Tipiṭaka translations database:
4. Run the Server
Start the local server using uvicorn. By default, this will start the server on port 8080.
5. Access the Web Application
Once the server is running, you can open your web browser and navigate to:
You should now see the DPD web application running locally!
Notes
- Host: Using
--host 0.0.0.0allows the server to be accessible from other devices on your local network. Use--host 127.0.0.1if you want it only accessible from your own machine. - Port: You can change the port by modifying the
--portvalue. - Background Execution: To run the server in the background, you can use
nohuporscreen/tmux.