Development loop
This page shows three ways to work on OmicsBase. Pick the one that fits your change:
- Change the web pages only (React components, styles, texts): run the page dev server against a local install. See Work on the web pages.
- Change the server or the engine: build the images and run the full stack from source. See Run the full stack from source.
- Change Reports, or test your images before a release: run the local install with your own images. See Run the local install with your own images.
What you need
- Git.
- Docker Engine with Compose v2.
- Node.js 24 and npm. The LibreChat fork names its version in
librechat/.nvmrc. - Python 3.12 or later.
- Quarto 1.11 or later, if you work on these docs.
- Your own key for at least one model provider.
The images are built for Linux on Intel/AMD (amd64). The engine image installs a large R and Bioconductor stack, so its first build takes a long time and needs plenty of disk space.
Get the source
Clone the repository with both submodules:
git clone --recurse-submodules https://github.com/0xMuluh/omicsbase.gitGo into it:
cd omicsbaseCheck that both submodules are filled:
git submodule statusYou should see two lines, one for
librechatand one foropenhands, each starting with a commit.
If you cloned without --recurse-submodules, run git submodule update --init --recursive now.
Work on the web pages
The page dev server (Vite) serves the web pages from your source and reloads them when you save a file. It sends every /api and /oauth request on to a running LibreChat server. The quickest such server is a local install.
Install OmicsBase on your machine as described in Install on your own machine. Its server listens on port 3080.
Open http://localhost:3080 and create your account.
In your clone, go into the fork:
cd librechatInstall the packages:
npm ciBuild the shared packages that the pages import:
npm run build:packagesStart the dev server and point it at port 3080:
BACKEND_PORT=3080 npm run frontend:devYou should see Vite report its address:
➜ Local: http://localhost:3090/Open http://localhost:3090 and sign in with the account from step 2.
Changes under client/src/ show up in the browser when you save. Changes to the server (api/, packages/api/) do not: the server is the one in the install’s image. For those, use the full stack below.
If you change a shared package (packages/data-provider, packages/client, …), run npm run build:packages again.
Run the full stack from source
This runs the same Compose stack as production, with images you build yourself.
1. Copy the settings
From the repository root, copy the three templates into the fork:
cp .env.example librechat/.env cp deployment/librechat.yaml librechat/librechat.yaml cp deployment/docker-compose.override.yml librechat/docker-compose.override.ymlOpen
librechat/.envin an editor.Set
UIDandGIDto your own ids.id -uandid -gprint them.Give each of these a different random value:
JWT_SECRET,JWT_REFRESH_SECRET,ADMIN_PANEL_SESSION_SECRET,MEILI_MASTER_KEY,OMICSBASE_AUTH_SECRETandCREDS_KEY. This command prints one value each time you run it:openssl rand -hex 32Set
CREDS_IVto the output ofopenssl rand -hex 16.Set
ALLOW_REGISTRATION=true, so you can create the first account. Set it back tofalseafterwards if others can reach your machine.Add the key of each model provider you want to use.
Open
librechat/librechat.yaml.Remove the endpoints you have no key for.
Under
mcpServers, change theurlofnotethreadsto the engine in your stack:url: http://engine:8001/sseKeep its
headersandrequiresOAuth: falselines.
Keep .env, keys, databases and project files out of Git.
2. Prepare the folders
Create the folders the stack writes to. The script uses
sudo:scripts/prepare_runtime_dirs.shIt ends with:
Runtime directories prepared.
3. Build the images
Use the same Docker context for building and starting. A Docker context names which Docker engine a command talks to; default is the one on your machine.
Build the LibreChat image:
python3 scripts/build_librechat.py --context defaultIt ends with the tag it built, named after the fork’s commit:
Built omicsbase-librechat:<commit>; running containers were not changed.In
librechat/.env, setOMICSBASE_LIBRECHAT_IMAGEto that tag.Build the engine. This builds
omicsbase-engine-base:devfromdocker/engine-base/first, thenomicsbase-engine:devfromengine/:python3 scripts/build_engine.py --context defaultIt ends with:
Built omicsbase-engine:dev. Running containers and deployment configuration were not changed.
Building never restarts running containers.
4. Build the knowledge index
Download the books and build
engine/knowledge/knowledge.db, using the engine image:docker --context default run --rm --user "$(id -u):$(id -g)" -e HOME=/tmp \ -v "$PWD:/app" --entrypoint python3 omicsbase-engine:dev /app/scripts/setup_knowledge.pyIt prints one
Fetched …line per book, then:Installed <n> chunks from <n> books at …/engine/knowledge/knowledge.db
The stack mounts engine/ into the engine container, so the engine sees the new index without a rebuild. The books keep their own licences; see knowledge/ATTRIBUTION.md. knowledge/README.md shows how to run the same script without Docker.
5. Start the stack
Check the Compose files:
docker --context default compose --project-directory "$PWD/librechat" \ --env-file librechat/.env -p librechat \ -f librechat/docker-compose.yml -f librechat/docker-compose.override.yml config --quietIt prints nothing when the files are valid.
Start the services:
docker --context default compose --project-directory "$PWD/librechat" \ --env-file librechat/.env -p librechat \ -f librechat/docker-compose.yml -f librechat/docker-compose.override.yml up -dOpen http://localhost:3080.
Create your account.
Open a new note and ask for a small R calculation, to check that notes run.
Ports 3000, 3080 and 8001 must be free. Containers with the same names must not belong to another stack.
In this stack the Reports page says Reports is not set up, because no router runs here. To work on Reports, use your own images in the local install.
Apply a change
| You changed | Do this |
|---|---|
A server file listed under volumes in docker-compose.override.yml (for example api/server/routes/notes.js) |
Recreate the api service: add up -d --force-recreate api to the Compose command above. The file is mounted from your checkout, so no rebuild is needed. |
Python code in engine/ |
Restart the engine: docker restart omicsbase-engine. The folder is mounted into the container. |
Anything else in librechat/ (packages/, client/) |
Rebuild with build_librechat.py, set the new tag in .env, and recreate api. |
R packages in docker/engine-base/ |
Rebuild with build_engine.py and recreate engine. |
Run the local install with your own images
The local install takes its images from ghcr.io/0xmuluh/ with the tag in OMICSBASE_VERSION. If an image with that name and tag exists on your machine, Compose uses it. Tag your builds dev to slip them in.
Build the engine, as in Build the images.
Build the Reports image. It is built on top of
omicsbase-engine:dev:python3 scripts/build_openhands.py --context defaultIt installs the interface’s packages, runs its contract tests, type-checks and builds it, then ends with:
Built omicsbase-openhands:dev; running containers were not changed.Build the LibreChat image, as in Build the images.
Give the three images the names the local install uses:
docker tag omicsbase-engine:dev ghcr.io/0xmuluh/omicsbase-engine:dev docker tag omicsbase-openhands:dev ghcr.io/0xmuluh/omicsbase-reports:dev docker tag omicsbase-librechat:<commit> ghcr.io/0xmuluh/omicsbase-librechat:devIn your install’s
.env(by default~/omicsbase/.env), set:OMICSBASE_VERSION=devIn the install folder, start it again:
docker compose up -d
To go back to the published images, set OMICSBASE_VERSION=latest in the same .env and run install.sh again. While it says dev, install.sh stops at the download step, because no dev images are published.
Run the tests
Python tests
From the repository root, run the tests for the Reports gateway, the router and the knowledge setup. They need
pytest,fastapi,httpxandPyJWT:python3 -m pytest testsThe last line counts the results, for example:
33 passedRun the engine tests inside the engine image, which has the engine’s Python packages and R:
docker run --rm -v "$PWD/engine:/app/engine" --entrypoint python3 omicsbase-engine:dev \ -m unittest discover -s /app/engine/tests -t /appIt ends with
OKwhen all tests pass.test_execution_latency.pyandtest_kernel_limits.pystart real R sessions, so they take a while. None of the tests call a model.
LibreChat fork tests
The fork uses Jest, a JavaScript test runner. Run these in librechat/, after npm ci and npm run build:packages.
Test the server package, which holds the notes and Reports code:
npm run test:packages:apiTest the web pages:
npm run test:client
To run one test file, call Jest in its package. For example:
cd packages/api
npx jest src/projects/roihu.spec.tsOpenHands fork tests
From the repository root, run the contract tests without building an image:
python3 scripts/build_openhands.py --verify-onlyIt ends with:
Verification complete (vitest contract tests passed).
Lint rules in the LibreChat fork
The fork checks its code and design rules with ESLint, a code checker. The rules are in eslint.config.mjs. These come up most often:
- No inline styles.
style={{…}}is reported, except for measured geometry such aswidth,height,top,transformandzIndex. Use theme classes. - No arbitrary Tailwind values. Classes such as
w-[37px]ortext-[#333]are reported, except for layout. Use the theme’s scale. - No raw colours. Use the theme’s colour classes.
To lint the whole fork:
npm run lintA Git hook runs the same checks on the files you commit. It runs node and npx from your PATH, and its checks need Node 24. With an older Node first on your PATH, the commit fails. If you use nvm, run nvm use in librechat/ first; it reads .nvmrc.
Preview these docs
Go into the docs folder:
cd docsStart the preview:
quarto previewQuarto opens the site in your browser and reloads a page when you save it.
CI and scripts/publish_docs.sh render with the publish profile (quarto render docs --profile publish). That profile writes llms.txt and needs Quarto 1.11 or later. changelog.qmd is written by scripts/build_changelog.sh, which reads the GitHub releases with the gh command.