Skip to content

mlz-cisx/eln-backend

Repository files navigation

MLZ-ELN Backend

Development Server

System Requirements

  • Tested on Ubuntu 22.04.4 Desktop with Python 3.10

Installation Steps

  • Install required packages:

    apt install python3-pip 
  • Install Node.js v22 and npm via NodeSource

  • Install the dependencies for puppeteer (assuming that your Ubuntu Desktop has all its necessary Chromium Dependencies installed, if not, have a look at Dockerfile) with:

    cd joeseln_backend/export && npm install

  • Create a virtual environment (e.g. venv)

  • Install dependencies from requirements.txt

  • Create a PostgreSQL database

  • Create a Typesense service, e.g. with:

    docker-compose up typesense
  • Create two folders for storing uploaded pictures and files, with its paths PICTURES_BASE_PATH and FILES_BASE_PATH

Optional Services

  • For OIDC integration, create a Keycloak service, e.g. with:
    docker-compose up keycloak
  • For OIDC integration you must specify the APP_BASE_PATH

Configuration

Initialization and Server Start

  • Activate the virtual environment:

    source venv/bin/activate
  • Start the websocket server:

    python joeseln_backend/ws/ws_server.py

    Please refer to the websocket configuration in joeseln_backend/conf/base_conf.py

  • joeseln_backend/main.py creates tables and initial admin users

  • cd joeseln_backend

  • Due to nested async calls with websockets, use --loop asyncio to start the development server from directory where main.py is located. Here the application will automatically reload if you change any of the source files:

    uvicorn main:app --reload --port 8010 --host 0.0.0.0 --loop asyncio
  • For more options, see Uvicorn CLI, e.g. you could start the development server with:

    uvicorn main:app --workers 3 --port 8010 --host 0.0.0.0 --loop asyncio

Access

  • Login on MLZ-ELN Frontend with credentials:
    • Username: admin
    • Password: secret

Backend Api

Role Model Documentation

Docker Deployment

  • For using a production-like environment or actual deployment, please refer to the build structure and the comments in docker-compose.yml. Specify your environment variables there. It is recommended to start eln-postgres initially, as it provides the necessary database backend for dependent services.

License

License: AGPL 3

About

Mirror of the MLZ ELN backend

Topics

Resources

License

Stars

Watchers

Forks

Languages