HCL opensources CouchCompanion
I'm a big fan of Apache CouchDB, so I was very pleased when I got the permission to opensource (is that even a verb) a R&D project we were working on for a while, meet CouchCompanion
Fauxton as role model
We were asking us, how would CouchDB's admin ui Fauxton look like when you rebuild today, what would be the tech stack and new or enhanced features. This is what we can up with:
- build with webcomponents, namely Webawesome and Lit, no big framework like react or angular
- Native
fetch() - All JSON and JS Code editable with the Monaco editor (the one used in VSCode)
- Support to build Mango queries and indici
- Sync with version control (Github for the moment, fighting with CORS and CSP)
- dark/lght mode
- UI to configure OIDC IdP
... and more. There is a capability walkthrough available. But to really get a feel, just run the container:
docker run -d --name couch-companion -p 5984:5984 \
-e COUCHDB_USER=admin -e COUCHDB_PASSWORD=<choose one> \
-v couchdb_data:/opt/couchdb/data \
ghcr.io/hcl-tech-software/couch-companion:latest
The container is based on the official CouchDB image with Fauxton swapped out for CouchCompanion. Give it a spin!
When it comes to databases, I like to have the ability to quickly spin up an instance, try something and shut it down without leaving a trace. For CouchDB I use this script:
#!/bin/zsh
# Run a disposable CouchDB
COUCHCONTAINER=ghcr.io/hcl-tech-software/couch-companion:latest
HOST_PORT=5984
COUCHDB_USER=admin
COUCHDB_PASSWORD=password
COUCHDB_NAME=testcouch
# start couch in the background
docker run -d --rm --name ${COUCHDB_NAME} \
-e COUCHDB_USER=${COUCHDB_USER} \
-e COUCHDB_PASSWORD=${COUCHDB_PASSWORD} \
-p ${HOST_PORT}:5984 \
${COUCHCONTAINER}
# Wait for startup
until [ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:${HOST_PORT}/_up)" -eq 200 ]; do
echo "Waiting for ${COUCHDB_NAME}"
sleep 1
done
echo "CouchDB ${COUCHDB_NAME}" is up"
# create the system databases and one demo
ALL_DBS=("_users" "_replicator" "_global_changes" "demo")
for DB in "${ALL_DBS[@]}"; do
echo "Creating: ${DB}"
curl -u ${COUCHDB_USER}:${COUCHDB_PASSWORD} -X PUT http://localhost:${HOST_PORT}/${DB} -d {}
done
#Log visibility, get out with Ctrl \
docker logs -f ${COUCHDB_NAME}
#Shut down
read -s -k "?Press any key to continue..."
docker stop ${COUCHDB_NAME}
Some parameter explanations:
-drun in background--rmremove container once it shuts down--namegive the container an easy to remember nameread -s -kwait for a button press, specific to zsh
as usual YMMV
Posted by Stephan H Wissel on 09 September 2026 | Comments (0) | categories: CouchDB WebComponents WebDevelopment