Metadata-Version: 2.4
Name: biblioflow-web
Version: 0.2.0
Summary: FastAPI web application for biblioflow bibliometric workflows.
License-Expression: BSD-3-Clause
Keywords: bibliometrics,fastapi,react,biblioflow,science-mapping
Author: Ivan Ogasawara
Author-email: ivan.ogasawara@gmail.com
Requires-Python: >=3.10,<4
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Provides-Extra: dev
Requires-Dist: biblioflow (>=0.2.0)
Requires-Dist: fastapi (>=0.115)
Requires-Dist: httpx (>=0.27) ; extra == "dev"
Requires-Dist: mypy (>=1.10) ; extra == "dev"
Requires-Dist: prisma-flow (>=0.5.0)
Requires-Dist: pydantic (>=2)
Requires-Dist: pytest (>=8) ; extra == "dev"
Requires-Dist: pytest-cov (>=5) ; extra == "dev"
Requires-Dist: python-multipart (>=0.0.9)
Requires-Dist: ruff (>=0.6) ; extra == "dev"
Requires-Dist: uvicorn[standard] (>=0.30)
Project-URL: Documentation, https://osl-incubator.github.io/biblioflow/
Project-URL: Homepage, https://github.com/osl-incubator/biblioflow
Project-URL: Issues, https://github.com/osl-incubator/biblioflow/issues
Project-URL: Repository, https://github.com/osl-incubator/biblioflow
Description-Content-Type: text/markdown

# biblioflow-web backend

FastAPI backend for the `biblioflow-web` application.

This directory is an individual Python package published as `biblioflow-web`. It
serves `/api/*` routes and, in production, serves the built React frontend from
`src/biblioflow_web_backend/static/`.

## Development

```bash
cd packages/biblioflow-web/backend
poetry install --extras dev
PYTHONPATH=src:../../biblioflow/src poetry run pytest \
  --cov=biblioflow_web_backend --cov-fail-under=90
poetry run uvicorn biblioflow_web_backend.main:app --reload --port 0
```

Use `--port 0` to bind a random free port, or pass a fixed port such as
`--port 8000` when the frontend development proxy needs a stable backend URL.

Set `BIBLIOFLOW_WEB_DATA_DIR` to control where projects, uploads, datasets,
exports, and caches are written. Runtime data is never written into the
installed Python package directory.

## PubMed/PMC imports

The backend exposes `POST /api/projects/{project_id}/sources/import` for PubMed
and PubMed Central searches. The route calls the core `biblioflow` API
connectors and stores the result as a regular active dataset.

Configure NCBI contact details with environment variables when desired:

```bash
export BIBLIOFLOW_NCBI_EMAIL="researcher@example.org"
export BIBLIOFLOW_NCBI_API_KEY="optional-key"
```

Submitted API keys are passed to `biblioflow` for the request only; they are not
persisted in project metadata or returned by the API.

## Bundling the frontend

The React source lives in `../frontend`. For release builds, build the frontend
and copy its `dist/` output into the backend static package data:

```bash
cd packages/biblioflow-web/backend
python scripts/build_frontend.py
poetry build
```

Users installing the built `biblioflow-web` wheel or sdist do not need Node/npm.

