wp6_plorabunt_be/README.md

2.4 KiB

ITSERR WP6 Plorabunt — Backend

Backend API for the ITSERR WP6 Plorabunt project. This service provides functionalities for CSV import, dynamic table management, semantic search (powered by Qdrant and embeddings), and resource retrieval APIs.

This project is part of a larger ecosystem. Here are the related repositories:

Prerequisites

  • Python: >= 3.11
  • PostgreSQL: Required for data storage and metadata.
  • Qdrant: Required for semantic search capabilities.

Quick Start (Local Development)

1. Environment Setup

Create and activate a virtual environment:

python -m venv .venv
.\.venv\Scripts\Activate.ps1

2. Install Dependencies

pip install -r requirements.txt

3. Configuration

Set the required environment variables. Example for PowerShell:

$env:POSTGRES_USER = "itserr_user"
$env:POSTGRES_PASSWORD = "your_password"
$env:DB_HOST = "localhost"
$env:DB_PORT = "5432"
$env:POSTGRES_DB = "itserr_db3_plorabunt"
$env:QDRANT_HOST = "localhost"
$env:QDRANT_PORT = "6333"

4. Run the Application

uvicorn app:app --host 0.0.0.0 --port 8004 --reload

Main API Endpoints

  • GET / — Health check / Hello World
  • POST /search — Semantic search
  • POST /keyword-search — Lexical search
  • POST /api/upload/start — CSV upload and schema inference
  • POST /api/upload/confirm — Confirm import and start background job

Technical Documentation

Detailed technical information, including architecture overview and database schemas, can be found in DOCUMENTAZIONE_TECNICA.md.

Deployment

For production, it is recommended to use Docker. See the provided Dockerfile and script.sh for guidance. The application is typically served using Gunicorn with Uvicorn workers.

docker build -t itserr-wp6-be .

Configuration in production is often handled via secrets (e.g., /run/secrets/wp6_services_secret.yml). Check utils/config.py for implementation details.