This guide will help you set up and run the Document Query Application, which consists of a backend API and a frontend user interface.
- Python 3.8+
- Node.js 14+ (includes npm)
- Virtual Environment (Recommended)
python -m venv venv
source venv/bin/activate # Linux/MacOS
venv\Scripts\activate # Windows
pip install -r requirements.txt
python api.py
By default, the backend will be available at http://127.0.0.1:8000
.
cd frontend
npm install
npm run build
Install http-server
globally if not already done:
npm install -g http-server
Start the server:
http-server ./dist
The frontend will be available at http://127.0.0.1:8080
.
- Start both the backend and frontend servers.
- Open a browser and navigate to
http://127.0.0.1:8080
. - Test API interactions through the user interface.
/doc-query-llm
|-- api.py # Backend API script
|-- requirements.txt # Python dependencies
|-- frontend/ # Frontend project directory
|-- package.json # Node.js dependencies
|-- src/ # Source code for the frontend
|-- dist/ # Built frontend files
- Keep
requirements.txt
andpackage.json
updated. - For new Python packages, run:
pip freeze > requirements.txt
- For new Node.js packages, run:
npm install <package> --save
- Always commit both
requirements.txt
andpackage-lock.json
to version control.
This setup guide ensures a smooth deployment and consistent development experience for your application.