el-contador
v1.2.15
Published
Bookkeeping and expense management – run with Docker
Downloads
714
Maintainers
Readme
El Contador
Bookkeeping and expense management – expenses, sales, bank transactions, and reconciliation. Run with Docker.
Install (first time)
To use from npm: the package must be published first (npm publish from the repo); then npm install el-contador works. Before publishing or to use the latest from Git: npm install github:YOUR_ORG/el-contador (replace with your repo URL).
You do not need to install PostgreSQL on the host or create a database/user manually. The first run creates everything from your .env: PostgreSQL runs in a container and creates the user and database automatically; the app then applies the schema and creates the admin user.
Create a project directory and add the package:
mkdir my-books && cd my-books npm init -y npm install el-contadorCreate
.envwith the credentials you want (these will be used to create the PostgreSQL user and database on first run):cp node_modules/el-contador/.env.example .envEdit
.envand set at least:- DB_PASSWORD – password for the database (required).
- SESSION_SECRET – long random string for session cookies.
Optional: DB_USER (default
el_contador), DB_NAME (defaultel_contador_finance). The first run will create this PostgreSQL user and database inside the container; no separate setup needed.Run
npx el-contador(ordocker compose ...) from the same directory that contains.env. If you seeSet DB_PASSWORD in .env, create or fix.envin that directory.Start the app (this starts PostgreSQL and the backend; on first run the DB and admin user are created):
npx el-contadorOr without the CLI:
docker compose --project-directory node_modules/el-contador -f node_modules/el-contador/docker-compose.yml --env-file .env up -dOpen the admin UI at
http://localhost:3080(or the port inADMIN_PORT). Log in with the admin user: INIT_ADMIN_EMAIL from.env(default[email protected]), and INIT_ADMIN_PASSWORD or DB_PASSWORD if not set.
Deploy on another server
On a new server (VPS, dedicated, etc.):
- Install Node.js (v18+), npm, Docker, and Docker Compose V2 (
docker compose). The CLI requires the Compose plugin; legacydocker-compose(V1) is not supported. - Create a directory and install the app as above (e.g.
npm init -y,npm install el-contador, copy.env.exampleto.env, setDB_PASSWORDandSESSION_SECRET). - Start with
npx el-contador(or thedocker compose -f ...command). The app listens onADMIN_PORT(default 3080) on the host. - To expose it on a subdomain or domain (e.g.
admin.example.com), configure a reverse proxy (nginx, Caddy, or Apache) on that server. The package does not install or configure nginx for you; you add the proxy config yourself. See below.
Nginx reverse proxy (subdomain / domain)
The app is built to run behind a reverse proxy (trust proxy is enabled). To serve it on a subdomain (e.g. contador.example.com) with nginx:
Ensure the app is running and listening on a port (e.g.
3080) on the same machine.Create a server block for your subdomain. Example (HTTP only):
server { listen 80; server_name contador.example.com; # Allow batch expense import (e.g. 30 files × 1MB) client_max_body_size 35M; location / { proxy_pass http://127.0.0.1:3080; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # Batch expense upload calls Gemini once per file; default 60s proxy timeout often returns 504 proxy_connect_timeout 300s; proxy_send_timeout 300s; proxy_read_timeout 300s; } }Adjust
server_nameand3080if yourADMIN_PORTis different.Reload nginx:
sudo nginx -t && sudo systemctl reload nginx.Point DNS for
contador.example.comto this server’s IP.For HTTPS, use Let’s Encrypt (e.g.
certbot --nginx -d contador.example.com) or add an SSL block; Certbot can add the proxy headers if needed.
The setup does not configure nginx automatically (no install script or config file that edits nginx). You add the server block and DNS yourself so it works with your host and domain.
Update
To get the latest app version:
npm update el-contador
docker compose --project-directory node_modules/el-contador -f node_modules/el-contador/docker-compose.yml --env-file .env up -d --buildIf npm update says "up to date" but a newer version is on npm (npm view el-contador version), install the latest explicitly then rebuild:
npm install el-contador@latest
docker compose --project-directory node_modules/el-contador -f node_modules/el-contador/docker-compose.yml --env-file .env up -d --buildOr use the CLI:
npx el-contador updateAfter a successful update, the backend log will show [email protected] (that version matches the release). Your data (database and uploads) lives in Docker volumes and is not overwritten by updates.
Commands (CLI)
el-contadororel-contador start– start the stack (requires.envin current directory).el-contador downorel-contador stop– stop containers.el-contador update– runnpm update el-contadorthen rebuild and start.
If npx el-contador fails with "docker compose (Compose V2) is required", install the Compose plugin. On Ubuntu the package is in Docker's repo (not default Ubuntu repos). Either add Docker's repository then sudo apt install docker-compose-plugin, or install the binary manually:
sudo mkdir -p /usr/local/lib/docker/cli-plugins
sudo curl -SL "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m)" -o /usr/local/lib/docker/cli-plugins/docker-compose
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
docker compose versionIf you see KeyError: 'ContainerConfig' (Python traceback), you are using legacy docker-compose (V1). Install Docker Compose V2 as above; the CLI no longer falls back to V1.
If you see "compose build requires buildx 0.17.0 or later", the Docker Buildx plugin is missing or too old (e.g. 0.11 stuck from apt). Replace it with a newer binary. On 64-bit Linux, overwrite the existing plugin (usual path on Ubuntu/Debian):
BUILDX_VERSION=v0.32.1
# Where the old buildx usually lives when installed via apt:
BUILDX_DIR=/usr/lib/docker/cli-plugins
# If that dir doesn't exist, use: BUILDX_DIR=/usr/local/lib/docker/cli-plugins && sudo mkdir -p "$BUILDX_DIR"
sudo curl -SL "https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-amd64" -o "${BUILDX_DIR}/docker-buildx"
sudo chmod +x "${BUILDX_DIR}/docker-buildx"
docker buildx versionIf docker-buildx is in a different path (e.g. /usr/libexec/docker/cli-plugins), use that for BUILDX_DIR. On ARM64 use linux-arm64 instead of linux-amd64 in the URL. Then run npx el-contador again.
Publishing to npm (maintainers)
- Create an npm account at npmjs.com/signup if needed.
- Log in from the package root:
npm login(username, password, email; OTP if 2FA is enabled). - Update
repository.urlinpackage.jsonto your real Git URL before publishing. - From this directory (the package root):
npm publish --access public.--access publicis required for unscoped packages. The package includes the fullfrontend/source; the Docker image builds it at build time. - For later releases: bump
versionin both package.json (root) and server/package.json so the backend log shows the correct release (e.g.[email protected]), thennpm publishfrom the package root.
License
MIT
