Install with Source
Cafe Variome V4 can be installed from source code as a testing or development instance.
In production, it is recommended to use either containers like docker or orchestration tools like kubernetes. For more information, please refer to the Docker Installation Guide.
Prerequisites
Cafe Variome V4 requires the following software to be installed:
- A supported database, for now only MongoDB is supported.
- A supported KMS service, for now only Vault by HashiCorp is supported.
Optionally, you may want to prepare the following:
- A supported message broker / cache database, for now only Redis is supported. If omitted, the application will run with in-memory caching. Note that this is not recommended for multiprocess deployments. The in-memory cache will be lost when the application is restarted.
- A supported vector database, for now only qdrant is supported. This is needed for free text search and RAG (Retrieval Augmented Generation) for LLMs (Large Language Models). If omitted, the application will run without these features.
- One or more OIDC providers for authentication. Cafe Variome V4 defaults to internal authentication with username and password, but it is recommended to use an OIDC provider for better security and user management, and to synchronise users across multiple instances.
- A way to send emails, either an SMTP service or a Mail Transfer Agent (MTA) configured on the server. Without this, the application cannot use email for password reset and email verification, and all operations require admin to handle them manually.
Refer to the System Requirements page for more details for each of these components, hardware/OS requirements, and brief instructions to install them.
Installing the Backend
The backend of Cafe Variome V4 is a Python FastAPI application. It is recommended to install it in a Python virtual environment or use tools like Anaconda.
sudo apt update
sudo apt install -y python3 python3-venv python3-pip git libcairo2-dev
git clone https://github.com/CafeVariomeUoL/cafe-variome-4.git
cd cafe-variome-4
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
# The backend can be installed with different optional dependencies. The `all` option installs a recommended set of dependencies.
pip install .[all]
# Create a configuration file
cp example.env ./conf/.env
# Edit the configuration file to set up database, KMS, and other settings
nano ./conf/.env
# When configured, run the backend server
python src/cafe_variome/migration/migrate.py
# Or, using script
cafe-variome-4-migrate
uvicorn cafe_variome.asgi:app --host 127.0.0.1 --port 5000 --log-config conf/uvicorn-log.config.yaml
# Or, using script
cafe-variome-4
Installing the Frontend
The frontend of Cafe Variome V4 is a React/Vite application. It requires Node.js and npm to be compiled, and needs a web server to serve the static files.
sudo apt install -y nodejs npm git nginx
git clone https://github.com/CafeVariomeUoL/cv4-frontend.git
cd cv4-frontend
npm install
npm run build
# Copy the built files to the web server directory
sudo cp -r dist/* /var/www/html/
# Edit the web server configuration to set up reverse proxy to the backend
sudo nano /etc/nginx/sites-available/default