Self-hosted collection tracker for Magic, Pokémon, Naruto and One Piece TCGs, with login & Postgres
440
Self-hosted web app to track your trading card collections — Magic: The Gathering, Pokémon, Naruto and One Piece — with login, a real database (no localStorage) and price data cached from Scryfall / optcgapi.com.
This single image bundles the Angular frontend and the Express/TypeScript backend/API together. It only needs a Postgres database alongside it, run as a separate container via Docker Compose.
tallon43/cards-collectionadmin accounts get an in-app panel to create, promote/demote and delete other users; user accounts only manage their own collection.docker compose version).Download the two files below into an empty folder:
docker-compose.hub.yml → save it as docker-compose.yml.env.example → save it as .envmkdir cards-collection && cd cards-collection
curl -L -o docker-compose.yml https://raw.githubusercontent.com/Mascalerino/cards-colection/main/docker-compose.hub.yml
curl -L -o .env https://raw.githubusercontent.com/Mascalerino/cards-colection/main/.env.example
Edit .env and set your own values — at minimum change DB_PASSWORD and JWT_SECRET, those two have no default and the app refuses to start without them:
DB_USER=cards
DB_PASSWORD=change-this-password
JWT_SECRET=change-this-to-a-long-random-string
JWT_EXPIRES_IN=30d
CORS_ORIGIN=http://localhost:8080
APP_PORT=8080
ADMIN_USERNAME=admin
ADMIN_PASSWORD=
CORS_ORIGIN must match the URL you'll actually use to open the app (e.g. http://192.168.1.50:8080 if you're running this on a home server/NAS).APP_PORT is the port exposed on the host.ADMIN_USERNAME/ADMIN_PASSWORD are optional — docker-compose.hub.yml already defaults ADMIN_USERNAME to admin, and if you leave ADMIN_PASSWORD empty the app generates a random one and prints it once in the logs (step 4 below). Set them yourself here only if you'd rather choose the password up front.Start the stack:
docker compose up -d
This pulls and starts two containers: db (Postgres) and app (this imogether). Database migrations run automatically when the app starts, and sodoes your admin account.
Get your admin credentials and log in:
docker compose logs app | grep -A3 "Usuario administrador"
If you set ADMIN_PASSWORD yourself in .env, use that. Otherwise copy the generated password shown in the logs — it's only ever printed that one time. Open http://<your-server>:8080 and log in.
If you'd rather build from source than pull the pre-built image, clone the cluded Dockerfile — it's a multi-stage build that compiles the Angularfrontend and the Express/TypeScript backend and packages them together, so there's nothing else to install:
git clone https://github.com/Mascalerino/cards-colection.git
cd cards-colection
docker build -t cards-collection:latest .
The build needs no arguments and no external services — it only touches the network to run npm install for the frontend and backend. It produces the exact same image published here as tallon43/cards-collection.
To run it, use the repo's own docker-compose.yml (it builds instead of pulling):
cp .env.example .env # then edit DB_PASSWORD, JWT_SECRET, ADMIN_USERNAME/ADMIN_PASSWORD, etc.
docker compose up -d --build
That's the same db + app stack described above, just built locally instead of pulled from Docker Hub. Rebuild and restart after pulling new commits with docker compose up -d --build again.
| What | Required? | Where | Variable |
|---|---|---|---|
| Database password | Required, no default | .env, before starting the stack | DB_PASSWORD=... |
| JWT signing secret | Required, no default | .env, before starting t` | |
| Admin username (first account) | Optional — defaults to admin | docker override in .env` if you want a different one | ADMIN_USERNAME=... |
| Admin password (first account) | Optional — auto-generated and logged if left empty | .env, or just leave it blank | ADMIN_PASSWORD=... |
ADMIN_USERNAME/ADMIN_PASSWORD only ever create the account once: if a user with that username already exists, the app leaves it untouched — so it's safe to keep them in
.env (or the auto-generated one) across restarts and updates, they won't There is no public sign-up form; this is the only way to get a first account.
Once logged in as an admin, open the Administration panel (top-left button on the main page). From there an admin can:
user or admin), with a username and password.user to admin or demote an admin back to user.user accounts only see and manage their own collection; admin accounts additionally get access to this panel. An admin can't change their own role or delete their own account (to avoid accidentally locking yourself out) — do that from another admin account.
docker compose pull
docker compose up -d
Migrations are applied automatically on startup, so it's safe to update at
All collection data lives in the db container's db_data volume. Back its volume, or use the app's built-in Export feature (Menu → Export) todownload a full JSON backup of your collections.
Content type
Image
Digest
sha256:02bb4c25b…
Size
52.6 MB
Last updated
19 days ago
docker pull tallon43/cards-collection